fix(e2e): replace false-passing assertions and hard-coded waits in test suite (#28486)
* fix(e2e): replace always-passing assertions and hard-coded waits
- Replace toBeTruthy() on Locator objects with toBeVisible() (always-passing)
- Replace toBeTruthy() on boolean expressions with toBe(true) for clarity
- Replace hardcoded waitForTimeout() with element-based waits (waitFor/toBeVisible)
- Fix strict mode violation: getByTestId("away-emoji").first()
- Fix error assertion: infinite redirect error shown as toast → getByTestId("toast-error")
- Fix isDisabled() no-op → await expect().toBeDisabled() in workflows fixture
- Fix alby setup: add waitForURL(), remove unverifiable "Connect with Alby" assertion
- Fix stripe/paypal: replace no-op isDisabled() with toBeChecked() on paypal switch
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* fix(e2e): fix stale comment in stripe price test
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* fix(e2e): address cubic review feedback on assertion patterns
- workflows.ts: replace non-retrying isDisabled() snapshot with toBeDisabled()
- out-of-office.e2e.ts: add .first() for away-emoji strict mode, use toast-error testid, remove unused const t
- payment-apps.e2e.ts: replace always-passing toBeTruthy() with toHaveURL() assertion
* fix
---------
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Romit <[email protected]>
Co-authored-by: Romit <[email protected]>
This commit is contained in:
9 files changed
+35
-36
No files matched your search
@@ -40,8 +40,7 @@ export function createAppsFixture(page: Page) {
|
||||
await page.waitForURL(`apps/installation/event-types?slug=${app}`);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await page.locator(`[data-testid="select-event-type-${eventTypeIds[0]}"]`).waitFor({ state: "visible" });
|
||||
for (const id of eventTypeIds) {
|
||||
await page.click(`[data-testid="select-event-type-${id}"]`);
|
||||
}
|
||||
@@ -88,8 +87,7 @@ export function createAppsFixture(page: Page) {
|
||||
await page.getByTestId("install-app-button").click();
|
||||
await page.waitForURL(`apps/installation/event-types?slug=${app.slug}`);
|
||||
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await page.locator(`[data-testid="select-event-type-${eventTypeIds[0]}"]`).waitFor({ state: "visible" });
|
||||
for (const id of eventTypeIds) {
|
||||
await page.click(`[data-testid="select-event-type-${id}"]`);
|
||||
}
|
||||
|
||||
@@ -127,8 +127,8 @@ export function createWorkflowPageFixture(page: Page) {
|
||||
getWorkflowButton("delete-button"),
|
||||
]);
|
||||
|
||||
expect(editButton.isDisabled()).toBeTruthy();
|
||||
expect(deleteButton.isDisabled()).toBeTruthy();
|
||||
await expect(editButton).toBeDisabled();
|
||||
await expect(deleteButton).toBeDisabled();
|
||||
};
|
||||
|
||||
const assertWorkflowWasTriggered = async (emails: Fixtures["emails"], emailsToBeReceived: string[]) => {
|
||||
|
||||
Reference in new issue
Block a user