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

Commit

Permalink
Remove main navigation tests in favour of new tests in bedrock
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Nov 20, 2015
1 parent 28196ec commit e0618d1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 64 deletions.
24 changes: 0 additions & 24 deletions pages/desktop/base.py
Expand Up @@ -16,10 +16,6 @@ def wait_for_page_to_load(self):
lambda s: 'loaded' in el.get_attribute('class'))
return self

@property
def header(self):
return self.Header(self.testsetup)

@property
def footer(self):
return self.Footer(self.testsetup)
Expand All @@ -36,26 +32,6 @@ def image_source(self, locator):
link = self.selenium.find_element(*locator)
return link.get_attribute('src')

class Header(Page):

nav_links_list = [
{
'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(1) > a'),
'url_suffix': '/about/',
}, {
'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(2) > a'),
'url_suffix': '/contribute/',
}, {
'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(3) > a'),
'url_suffix': '/firefox/products/',
}, {
'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(4) > a'),
'url_suffix': ('//donate.mozilla.org/?presets=100,50,25,15'
'&amount=50&ref=EOYFR2015&utm_campaign=EOYFR2015'
'&utm_source=mozilla.org&utm_medium=referral&utm_content=header'),
}
]

class Footer(Page):

_footer_locator = (By.CSS_SELECTOR, '#colophon')
Expand Down
31 changes: 0 additions & 31 deletions tests/test_about.py
Expand Up @@ -32,37 +32,6 @@ def test_footer_links_are_valid(self, base_url, selenium):
bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code))
assert [] == bad_urls

@pytest.mark.nondestructive
def test_navbar_links_are_visible(self, base_url, selenium):
page = AboutPage(base_url, selenium).open()
bad_links = []
for link in page.Header.nav_links_list:
if not page.is_element_visible(*link.get('locator')):
bad_links.append('The link at %s is not visible' % link.get('locator')[1:])
assert [] == bad_links

@pytest.mark.nondestructive
def test_navbar_link_destinations_are_correct(self, base_url, selenium):
page = AboutPage(base_url, selenium).open()
bad_links = []
for link in page.Header.nav_links_list:
url = page.link_destination(link.get('locator'))
if not url.endswith(link.get('url_suffix')):
bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
assert [] == bad_links

@pytest.mark.link_check
@pytest.mark.nondestructive
def test_navbar_link_urls_are_valid(self, base_url, selenium):
page = AboutPage(base_url, selenium).open()
bad_urls = []
for link in page.Header.nav_links_list:
url = page.link_destination(link.get('locator'))
response_code = page.get_response_code(url)
if response_code != requests.codes.ok:
bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code))
assert [] == bad_urls

@pytest.mark.nondestructive
def test_major_link_destinations_are_correct(self, base_url, selenium):
page = AboutPage(base_url, selenium).open()
Expand Down
9 changes: 0 additions & 9 deletions tests/test_mozillabased.py
Expand Up @@ -87,12 +87,3 @@ def test_footer_section_links(self, base_url, selenium):
if not url.endswith(link.get('url_suffix')):
bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
assert [] == bad_links

@pytest.mark.nondestructive
def test_navbar_links_are_visible(self, base_url, selenium):
page = MozillaBasedPage(base_url, selenium).open()
bad_links = []
for link in page.Header.nav_links_list:
if not page.is_element_visible(*link.get('locator')):
bad_links.append('The link at %s is not visible' % link.get('locator')[1:])
assert [] == bad_links

0 comments on commit e0618d1

Please sign in to comment.