Skip to content

Commit 3b23f26

Browse files
As per PR 98 review comments, changes are implemented.
1 parent 90977d7 commit 3b23f26

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

pages/organisations/organisations_page.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,41 @@ class OrganisationSwitchPage(BasePage):
6464
def __init__(self, page: Page):
6565
self.page = page
6666

67-
def get_available_organisation_ids(self):
67+
def get_available_organisation_ids(self)-> list[str]:
6868
"""
6969
Returns a list of all available organisation radio button IDs.
7070
"""
7171
radios = self.page.locator(self.RADIO_SELECTOR)
7272
org_ids = []
73-
for i in range(radios.count()):
74-
org_id = radios.nth(i).get_attribute("id")
73+
for int in range(radios.count()):
74+
org_id = radios.nth(int).get_attribute("id")
7575
if org_id:
7676
org_ids.append(org_id)
7777
return org_ids
7878

79-
def select_organisation_by_id_and_navigate_home(self, org_id):
79+
def select_organisation_by_id_and_navigate_home(self, org_id)-> None:
8080
"""
81-
Selects the organisation radio button by its id, clicks Continue,
82-
and it navigates to the BCSS Home page after which then clicks the 'Select Org' link & it returns back to the change of organisation ids page.
81+
Selects the organisation radio button by its ID, clicks Continue,
82+
navigates to the BCSS Home page, then clicks the 'Select Org' link to return to the organisation selection page.
83+
Args:
84+
organisation_id (str): The id of the organisation to be selected.
8385
"""
8486
self.page.locator(f'#{org_id}').check()
8587
self.page.get_by_role('button', name='Continue').click()
8688
self.page.get_by_role('link', name=self.SELECT_ORG_LINK_TEXT).click()
8789

88-
def switch_between_organisations(self):
90+
def switch_between_organisations(self)-> None:
8991
"""
9092
Switches between all available organisations by their ids.
9193
"""
9294
org_ids = self.get_available_organisation_ids()
9395
for org_id in org_ids:
9496
self.select_organisation_by_id_and_navigate_home(org_id)
97+
98+
99+
100+
101+
102+
103+
104+

tests/regression/organisation_regression_tests_user/test_change_organisation_regression_user.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
from playwright.sync_api import Page, expect
44
from pages.organisations.organisations_page import OrganisationSwitchPage
55

6-
6+
@pytest.mark.wip
77
@pytest.mark.regression
88
@pytest.mark.organisation_switch
9-
def test_user_can_switch_between_organisations(page: Page):
9+
def test_user_can_switch_between_organisations(page: Page)-> None:
1010
"""
1111
Feature: Change Organisation
1212
13-
Scenario: Check an English user, that has multiple organisations is able to switch between them
13+
Scenario: Check that an English user with multiple organisations is able to switch between them
1414
Given I log in to BCSS "England" as user role "MultiOrgUser"
1515
When I change organisation
1616
Then I will be logged in as the alternative organisation.
@@ -26,3 +26,15 @@ def test_user_can_switch_between_organisations(page: Page):
2626

2727

2828

29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+

0 commit comments

Comments
 (0)