Skip to content

Commit f659ae9

Browse files
committed
Merge remote-tracking branch 'origin/main' into claims_test
2 parents f6fa665 + d2ded66 commit f659ae9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1389
-637
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"github.vscode-github-actions",
4545
"ms-python.pylint",
4646
"ms-python.black-formatter",
47-
"jimasp.behave-vsc"
47+
"jimasp.behave-vsc",
48+
"Gruntfuggly.todo-tree"
4849
],
4950
"settings": {
5051
"python.defaultInterpreterPath": "/workspaces/electronic-prescription-service-api-regression-tests/venv/bin/python",

.gitallowed

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ CidrBlock:\s?"?10\.0\.\d+\.\d+\/\d+"
1313
.*token_response\[\"access_token\"\].*
1414
.*password=None.*
1515
.*secrets.REGRESSION_TESTS_PAT.*
16+
*.env
17+
arguments.password
18+
body = f"username={username}&password={password}&grant_type=password"
19+
--secret="\$APIGEE_MFA_SECRET"
20+
password = arguments\.password
21+
poetry run python scripts/add_pr_product_to_app.py --user="$APIGEE_USER" --*** --secret="$APIGEE_MFA_SECRET" --pr="$PR_ID"
22+
--user="$APIGEE_USER" --*** --secret="$APIGEE_MFA_SECRET"

.github/workflows/regression_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
# using git commit sha for version of action to ensure we have stable version
8080
- name: Install asdf
81-
uses: asdf-vm/actions/setup@1117842ea70e2711a0072e3a71265cbfe2c830be
81+
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
8282
with:
8383
asdf_version: 0.16.4
8484

@@ -90,7 +90,7 @@ jobs:
9090
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
9191

9292
- name: Install asdf dependencies in .tool-versions
93-
uses: asdf-vm/actions/install@1117842ea70e2711a0072e3a71265cbfe2c830be
93+
uses: asdf-vm/actions/install@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
9494
with:
9595
asdf_version: 0.16.4
9696
env:

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
# using git commit sha for version of action to ensure we have stable version
3939
- name: Install asdf
40-
uses: asdf-vm/actions/setup@1117842ea70e2711a0072e3a71265cbfe2c830be
40+
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
4141
with:
4242
asdf_version: 0.16.4
4343

@@ -49,7 +49,7 @@ jobs:
4949
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
5050

5151
- name: Install asdf dependencies in .tool-versions
52-
uses: asdf-vm/actions/install@1117842ea70e2711a0072e3a71265cbfe2c830be
52+
uses: asdf-vm/actions/install@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
5353
with:
5454
asdf_version: 0.16.4
5555
env:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default_language_version:
22
python: python3.12
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v5.0.0
66
hooks:
77
- id: check-merge-conflict
88
name: Check for merge conflict strings

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python 3.12.9
2-
poetry 1.8.3
2+
poetry 2.1.1
33
shellcheck 0.10.0
44
nodejs 22.14.0
55
actionlint 1.7.7

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ update-node:
1818
update-poetry:
1919
poetry update
2020

21+
install-asdf:
22+
asdf plugin add python
23+
asdf plugin add poetry
24+
asdf plugin add shellcheck
25+
asdf plugin add nodejs
26+
asdf plugin add actionlint
27+
asdf install
28+
2129
install-python:
2230
poetry install
2331

@@ -52,6 +60,7 @@ check-licenses:
5260

5361
deep-clean-install:
5462
rm -f -d -r .venv/
63+
mkdir .venv/
5564
asdf uninstall poetry
5665
asdf uninstall python
5766
asdf plugin remove poetry

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ These tests will automate End-to-End regression testing for:
66
* [Prescriptions for Patients (PfP)](https://digital.nhs.uk/developer/api-catalogue/prescriptions-for-patients)
77
* [Prescription Status Update (PSU)](https://digital.nhs.uk/developer/api-catalogue/prescription-status-update-fhir/)
88
* [Clinical Prescription Tracker UI (CPT-UI)](https://github.com/NHSDigital/eps-prescription-tracker-ui)
9+
* [Clinical Prescription Tracker API (CPT-API)](https://github.com/NHSDigital/electronic-prescription-service-clinical-prescription-tracker)
910

1011
## General usage
1112
These tests are run automatically during deployment and shouldn't need to be touched unless performing debugging or
@@ -22,12 +23,27 @@ It is necessary to set some Environment variables in order to run any tests in y
2223
1. `.env` file
2324
2. OS environment variable
2425

25-
The following environment variables need to be set for the correct environment you wish to test against:
26-
* CLIENT_ID
27-
* CLIENT_SECRET
26+
The following environment variables may need to be set for the correct environment you wish to test against:
27+
* CPT_FHIR_CLIENT_ID
28+
* CPT_FHIR_CLIENT_SECRET
29+
* EPS_FHIR_CLIENT_ID
30+
* EPS_FHIR_CLIENT_SECRET
31+
* EPS_FHIR_SHA1_CLIENT_ID
32+
* EPS_FHIR_SHA1_CLIENT_SECRET
33+
* EPS_FHIR_PRESCRIBING_CLIENT_ID
34+
* EPS_FHIR_PRESCRIBING_CLIENT_SECRET
35+
* EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID
36+
* EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET
37+
* EPS_FHIR_DISPENSING_CLIENT_ID
38+
* EPS_FHIR_DISPENSING_CLIENT_SECRET
39+
* PFP_CLIENT_ID
40+
* PFP_CLIENT_SECRET
41+
* PSU_CLIENT_ID
42+
* PSU_CLIENT_SECRET
2843
* PRIVATE_KEY
2944
* CERTIFICATE
3045

46+
3147
To make this easier, a `template.env` file is located on the root. Fill in the values and rename this to `.env`
3248

3349
Any file that begins with `.env` is automatically ignored by Git
@@ -42,15 +58,8 @@ You may need to run `poetry shell` to activate the poetry shell, followed by `ma
4258
If you'd like to use your own machine without containerisation. You will need the following;
4359
* Ubuntu (WSL)
4460
* [ASDF](https://asdf-vm.com/guide/getting-started.html)
45-
#### Once ASDF is installed, add the following plugins:
46-
* ASDF python plugin `asdf plugin add python`
47-
* ASDF poetry plugin `asdf plugin add poetry`
48-
* ASDF shellcheck plugin `asdf plugin add shellcheck`
49-
* ASDF nodejs plugin `asdf plugin add nodejs`
50-
#### Once the plugins are added you can install them
51-
`asdf install` This will install the versions as described in .tool-versions
52-
53-
Now you can run `make install` to install the virtualenv and packages. You may need to run `poetry shell` to activate the poetry shell, followed by `make install-playwright` to install the playwright tools. To check if these are installed properly, run `playwright codegen` and check that you see a browser window pop up.
61+
You can now run the `make install-asdf` command
62+
* next, run `make install` to install the virtualenv and packages. You may need to run `poetry shell` to activate the poetry shell, followed by `make install-playwright` to install the playwright tools. To check if these are installed properly, run `playwright codegen` and check that you see a browser window pop up.
5463

5564
## Developing/Debugging Tests
5665

@@ -73,10 +82,11 @@ Make sure that your behave run configuration includes the `--product=` & `--env=
7382
Run the tests by calling the Make command `make run-tests`. This requires the parameters `product=` and `env=` to be passed in.
7483
Optionally, you can pass in tags to be run, for example `tags=cpt-ui` will run all CPT-UI-tagged tests.
7584
Further, if you want to actually see the tests being executed, you can pass a `HEADLESS=true` to the makefile.
85+
If you want to throttle the speed that the tests are done, you can insert a delay between each action by passing the `SLOWMO=<delay, ms>` environment variable. This lets a human keep track of what steps are being done.
7686

7787
For example:
7888
```
79-
product=cpts-ui env=internal-dev PULL_REQUEST_ID=pr-300 tags=cpt-ui HEADLESS=true make run-tests
89+
product=cpts-ui env=internal-dev PULL_REQUEST_ID=pr-300 tags=login HEADLESS=false SLOWMO=2000 make run-tests
8090
```
8191

8292
Note that CPT-UI supports localhost testing. To do this, use the `env=localhost` variable - but ensure you have *not* set the `PULL_REQUEST_ID` variable, as it is not needed and will break the tests. Make sure your localhost server is running!
@@ -100,7 +110,7 @@ Change the `env` variable accordingly to either `INT` or `INTERNAL-DEV`.
100110
If you wish to test a different product i.e. `PFP-APIGEE` then you must change `product=` and `--tags` respectively.
101111

102112
### Method 5:
103-
Run the tests by pushing changes to github in a pull request and running the regression tests job.
113+
Run the tests by pushing changes to GitHub in a pull request and running the regression tests job.
104114
You can do this by the browser or by running this
105115
```
106116
BRANCH=fix_tests_take_2

features/cpts_ui/change_role.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ Feature: Users are able to change their roles, if they have multiple roles with
8484
Then I am on the change role page
8585
And I can see the role that has been pre selected
8686

87+
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-5046
88+
Scenario: User refreshes the page and retains roles with access
89+
Given I am logged in as a user with multiple access roles
90+
And I have confirmed a role
91+
And I am on the change your role page
92+
When I click a change role role card
93+
And I click the change link next to the role text
94+
And I refresh the page
95+
Then I do not see the change role page header link
96+
8797
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4974
8898
Scenario: User can see roles with access cards
8999
Given I am logged in with a single access role and multiple without access
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@cpts_ui @patient_detail_banner @regression @blocker @smoke @ui
2+
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-5061
3+
Feature: The site has a patient detail banner
4+
5+
Background:
6+
Given I am logged in as a user with multiple access roles
7+
And I have confirmed a role
8+
9+
Scenario: Before I search for a prescription, the patient details banner is not visible
10+
When I go to the search for a prescription page
11+
Then I am on the search for a prescription page
12+
And the patient details banner is not visible
13+
14+
Scenario: When I search for a prescription, and go back, the patient details banner is not visible
15+
When I go to the search for a prescription page
16+
And I click on tab Prescription ID search
17+
# FIXME: This will need to be updated when the search pages are updated to use real data
18+
And I search for a prescription using a valid prescription ID "C0C757-A83008-A1234O"
19+
And I click the Go Back link on the prescription not found page
20+
Then The patient details banner is not visible
21+
22+
Scenario: When I search for a prescription, the patient details appear
23+
When I go to the search for a prescription page
24+
And I click on tab Prescription ID search
25+
# FIXME: This will need to be updated when the search pages are updated to use real data
26+
And I search for a prescription using a valid prescription ID "C0C757-A83008-C2D93O"
27+
Then The patient details banner reports complete data
28+
29+
# TODO: Can we set a prescription with incomplete patient data?
30+
Scenario: When I search for a prescription with incomplete data, the patient detail banner is formatted correctly
31+
When I go to the search for a prescription page
32+
And I click on tab Prescription ID search
33+
And I search for a prescription using a valid prescription ID "209E3D-A83008-327F9F"
34+
Then The patient details banner reports incomplete data

0 commit comments

Comments
 (0)