Skip to content

Commit 9afa790

Browse files
committed
CCM-7498: fix waiting for selector
1 parent 009520e commit 9afa790

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/test-team/pages/templates-mgmt-login-page.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ export class TemplateMgmtSignInPage extends TemplateMgmtBasePage {
3232

3333
await this.clickSubmitButton();
3434

35-
await this.confirmPasswordInput.waitFor({
36-
state: 'visible',
37-
timeout: 1000,
38-
});
35+
let shouldResetPassword = true;
36+
37+
try {
38+
await this.confirmPasswordInput.waitFor({
39+
state: 'visible',
40+
timeout: 5000,
41+
});
42+
} catch {
43+
shouldResetPassword = false;
44+
}
3945

4046
// Note: because this is a new user, Cognito forces us to update the password.
41-
if (await this.confirmPasswordInput.isVisible()) {
47+
if (shouldResetPassword) {
4248
const password = CognitoAuthHelper.generatePassword();
4349

4450
await this.passwordInput.fill(password);

0 commit comments

Comments
 (0)