Skip to content

Commit c1f1f14

Browse files
TASK Clean up playwright report
1 parent 6185292 commit c1f1f14

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

e2e/auth.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,17 @@ export const login = async (browser: Browser, nhsLoginUsername: string): Promise
5050
}
5151

5252
await page.waitForURL("**/enter-email", { timeout: 30000 });
53-
await page.getByLabel("Email address").fill(user.nhsLoginUsername);
53+
await page.getByLabel("Email address").evaluate((input: HTMLInputElement, fillText) => {
54+
input.value = fillText;
55+
input.dispatchEvent(new Event("input"));
56+
}, user.nhsLoginUsername);
5457
await page.getByRole("button", { name: "Continue" }).click();
5558

5659
await page.waitForURL("**/log-in-password", { timeout: 30000 });
57-
await page.getByRole("textbox", { name: "Password" }).fill(user.nhsLoginPassword);
60+
await page.getByRole("textbox", { name: "Password" }).evaluate((input: HTMLInputElement, fillText) => {
61+
input.value = fillText;
62+
input.dispatchEvent(new Event("input"));
63+
}, user.nhsLoginPassword);
5864
await page.getByRole("button", { name: "Continue" }).click();
5965

6066
await page.waitForURL(/\/(enter-mobile-code|choose-authentication-method)$/, { timeout: 30000 });
@@ -64,7 +70,10 @@ export const login = async (browser: Browser, nhsLoginUsername: string): Promise
6470
}
6571

6672
await page.waitForURL("**/enter-mobile-code", { timeout: 30000 });
67-
await page.getByRole("textbox", { name: "Security code" }).fill(user.nhsLoginOTP);
73+
await page.getByRole("textbox", { name: "Security code" }).evaluate((input: HTMLInputElement, fillText) => {
74+
input.value = fillText;
75+
input.dispatchEvent(new Event("input"));
76+
}, user.nhsLoginOTP);
6877
await page.getByRole("button", { name: "Continue" }).click();
6978

7079
if (useFakeAuth) {

0 commit comments

Comments
 (0)