This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
/
test_teams.py
52 lines (41 loc) · 1.73 KB
/
test_teams.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from unittestzero import Assert
from pages.teams import TeamsPage
TEAM_NAMES = [
u'Desktop Firefox',
u'Web QA',
u'Cloud Services QA',
u'Mobile QA',
u'Firefox OS QA']
class TestTeamsPage:
@pytest.mark.nondestructive
def test_teams_page_consistency(self, mozwebqa):
teams_page = TeamsPage(mozwebqa)
teams_page.go_to_teams_page()
listed_teams = teams_page.teams
# check that all teams are listed
Assert.equal(
sorted(TEAM_NAMES),
sorted([team.name for team in listed_teams]),
u'Not all expected teams are present.')
# check for avatar, description and meta info
for team in listed_teams:
Assert.true(team.is_avatar_displayed, u'Team avatar is not displayed.')
#Assert.greater(len(team.description), 0, u'Team description is blank')
#Assert.greater(len(team.meta_info), 0, u'Team meta info is blank')
@pytest.mark.parametrize(
('team_name'), TEAM_NAMES)
@pytest.mark.nondestructive
def test_that_current_team_links_match_up_and_work(self, mozwebqa, team_name):
teams_page = TeamsPage(mozwebqa)
teams_page.go_to_teams_page()
about_team_page = teams_page.open_team_page(team_name)
Assert.true(about_team_page.is_the_current_page)
Assert.contains(
about_team_page.team_name, team_name,
u'''Wrong team name.
Expected: %s, but got: %s''' % (about_team_page.team_name, team_name))