Skip to content

Commit e6794b3

Browse files
authored
test: chore update playwright tests readme (#1184)
* test: chore cloud execution section and usage examples section * test: chore add example screenshots for cloud execution * test: chore slack notification example added * test: chore cope of automation testing * test: each image newline * fix: md lint issue for heading * test: chore removed additional reporting images
1 parent 1b376f5 commit e6794b3

File tree

5 files changed

+47
-100
lines changed

5 files changed

+47
-100
lines changed
-69.2 KB
Binary file not shown.
-64.7 KB
Binary file not shown.
-61 KB
Binary file not shown.
-70.9 KB
Binary file not shown.

tests/playwright-tests/README.md

Lines changed: 47 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
### Local Execution
1111

12-
1312
```bash
1413

1514
# Navigate to test framework
@@ -25,31 +24,58 @@ npx playwright test src/tests/e2e/e2e-with-db.spec.ts
2524

2625
### Cloud Execution
2726

28-
>Note: will be updated soon
29-
30-
## Test Flow Overview
31-
32-
1. **File Upload**: Upload test file to storage
33-
2. **Processing**: Local functions process the uploaded file
34-
3. **Validation**: Verify results in cohort using **dynamic** database queries
27+
Cloud-based test execution is supported in 2 main scenarios:
3528

36-
### Test Case Scripting Example
29+
#### Without Application Code Changes
3730

38-
![smoke test example](../../docs/assets/test-playwright-smoke-example.png)
31+
*(Ad-hoc / Scheduled)*
32+
Focus: Identify outliers (e.g., manual deployments in non-production environments) and ensure test stability, reliability, and transparency.
3933

40-
### Test Report Example
34+
- Pipeline: `post-deployment-tests-dev.yaml`
4135

42-
- report overview
36+
#### With Application Code Changes
4337

44-
![default report](../../docs/assets/test-playwright-report-example.png)
38+
*(CI/CD)*
39+
Focus: Enable early detection of changes that cause failures, reducing feedback cycles and improving efficiency.
4540

46-
- automatic retries
41+
- Pipelines:
42+
- `acr-image-promote-to-sandbox.yaml`
43+
- `acr-image-promote-to-dev.yaml`
44+
- `acr-image-promote-dev-to-nft.yaml`
45+
- `acr-image-promote-nft-to-integration.yaml`
4746

48-
![automatic retries](../../docs/assets/test-playwright-automatic-retry-example.png)
47+
## Test Flow Overview
4948

50-
### Test Logs Example
49+
1. **File Upload**: Upload test file to storage
50+
2. **Processing**: Local functions process the uploaded file
51+
3. **Validation**: Verify results in cohort using **dynamic** database queries
5152

52-
![test logs example](../../docs/assets/test-playwright-logs-example.png)
53+
## Scope of Automation Tests
54+
55+
```mermaid
56+
sequenceDiagram
57+
participant M as Mesh
58+
participant S as Storage
59+
participant D as Database
60+
participant BSI as BS Select Internal
61+
participant BSE as BS Select External
62+
63+
rect rgb(255, 248, 220)
64+
Note over S, D: @smoke @e2e<br/>Scope: Storage → Database
65+
S->>D: Smoke Test Coverage
66+
end
67+
68+
rect rgb(240, 248, 255)
69+
Note over S, D: @regression @e2e<br/>Scope: Storage → Database
70+
S->>D: E2E Regression Coverage
71+
end
72+
73+
rect rgb(245, 255, 245)
74+
Note over S, BSI: @regression @api<br/>Scope: Storage → BS Select Internal
75+
S->>D: API Data Flow
76+
D->>BSI: API Regression Coverage
77+
end
78+
```
5379

5480
## Contributing to improve Test Coverage & Framework
5581

@@ -82,87 +108,8 @@ async function validateSqlDatabaseFromAPI(request: APIRequestContext, validation
82108

83109
```
84110

85-
The validation engine accepts a JSON configuration to validate from API response; below are some examples of currently supported formats, more complex scenarios will be added in future
86-
87-
- Example Usage 1
88-
89-
```json
90-
91-
{
92-
"validations": [
93-
{
94-
"validations": {
95-
"apiEndpoint": "api/CohortDistributionDataService",
96-
"NHSNumber": 1111110662,
97-
"PrimaryCareProvider": "E85121",
98-
"NamePrefix": "MR",
99-
"GivenName": "NewTest 1",
100-
"OtherGivenName": "Test",
101-
"FamilyName": "Adani 1",
102-
"PreviousFamilyName": "Tester 1",
103-
"AddressLine5": "United Kingdom",
104-
"PostCode": "AB43 8FJ",
105-
"CurrentPosting": "CH",
106-
"EmailAddressHome": "[email protected]",
107-
"PreferredLanguage": "en",
108-
"InterpreterRequired": 0
109-
}
110-
},
111-
{
112-
"validations": {
113-
"apiEndpoint": "api/CohortDistributionDataService",
114-
"NHSNumber": 2222211794
115-
}
116-
},
117-
{
118-
"validations": {
119-
"apiEndpoint": "api/CohortDistributionDataService",
120-
"NHSNumber": 2222211794,
121-
"PrimaryCareProvider": "E85121"
122-
}
123-
}
124-
]
125-
}
126-
111+
The validation engine accepts a JSON configuration to validate API responses. Below are examples of currently supported formats; more complex scenarios will be added in the future:
127112

128-
```
129-
130-
- Example Usage 2
131-
132-
```json
133-
134-
{
135-
"validations": [
136-
{
137-
"validations": {
138-
"apiEndpoint": "api/ExceptionManagementDataService",
139-
"NhsNumber": "2612314172",
140-
"RuleId": 36,
141-
"RuleDescription": "Invalid primary care provider GP practice code"
142-
}
143-
}
144-
]
145-
}
146-
147-
148-
149-
```
150-
151-
- Example Usage 3
152-
153-
```json
154-
155-
{
156-
"validations": [
157-
{
158-
"validations": {
159-
"apiEndpoint": "api/ParticipantManagementDataService",
160-
"NHSNumber": 2612314172,
161-
"ExceptionFlag":1
162-
}
163-
}
164-
]
165-
}
166-
167-
168-
```
113+
- Example Usage 1 – [with meta information for automatic test script generation using runner workflow](../playwright-tests/src/tests/e2e/testFiles/@DTOSS-3217-01/ADD_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json)
114+
- Example Usage 2 – [multiply input participant records based on unique NHS numbers](../playwright-tests/src/tests/api/testFiles/@DTOSS-5928-01/ADD-10-records-expected.json)
115+
- Example Usage 3 – [multiple participant ADD and AMENDED](../playwright-tests/src/tests/e2e/testFiles/@DTOSS-4365-01/)

0 commit comments

Comments
 (0)