Skip to content

Commit 7195f86

Browse files
test: Fixed validateServiceNowRequestWithMockServer in playwright tests by adding a wait (#1602)
1 parent b8a408e commit 7195f86

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

tests/playwright-tests/src/tests/runner/runner-workflow-manual-add.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ test.beforeAll(async () => {
2525
apiContext = await playwrightRequest.newContext();
2626
console.log(`Running ${TEST_TYPE} tests with scenario tags: ${scopedTestScenario}`);
2727
await cleanupDatabaseFromAPI(apiContext, addData.nhsNumbers);
28+
await cleanupWireMock(apiContext);
2829

2930
const dateMap = generateDynamicDateMap();
3031
const updatedParticipantRecords = replaceDynamicDatesInJson(addData.inputParticipantRecords, dateMap);
@@ -36,7 +37,6 @@ test.beforeAll(async () => {
3637
});
3738

3839
test.afterAll(async () => {
39-
await cleanupWireMock(apiContext);
4040
await apiContext.dispose();
4141
});
4242

tests/playwright-tests/src/tests/steps/steps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export async function validateSqlDatabaseFromAPI(request: APIRequestContext, val
5353
export async function validateServiceNowRequestWithMockServer(request: APIRequestContext, validations: ServiceNowRequestValidations[]) {
5454
const wireMockUrl = getWireMockUrl();
5555

56+
// Wait for 5 seconds
57+
await new Promise((resolve) => setTimeout(resolve, 5000));
58+
5659
var response = await request.get(wireMockUrl);
5760
var body = await response.json() as WireMockResponse;
5861

0 commit comments

Comments
 (0)