Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/functional-tests/pages/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export abstract class BaseLayout {
const expectedCommand = webChannelMessage.message.command;
const response = webChannelMessage.message.data;

await this.page.evaluate(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The evaluate will run immediately but also means the page needs to be loaded (and can't be loaded after evaluation). By switching to addInitScript it's injected and run before any other scripts.

The flaky test problem that was happening is that the browser would navigate to the signin page, and already respond to the web channel message before playwright had a chance to intercept. This could be replicated locally by setting a slowmo value ~ 500ms, or by just placing a breakpoint on the respondToWebChannelMessage after the page navigation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked other tests that use this too and they still pass locally without modification, but if we see flakes in CI, then we can adjust when respondToWebChannelMessage is called in those tests too, similar to this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and this is our most recent and common flaky test according to circle on nightly builds!

await this.page.addInitScript(
({ expectedCommand, response }) => {
function listener(e: CustomEvent) {
const detail = JSON.parse(e.detail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ test.describe('severity-2 #smoke', () => {
},
},
};

await signin.respondToWebChannelMessage(eventDetailStatus);
await page.goto(
`${
target.contentServerUrl
}?context=fx_desktop_v3&service=sync&automatedBrowser=true&${query.toString()}`
);
await signin.respondToWebChannelMessage(eventDetailStatus);
await signin.checkWebChannelMessage(FirefoxCommand.FxAStatus);
// password confirmation required to sign in to sync
await expect(signin.passwordFormHeading).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ test.describe('severity-2 #smoke', () => {
},
},
};

await signin.respondToWebChannelMessage(eventDetailStatus);
await page.goto(
`${target.contentServerUrl}?automatedBrowser=true&${query.toString()}`
);
await signin.respondToWebChannelMessage(eventDetailStatus);
await signin.checkWebChannelMessage(FirefoxCommand.FxAStatus);
// nothing to suggest
await expect(signin.emailTextbox).toHaveValue('');
Expand Down Expand Up @@ -69,10 +68,10 @@ test.describe('severity-2 #smoke', () => {
},
};

await signin.respondToWebChannelMessage(eventDetailStatus);
await page.goto(
`${target.contentServerUrl}?automatedBrowser=true&${query.toString()}`
);
await signin.respondToWebChannelMessage(eventDetailStatus);
await signin.checkWebChannelMessage(FirefoxCommand.FxAStatus);
// account signed into browser suggested
await expect(signin.cachedSigninHeading).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ test.describe('severity-1 #smoke', () => {
target,
testAccountTracker,
}) => {
test.skip(true, 'FXA-9868');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this since the linked ticket is done and the test passes locally now! 👍

const credentials = await testAccountTracker.signUpBlocked();
const nonBlockedEmail = await testAccountTracker.generateEmail();
const uid = makeUid();
Expand Down