Skip to content

Commit 4a10971

Browse files
superuser dashboard test
1 parent 630bab4 commit 4a10971

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

pages/pg_dashboard.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def go_to_dashboard(self):
4848
wait(timeout=wait_time.MIN) # Scripts sometimes error out without this wait when called as a teardown action
4949
self.po.perform_action(locator=self.LNK_NHS_LOGO, action=actions.CLICK_LINK)
5050

51-
def verify_all_expected_links(self):
51+
def verify_all_expected_links_for_nurse(self):
5252
self.po.verify(locator=self.LNK_PROGRAMMES, property=object_properties.VISIBILITY, value=True, exact=True)
5353
self.po.verify(locator=self.LNK_SESSIONS, property=object_properties.VISIBILITY, value=True, exact=True)
5454
self.po.verify(locator=self.LNK_CHILDREN, property=object_properties.VISIBILITY, value=True, exact=True)
@@ -68,3 +68,26 @@ def verify_all_expected_links(self):
6868
value="https://guide.manage-vaccinations-in-schools.nhs.uk/",
6969
exact=True,
7070
)
71+
72+
def verify_all_expected_links_for_superuser(self):
73+
self.po.verify(locator=self.LNK_PROGRAMMES, property=object_properties.VISIBILITY, value=True, exact=True)
74+
self.po.verify(locator=self.LNK_SESSIONS, property=object_properties.VISIBILITY, value=True, exact=True)
75+
self.po.verify(locator=self.LNK_CHILDREN, property=object_properties.VISIBILITY, value=True, exact=True)
76+
self.po.verify(locator=self.LNK_VACCINES, property=object_properties.VISIBILITY, value=True, exact=True)
77+
self.po.verify(
78+
locator=self.LNK_UNMATCHED_CONSENT_RESPONSES, property=object_properties.VISIBILITY, value=True, exact=True
79+
)
80+
self.po.verify(locator=self.LNK_SCHOOL_MOVES, property=object_properties.VISIBILITY, value=True, exact=True)
81+
self.po.verify(
82+
locator=self.LNK_NOTICES, property=object_properties.VISIBILITY, value=True, exact=True
83+
) # Superuser only
84+
self.po.verify(locator=self.LNK_ORGANISATION, property=object_properties.VISIBILITY, value=True, exact=True)
85+
self.po.verify(
86+
locator=self.LNK_SERVICE_GUIDANCE, property=object_properties.VISIBILITY, value=True, exact=True
87+
)
88+
self.po.verify(
89+
locator=self.LNK_SERVICE_GUIDANCE,
90+
property=object_properties.HREF,
91+
value="https://guide.manage-vaccinations-in-schools.nhs.uk/",
92+
exact=True,
93+
)

tests/test_01_login.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ def test_invalid_login(self, user, pwd, expected_message):
2727
@pytest.mark.login
2828
@pytest.mark.mobile
2929
@pytest.mark.order(102)
30-
def test_home_page_links(self):
30+
def test_home_page_links_for_nurse(self):
3131
self.login_page.go_to_login_page()
3232
self.login_page.login_as_nurse()
33-
self.dashboard_page.verify_all_expected_links()
33+
self.dashboard_page.verify_all_expected_links_for_nurse()
34+
self.login_page.perform_logout()
35+
36+
@pytest.mark.login
37+
@pytest.mark.mobile
38+
@pytest.mark.order(103)
39+
def test_home_page_links_for_superuser(self):
40+
self.login_page.go_to_login_page()
41+
self.login_page.login_as_superuser()
42+
self.dashboard_page.verify_all_expected_links_for_superuser()
3443
self.login_page.perform_logout()

0 commit comments

Comments
 (0)