Skip to content
Browse files

Merge pull request #21 from casschin/test-fixes

Fixes test fails due to page changes made to http://quality.mozilla.org
  • Loading branch information...
2 parents 400a128 + ad169eb commit a5413a5f4dc57a5a54e0da1fdc2478442d2cd226 @bobsilverberg bobsilverberg committed Jul 19, 2013
Showing with 22 additions and 18 deletions.
  1. +1 −0 .gitignore
  2. +15 −12 pages/home.py
  3. +6 −6 tests/test_home_page.py
View
1 .gitignore
@@ -3,3 +3,4 @@
*.komodoproject
*.project
*.pydevproject
+results
View
27 pages/home.py
@@ -23,23 +23,26 @@ class HomePage(Base):
_news_items_locator = (By.TAG_NAME, 'article')
# Link locators, which can be used for checking visibility, accuracy and validity of links
- getting_started_links_list = [
+ teams_links_list = [
{
- 'locator': (By.CSS_SELECTOR, 'ul.blogroll > li:nth-of-type(1) > a'),
- 'url_suffix': '/docs/misc/what-is-qa/',
+ 'locator': (By.CSS_SELECTOR, '#page-37 > a'),
+ 'url_suffix': '/teams/automation/',
}, {
- 'locator': (By.CSS_SELECTOR, 'ul.blogroll > li:nth-of-type(2) > a'),
- 'url_suffix': '/docs/misc/how-can-i-help-test/',
+ 'locator': (By.CSS_SELECTOR, '#page-39 > a'),
+ 'url_suffix': '/teams/desktop-firefox/',
}, {
- 'locator': (By.CSS_SELECTOR, 'ul.blogroll > li:nth-of-type(3) > a'),
- 'url_suffix': 'http://widget.mibbit.com/?settings=1b10107157e79b08f2bf99a11f521973&server=irc.mozilla.org&channel=%23qa',
+ 'locator': (By.CSS_SELECTOR, '#page-40 > a'),
+ 'url_suffix': '/teams/web-qa/',
}, {
- 'locator': (By.CSS_SELECTOR, 'ul.blogroll > li:nth-of-type(4) > a'),
- 'url_suffix': 'http://groups.google.com/group/mozilla.dev.quality/',
+ 'locator': (By.CSS_SELECTOR, '#page-38528 > a'),
+ 'url_suffix': '/teams/thunderbird/',
}, {
- 'locator': (By.CSS_SELECTOR, 'ul.blogroll > li:nth-of-type(5) > a'),
- 'url_suffix': '/docs/misc/faq/',
- }
+ 'locator': (By.CSS_SELECTOR, '#page-45493 > a'),
+ 'url_suffix': '/teams/services/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#page-45496 > a'),
+ 'url_suffix': '/teams/mobile/',
+ },
]
def go_to_page(self):
View
12 tests/test_home_page.py
@@ -43,32 +43,32 @@ def test_that_news_items_are_sorted_in_reverse_chronological_order(self, mozwebq
# The following 3 tests check for visibilty, accuracy and validity of the team links on the home page
@pytest.mark.nondestructive
- def test_that_getting_started_links_are_visible(self, mozwebqa):
+ def test_that_team_list_links_are_visible(self, mozwebqa):
home_page = HomePage(mozwebqa)
home_page.go_to_page()
bad_links = []
- for link in home_page.getting_started_links_list:
+ for link in home_page.teams_links_list:
if not home_page.is_element_visible(*link.get('locator')):
bad_links.append('The link at %s is not visible' % link.get('locator')[1:])
Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
@pytest.mark.nondestructive
- def test_that_getting_started_link_destinations_are_correct(self, mozwebqa):
+ def test_that_team_list_link_destinations_are_correct(self, mozwebqa):
home_page = HomePage(mozwebqa)
home_page.go_to_page()
bad_links = []
- for link in home_page.getting_started_links_list:
+ for link in home_page.teams_links_list:
url = home_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.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
@pytest.mark.nondestructive
- def test_that_getting_started_link_urls_are_valid(self, mozwebqa):
+ def test_that_team_list_link_urls_are_valid(self, mozwebqa):
home_page = HomePage(mozwebqa)
home_page.go_to_page()
bad_links = []
- for link in home_page.getting_started_links_list:
+ for link in home_page.teams_links_list:
url = home_page.link_destination(link.get('locator'))
response_code = self.get_response_code(url, mozwebqa.timeout)
if response_code != requests.codes.ok:

0 comments on commit a5413a5

Please sign in to comment.
Something went wrong with that request. Please try again.