-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: flaky e2e patterns #16696
fix: flaky e2e patterns #16696
Conversation
Signed-off-by: zomars <zomars@me.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (09/18/24)1 reviewer was added to this PR based on Keith Williams's automation. |
const TESTING_USERNAMES = [ | ||
{ | ||
username: "demousernamex", | ||
description: "", | ||
}, | ||
{ | ||
username: "demo.username", | ||
description: " to include periods(or dots)", | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged tests into parametized one since it was the exact same code with only username differences
@@ -225,7 +228,6 @@ testBothFutureAndLegacyRoutes.describe("Event Types tests", () => { | |||
await page.locator(`text="Cal Video (Global)"`).click(); | |||
|
|||
await saveEventType(page); | |||
await page.getByTestId("toast-success").waitFor(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already handled on saveEventType
await submitAndWaitForResponse(page, "/api/trpc/auth/changePassword?batch=1", { | ||
action: () => page.locator("text=Update").click(), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perfect to not depending on toast messages🙏
/** Fastest way so far to test for saving changes and form submissions */ | ||
/** | ||
* Fastest way so far to test for saving changes and form submissions | ||
* @see https://playwright.dev/docs/api/class-page#page-wait-for-response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added reasoning for this utility.
}) => { | ||
// eslint-disable-next-line playwright/no-skipped-test | ||
test.skip(!process.env.DAILY_API_KEY, "DAILY_API_KEY is needed for this test"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF process.env.DAILY_API_KEY is undefined videoCallUrl will be an empty string which IMO default the purpose of this test
@@ -78,7 +78,6 @@ test.describe("Team", () => { | |||
password: "P4ssw0rd!", | |||
}); | |||
await page.locator(`button:text("${t("add")}")`).click(); | |||
await page.locator(`[data-testid="copy-invite-link-button"]`).click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already handled in getInviteLink
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review
E2E results are ready! |
@zomars Can you check? Some tests are failing, especially login.e2e. |
I'm waiting on published results to do a deep dive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @anikdhabal good alternative to a hard refresh
const seed = `${username}:${dayjs(startDate).utc().format()}:${new Date().getTime()}:${ | ||
workerInfo.workerIndex | ||
}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes rare collision case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added waitUntil for non blocking promises and updated the unit test
All checks passed🙏. @zomars can you check this weird issue. This is very flaky |
It happens when we try to waitforUrl and the page does a hard refresh. Causing a response interruption. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM🚀
What does this PR do?
This PR refactors various end-to-end tests to use a new
submitAndWaitForResponse
utility function for form submissions and API calls. It also introduces aconfirmReschedule
helper function to standardize the rescheduling process across tests. These changes improve test reliability and reduce duplication.Key changes include:
submitAndWaitForResponse
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist