File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed
Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ Feature: Role selection page renders roles properly when logged in
3838 Then I can see the roles with access cards
3939
4040 @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4651
41- Scenario : User can navigate to the your_selected_role page
41+ Scenario : User can navigate to the your selected role page
4242 Given I am logged in
4343 Then I am on the select your role page
4444 Then I can navigate to the your selected role page by clicking a card
Original file line number Diff line number Diff line change 11# pylint: disable=no-name-in-module
22from behave import given , then # pyright: ignore [reportAttributeAccessIssue]
33
4- from features .environment import MOCK_CIS2_LOGIN_ID_MULTIPLE_ACCESS_ROLES
4+ from features .environment import (
5+ MOCK_CIS2_LOGIN_ID_MULTIPLE_ACCESS_ROLES ,
6+ MOCK_CIS2_LOGIN_ID_NO_ACCESS_ROLE ,
7+ )
58
69
710@then ("I am logged out" )
@@ -44,6 +47,15 @@ def login(context):
4447 context .page .wait_for_url ("**/selectyourrole.html" )
4548
4649
50+ @given ("I am logged in without access" )
51+ def login_without_access (context ):
52+ context .page .goto (context .cpts_ui_base_url + "site/auth_demo.html" )
53+ context .page .get_by_role ("button" , name = "Log in with mock CIS2" ).click ()
54+ context .page .get_by_label ("Username" ).fill (MOCK_CIS2_LOGIN_ID_NO_ACCESS_ROLE )
55+ context .page .get_by_role ("button" , name = "Sign In" ).click ()
56+ context .page .wait_for_url ("**/selectyourrole.html" )
57+
58+
4759@then ("I am on the login page" )
4860def i_am_on_login_page (context ):
4961 # TODO: This needs to cover the .html for the broken SPA. Will need to be removed.
Original file line number Diff line number Diff line change 33from playwright .sync_api import expect
44
55from pages .select_your_role import SelectYourRole
6- from features .environment import MOCK_CIS2_LOGIN_ID_NO_ACCESS_ROLE
76
87
98@when ("I go to the select your role page" )
@@ -19,15 +18,6 @@ def i_am_on_select_your_role_page(context):
1918 expect (select_your_role_page .summary ).to_be_visible ()
2019
2120
22- @given ("I am logged in without access" )
23- def login_without_access (context ):
24- context .page .goto (context .cpts_ui_base_url + "site/auth_demo.html" )
25- context .page .get_by_role ("button" , name = "Log in with mock CIS2" ).click ()
26- context .page .get_by_label ("Username" ).fill (MOCK_CIS2_LOGIN_ID_NO_ACCESS_ROLE )
27- context .page .get_by_role ("button" , name = "Sign In" ).click ()
28- context .page .wait_for_url ("**/selectyourrole.html" )
29-
30-
3121@then ("I am on the select your role page" )
3222def verify_on_select_your_role_page (context ):
3323 select_your_role_page = SelectYourRole (context .page )
You can’t perform that action at this time.
0 commit comments