test(e2e): extract shared page test setup hooks

This commit is contained in:
Abhimanyu Saharan
2026-03-04 22:24:35 +05:30
parent d1b08b4777
commit 39f314cd8c
4 changed files with 41 additions and 47 deletions

View File

@@ -1,5 +1,7 @@
/// <reference types="cypress" />
import { setupCommonPageTestHooks } from "../support/testHooks";
// Clerk/Next.js occasionally triggers a hydration mismatch on auth routes in CI.
// This is non-deterministic UI noise for these tests; ignore it so assertions can proceed.
Cypress.on("uncaught:exception", (err) => {
@@ -13,25 +15,7 @@ describe("Skill packs", () => {
const apiBase = "**/api/v1";
const email = Cypress.env("CLERK_TEST_EMAIL") || "jane+clerk_test@example.com";
const originalDefaultCommandTimeout = Cypress.config("defaultCommandTimeout");
beforeEach(() => {
Cypress.config("defaultCommandTimeout", 20_000);
cy.intercept("GET", "**/healthz", {
statusCode: 200,
body: { ok: true },
}).as("healthz");
cy.intercept("GET", `${apiBase}/organizations/me/member*`, {
statusCode: 200,
body: { organization_id: "org1", role: "owner" },
}).as("orgMeMember");
});
afterEach(() => {
Cypress.config("defaultCommandTimeout", originalDefaultCommandTimeout);
});
setupCommonPageTestHooks(apiBase);
it("can sync a pack and surface warnings", () => {
cy.intercept("GET", `${apiBase}/skills/packs*`, {