Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Fixes contact page tests with the addition of new default tab
Browse files Browse the repository at this point in the history
  • Loading branch information
schalkneethling committed Oct 9, 2015
1 parent f1ff396 commit 366c92e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pages/desktop/contact.py
Expand Up @@ -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')
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_contact.py
Expand Up @@ -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):
Expand Down

0 comments on commit 366c92e

Please sign in to comment.