Skip to content

Commit

Permalink
fix oauth webchannel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrivastava-qa committed Jun 28, 2023
1 parent 1b01efd commit 3603292
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/functional-tests/pages/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@ export class LoginPage extends BaseLayout {
return this.page.locator(selectors.SUBMIT).click();
}

async isCWTSEngineHeader() {
return this.page.locator(selectors.CWTS_ENGINE_HEADER).isVisible();
async waitForCWTSEngineHeader() {
await this.page.waitForSelector(selectors.CWTS_ENGINE_HEADER, {
timeout: 2000,
});
}

async isCWTSPageHeader() {
Expand Down
2 changes: 1 addition & 1 deletion packages/functional-tests/tests/oauth/webchannel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.describe('oauth webchannel', () => {
await login.submit();

// the CWTS form is on the same signup page
expect(await login.isCWTSEngineHeader()).toBe(true);
await login.waitForCWTSEngineHeader();
expect(await login.isCWTSEngineBookmarks()).toBe(true);
expect(await login.isCWTSEngineHistory()).toBe(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test.describe('Sync v3 sign up and CWTS', () => {
await login.setAge('21');

// The CWTS form is on the same signup page
expect(await login.isCWTSEngineHeader()).toBe(true);
await login.waitForCWTSEngineHeader();
expect(await login.isCWTSEngineBookmarks()).toBe(true);
expect(await login.isCWTSEngineHistory()).toBe(true);
expect(await login.isCWTSEnginePassword()).toBe(true);
Expand Down

0 comments on commit 3603292

Please sign in to comment.