* 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 <noreply@anthropic.com>
* fix(e2e): fix stale comment in stripe price test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* 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 <noreply@anthropic.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
Co-authored-by: Romit <romitgabani1.work@gmail.com>
22 lines
840 B
TypeScript
22 lines
840 B
TypeScript
import { expect } from "@playwright/test";
|
|
|
|
import { test } from "./lib/fixtures";
|
|
|
|
test.describe.configure({ mode: "parallel" });
|
|
test.afterEach(({ users }) => users.deleteAll());
|
|
|
|
test.describe("Login with api request", () => {
|
|
test("context request will share cookie storage with its browser context", async ({ page, users }) => {
|
|
const pro = await users.create();
|
|
await pro.apiLogin();
|
|
|
|
const contextCookies = await page.context().cookies();
|
|
const cookiesMap = new Map(contextCookies.map(({ name, value }) => [name, value]));
|
|
|
|
// The browser context will already contain all the cookies from the API response.
|
|
expect(cookiesMap.has("next-auth.csrf-token")).toBe(true);
|
|
expect(cookiesMap.has("next-auth.callback-url")).toBe(true);
|
|
expect(cookiesMap.has("next-auth.session-token")).toBe(true);
|
|
});
|
|
});
|