Skip to content

Commit

Permalink
chore: update experience test since it will fail randomly when runnin…
Browse files Browse the repository at this point in the history
…g ci (#4649)
  • Loading branch information
xiaoyijun authored Oct 13, 2023
1 parent e364933 commit dde18a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { appendPath } from '@silverhand/essentials';

import { logtoUrl, mockSocialAuthPageUrl } from '#src/constants.js';
import { readVerificationCode } from '#src/helpers/index.js';
import { dcls } from '#src/utils.js';
import { dcls, waitFor } from '#src/utils.js';

import ExpectPage from './expect-page.js';

Expand Down Expand Up @@ -95,6 +95,8 @@ export default class ExpectExperience extends ExpectPage {
* It will clear the ongoing experience if the experience is ended successfully.
*/
async verifyThenEnd() {
// Wait for 500ms since some times the sign-in success callback haven't been handled yet
await waitFor(500);
if (this.#ongoing === undefined) {
return this.throwNoOngoingExperienceError();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default class ExpectTotpExperience extends ExpectExperience {
await this.toFillInput(`totpCode_${index}`, char);
}

// Wait for the form to commit automatically
await waitFor(500);
if (signingInAfterBinding) {
await this.page.waitForSelector('img[alt="Congrats"]');
}
Expand Down Expand Up @@ -68,6 +70,8 @@ export default class ExpectTotpExperience extends ExpectExperience {
await this.toFillInput(`totpCode_${index}`, char);
}

// Wait for the form to commit automatically
await waitFor(500);
if (signingInAfterVerification) {
await this.page.waitForSelector('img[alt="Congrats"]');
}
Expand Down

0 comments on commit dde18a4

Please sign in to comment.