diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 9bd9b71c20a..18551925d8b 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -4,10 +4,6 @@ import pytest -VIEWPORT = { - 'desktop': {'width': 1280, 'height': 1024}, - 'mobile': {'width': 320, 'height': 480}} - @pytest.fixture def capabilities(request, capabilities): @@ -59,10 +55,12 @@ def filter_capabilities(request): @pytest.fixture -def selenium(request, selenium): - viewport = VIEWPORT['desktop'] - request_keywords_viewport = request.keywords.get('viewport') - if hasattr(request_keywords_viewport, 'args'): - viewport = VIEWPORT[request_keywords_viewport.args[0]] - selenium.set_window_size(viewport['width'], viewport['height']) +def selenium(selenium): + selenium.set_window_size(1280, 1024) # width, height + return selenium + + +@pytest.fixture +def selenium_mobile(selenium): + selenium.set_window_size(320, 480) # width, height return selenium diff --git a/tests/functional/test_contact.py b/tests/functional/test_contact.py index 7029d7b6a67..ba4eff3f1e4 100644 --- a/tests/functional/test_contact.py +++ b/tests/functional/test_contact.py @@ -66,22 +66,20 @@ def test_communities_region_menus(slug, base_url, selenium): @pytest.mark.nondestructive -@pytest.mark.viewport('mobile') -def test_spaces_mobile_navigation(base_url, selenium): - page = SpacesPage(selenium, base_url, slug='').open() +def test_spaces_mobile_navigation(base_url, selenium_mobile): + page = SpacesPage(selenium_mobile, base_url, slug='').open() assert not page.is_desktop_nav_displayed assert page.is_mobile_nav_displayed expected_url = '/contact/spaces/mountain-view/' page.select_mobile_nav_item('Mountain View', expected_url) - assert expected_url in selenium.current_url, 'Page did not navigate to expected URL' + assert expected_url in selenium_mobile.current_url, 'Page did not navigate to expected URL' @pytest.mark.nondestructive -@pytest.mark.viewport('mobile') -def test_communities_mobile_navigation(base_url, selenium): - page = CommunitiesPage(selenium, base_url, slug='').open() +def test_communities_mobile_navigation(base_url, selenium_mobile): + page = CommunitiesPage(selenium_mobile, base_url, slug='').open() assert not page.is_desktop_nav_displayed assert page.is_mobile_nav_displayed expected_url = '/contact/communities/north-america/' page.select_mobile_nav_item('North America', expected_url) - assert expected_url in selenium.current_url, 'Page did not navigate to expected URL' + assert expected_url in selenium_mobile.current_url, 'Page did not navigate to expected URL' diff --git a/tests/functional/test_history.py b/tests/functional/test_history.py index 6faf9c693cf..3720c4c1531 100644 --- a/tests/functional/test_history.py +++ b/tests/functional/test_history.py @@ -16,9 +16,8 @@ def test_slideshow_displayed(base_url, selenium): @pytest.mark.nondestructive -@pytest.mark.viewport('mobile') -def test_list_displayed(base_url, selenium): - page = HistoryPage(selenium, base_url).open() +def test_list_displayed(base_url, selenium_mobile): + page = HistoryPage(selenium_mobile, base_url).open() assert not page.is_slideshow_displayed assert not page.is_previous_button_displayed assert not page.is_next_button_displayed diff --git a/tests/functional/test_navigation.py b/tests/functional/test_navigation.py index 58c4f693c5b..6ab68a41a57 100644 --- a/tests/functional/test_navigation.py +++ b/tests/functional/test_navigation.py @@ -23,19 +23,18 @@ def test_navigation(base_url, selenium): @pytest.mark.nondestructive -@pytest.mark.viewport('mobile') -def test_mobile_navigation(base_url, selenium): - page = HomePage(selenium, base_url).open() +def test_mobile_navigation(base_url, selenium_mobile): + page = HomePage(selenium_mobile, base_url).open() page.navigation.show() firefox_desktop_page = page.navigation.open_firefox_desktop_page() - assert firefox_desktop_page.seed_url in selenium.current_url + assert firefox_desktop_page.seed_url in selenium_mobile.current_url page.open() page.navigation.show() developer_edition_page = page.navigation.open_developer_edition_page() - assert developer_edition_page.seed_url in selenium.current_url + assert developer_edition_page.seed_url in selenium_mobile.current_url page.open() page.navigation.show() about_page = page.navigation.open_about_page() - assert about_page.seed_url in selenium.current_url + assert about_page.seed_url in selenium_mobile.current_url