mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore: update experience test since it will fail randomly when running ci (#4649)
This commit is contained in:
parent
e36493367e
commit
dde18a4cac
2 changed files with 7 additions and 1 deletions
|
@ -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';
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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"]');
|
||||
}
|
||||
|
@ -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"]');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue