Refactor e2e tests for improved efficiency

The commit has made key changes to enhance the efficiency of end-to-end tests. The password generation logic and random email creation method have been modified to use bigger random numbers, ensuring
This commit is contained in:
giancarlo
2024-04-11 21:54:03 +08:00
parent 93964e174a
commit fb86e6e6b2
3 changed files with 8 additions and 16 deletions

View File

@@ -48,8 +48,6 @@ export class AuthPageObject {
}
async visitConfirmEmailLink(email: string) {
await this.page.waitForTimeout(300);
return expect(async() => {
const res = await this.mailbox.visitMailbox(email);
@@ -58,7 +56,7 @@ export class AuthPageObject {
}
createRandomEmail() {
const value = Math.random() * 1000;
const value = Math.random() * 10000000000;
return `${value.toFixed(0)}@makerkit.dev`;
}
@@ -76,6 +74,10 @@ export class AuthPageObject {
repeatPassword: 'password',
});
await this.page.waitForResponse((resp) => {
return resp.url().includes('auth');
});
await this.visitConfirmEmailLink(email);
}
}