From 366c92e3eebc66570fa40a2801183dff209374aa Mon Sep 17 00:00:00 2001 From: schalkneethling Date: Fri, 9 Oct 2015 13:10:42 +0200 Subject: [PATCH] Fixes contact page tests with the addition of new default tab --- pages/desktop/contact.py | 5 +++++ tests/test_contact.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/desktop/contact.py b/pages/desktop/contact.py index e05b6722..39b544a9 100644 --- a/pages/desktop/contact.py +++ b/pages/desktop/contact.py @@ -14,6 +14,7 @@ def go_to_page(self): self.open('/contact/') _spaces_tab_locator = (By.CSS_SELECTOR, '.category-tabs > li[data-id=spaces]') + _contact_tab_locator = (By.CSS_SELECTOR, '.category-tabs > li[data-id=contact]') _communities_tab_locator = (By.CSS_SELECTOR, '.category-tabs > li[data-id=communities]') _spaces_tab_link_locator = (By.CSS_SELECTOR, '#page-content > .category-tabs > li[data-id=spaces] > a') @@ -26,6 +27,10 @@ def wait_until_element_visible(self, element): self.selenium.execute_script("window.scrollTo(0, 0)") WebDriverWait(self.selenium, timeout).until(EC.visibility_of(element)) + @property + def contact_tab(self): + return self.selenium.find_element(*self._contact_tab_locator) + @property def spaces_tab(self): return self.selenium.find_element(*self._spaces_tab_locator) diff --git a/tests/test_contact.py b/tests/test_contact.py index 06f82033..69eede72 100644 --- a/tests/test_contact.py +++ b/tests/test_contact.py @@ -26,10 +26,10 @@ def test_spaces_links_are_correct(self, mozwebqa): self.check_bad_links(spaces_page, spaces_page.spaces_nav_links_list) @nondestructive - def test_start_on_spaces(self, mozwebqa): + def test_start_on_contact(self, mozwebqa): contact_page = Contact(mozwebqa) contact_page.go_to_page() - assert 'current' == contact_page.spaces_tab.get_attribute('class'), 'Page does not start on spaces tab.' + assert 'current' == contact_page.contact_tab.get_attribute('class'), 'Page does not start on contact us tab.' @nondestructive def test_switching_tabs_list_display(self, mozwebqa):