Skip to content

Commit

Permalink
Chore: [AEA-4518] - Setup-Search-Tab-and-Content-Panel (#226)
Browse files Browse the repository at this point in the history
## Summary

- Routine Change

### Details

This includes tests for the Search for a Prescription page
It also includes a fix to ensure browsers are closed after a test case
is completed
general refactoring of steps and BDD features

---------

Co-authored-by: Jim Wild <[email protected]>
  • Loading branch information
seansteberisal and wildjames authored Feb 7, 2025
1 parent d553e31 commit 5919606
Show file tree
Hide file tree
Showing 25 changed files with 397 additions and 400 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
max-line-length=120
exclude = .*,venv,node_modules
max-complexity = 10
ignore = F811,W503
106 changes: 106 additions & 0 deletions features/cpts_ui/change_role.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@cpts_ui @change_role @regression @blocker @smoke @ui
Feature: Users are able to change their roles, if they have multiple roles with access.


############################################################################
# Successfully changing role scenarios
############################################################################
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4653
@multiple_access
Scenario: User can change their role
Given I am logged in as a user with multiple access roles
And I am on the change your role page
When I click a change role role card
Then I am on the 'your selected role' page

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4653
@multiple_access
Scenario: User can see roles with access cards
Given I am logged in as a user with multiple access roles
And I am on the change your role page
Then I see the change role roles with access cards
And I can see multiple change role roles with access cards

############################################################################
# Expanding/collapsing the summary
############################################################################

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4653
@multiple_access
Scenario: Change role roles without access table body is not visible by default
Given I am logged in as a user with multiple access roles
And I am on the change your role page
Then the change role roles without access table body is not visible

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4653
@multiple_access
Scenario: User can expand the change role 'Roles without access' to see table contents
Given I am logged in as a user with multiple access roles
And I am on the change your role page
When I click on the change role summary expander
Then I see the change role roles without access table

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4653
@multiple_access
Scenario: User can collapse the change role 'Roles without access' to hide table contents
Given I am logged in as a user with multiple access roles
And I am on the change your role page
And the summary table body is displayed
When I click on the change role summary expander
Then The change role roles without access table body is not visible

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4653
@single_access
Scenario: User is automatically redirected to the 'search for a prescription' page and sees the expected links
When I log in as a user with a single access role
Then I am on the search for a prescription page
And I do not see the "Change Role" link
And I do not see the change role page header link

Scenario: user can change their role, and see a confirmation page
Given I am logged in as a user with multiple access roles
And I am on the change your role page
When I click a change role role card
Then I see the 'your selected role' page
And I can see the RBAC banner

############################################################################
# Successfully changing role scenarios
############################################################################

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4974
Scenario: User can change their role and see the correct message on the change role page
Given I am logged in as a user with multiple access roles
And I have confirmed a role
And I am on the change your role page
And I click a change role role card
When I click the change link next to the role text
Then I am on the change role page
And I can see the role that has been pre selected

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4974
Scenario: User can see roles with access cards
Given I am logged in with a single access role and multiple without access
Then I see the change role roles with access cards
And I can see one change role roles with access card

############################################################################
# Expanding/collapsing the summary
############################################################################
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4974
Scenario: Change role roles without access table body is not visible by default
When I log in as a user with multiple access roles
Then the change role roles without access table body is not visible

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4974
Scenario: User can expand the change role 'Roles without access' to see table contents
Given I am logged in as a user with multiple access roles
When I click on the change role summary expander
Then I see the change role roles without access table

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4974
Scenario: User can collapse the change role 'Roles without access' to hide table contents
Given I am logged in as a user with multiple access roles
And the summary table body is displayed
When I click on the change role summary expander
Then The change role roles without access table body is not visible
34 changes: 0 additions & 34 deletions features/cpts_ui/change_role_multiple_with_access.feature

This file was deleted.

21 changes: 0 additions & 21 deletions features/cpts_ui/change_role_no_access.feature

This file was deleted.

13 changes: 0 additions & 13 deletions features/cpts_ui/change_role_one_with_access.feature

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,70 +1,79 @@
@cpts_ui @header_links @regression @blocker @smoke @ui
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-XXXX
Feature: Header links are displayed according to the user's state and the current page
Feature: Header

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4513
# FIXME: Address this when the SPA is fixed!
# The menu is broken and needs to be fixed. This test will not pass until it's fixed
# @fixme
# bug ticket: AEA-4996
Scenario: user sees a menu with links when the screen size is small
Given I am logged in as a user with multiple access roles
When I have a screen size of 650 pixels wide
# Then I can see the header links in a dropdown menu

############################################################################
# EXIT
############################################################################
Scenario: Exit link is shown on the logout page once the user signs out
Given I am logged in
Given I am logged in as a user with multiple access roles
And The logout confirmation modal is displayed
When I confirm the logout
Then I see the "Exit" link

Scenario: Exit link is shown on the select your role page if the user has no roles with access
Given I am logged in without access
Given I am logged in as a user with only roles that do not have access
Then I see the "Exit" link

Scenario: Exit link is not shown if user has at least one role with access on the select your role page
Given I am logged in with a single access role
Given I am logged in as a user with a single access role
Then I do not see the "Exit" link

############################################################################
# LOGOUT
############################################################################
Scenario: Logout link is shown for a logged in user
Given I am logged in
Given I am logged in as a user with multiple access roles
Then I see the "Logout" link

Scenario: Logout link is not shown if user is not logged in
When I am on the homepage
When I go to the homepage
Then I do not see the "Logout" link

############################################################################
# SELECT YOUR ROLE
############################################################################
Scenario: Select Your Role link is shown on the homepage, if we dont select a role
Given I am logged in
When I am on the homepage
Given I am logged in as a user with multiple access roles
When I go to the homepage
Then I see the "Select Your Role" link

Scenario: Select Your Role link is not shown if I go to the select your role page
Given I am logged in
When I go to the select your role page
Given I am logged in as a user with multiple access roles
When I go to the homepage
And I click the "Select Your Role" link
Then I do not see the "Select Your Role" link

Scenario: Select Your Role link is not shown if I already have a selected role
Given I am logged in
When I have a selected role
And I am on the homepage
Given I am logged in as a user with a pre selected role
When I go to the homepage
Then I do not see the "Select Your Role" link

############################################################################
# CHANGE ROLE
############################################################################
Scenario: Change Role link is shown if the user has a selected role
Given I am logged in
When I have a selected role
When I am on the homepage
Given I am logged in as a user with multiple access roles
When I go to the homepage
Then I see the "Change Role" link

Scenario: Change Role link is not shown if the user has no selected role
Given I am logged in
When I am on the homepage
Given I am logged in as a user with multiple access roles
When I go to the homepage
Then I do not see the "Change Role" link

# FIXME: Address this when the SPA is fixed!
# Since the SPA is broken, there's actually no reliable way to navigate to the SYR page
# Since the SPA is broken, there's actually no reliable way to navigate to the SYR page
# once you've selected a role!
# @fixme
# Scenario: Change Role link is not shown if I go to the select your role page
Expand All @@ -74,6 +83,6 @@ Feature: Header links are displayed according to the user's state and the curren
# Then I do not see the "Change Role" link

Scenario: Change Role link is not shown if I am on the change role page
Given I am logged in
Given I am logged in as a user with multiple access roles
When I go to change my role
Then I do not see the "Change Role" link
28 changes: 5 additions & 23 deletions features/cpts_ui/home.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,11 @@
Feature: I can visit the Clinical Prescription Tracker Service Website

@rbac_banner
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4515
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4513
Scenario: user can navigate to the Clinical Prescription Tracker Service Website homepage
When I am on the homepage
When I go to the homepage
Then I am on the homepage
And I can see the header
And I can see the footer
And I can not see the RBAC banner

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4515
Scenario: user can see the footer
Given I am on the homepage
Then I can see the footer

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4513
Scenario: user can see the header
Given I am on the homepage
Then I can see the header

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4513
Scenario: user sees a menu with links when the screen size is small
Given I am on the homepage
When I have a screen size of 690 pixels wide
# Then I can see the header links in a dropdown menu

@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4518
Scenario: user can visit the search for a prescription page
Given I am on the homepage
# When I click on Find a prescription
# Then I am on the search for a prescription page
5 changes: 2 additions & 3 deletions features/cpts_ui/logout.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Feature: The user is able to logout of the application

Background:
Given I am logged in
When I go to the select your role page
Given I am logged in as a user with multiple access roles

############################################################################
# Logging out
Expand All @@ -28,7 +27,7 @@ Feature: The user is able to logout of the application
And I can not see the RBAC banner

############################################################################
# Closing the logout modal
# Closing the logout modal
############################################################################
Scenario: Close the modal with the cross icon
Given the logout confirmation modal is displayed
Expand Down
Loading

0 comments on commit 5919606

Please sign in to comment.