test(e2e): add Cypress scaffold + CI job
This commit is contained in:
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
@@ -83,3 +83,32 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
backend/coverage.xml
|
backend/coverage.xml
|
||||||
frontend/coverage/**
|
frontend/coverage/**
|
||||||
|
|
||||||
|
e2e:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [check]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: frontend/package-lock.json
|
||||||
|
|
||||||
|
- name: Cypress run
|
||||||
|
uses: cypress-io/github-action@v6
|
||||||
|
with:
|
||||||
|
working-directory: frontend
|
||||||
|
install-command: npm ci
|
||||||
|
build: npm run build
|
||||||
|
start: npm start
|
||||||
|
wait-on: http://localhost:3000
|
||||||
|
command: npm run e2e
|
||||||
|
env:
|
||||||
|
NEXT_TELEMETRY_DISABLED: "1"
|
||||||
|
# Force Clerk disabled in E2E to keep tests secretless/deterministic.
|
||||||
|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ""
|
||||||
|
|||||||
11
frontend/cypress.config.ts
Normal file
11
frontend/cypress.config.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from "cypress";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
e2e: {
|
||||||
|
baseUrl: "http://localhost:3000",
|
||||||
|
video: false,
|
||||||
|
screenshotOnRunFailure: true,
|
||||||
|
specPattern: "cypress/e2e/**/*.cy.{ts,tsx,js,jsx}",
|
||||||
|
supportFile: "cypress/support/e2e.ts",
|
||||||
|
},
|
||||||
|
});
|
||||||
7
frontend/cypress/e2e/activity_smoke.cy.ts
Normal file
7
frontend/cypress/e2e/activity_smoke.cy.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
describe("/activity page", () => {
|
||||||
|
it("loads without crashing", () => {
|
||||||
|
cy.visit("/activity");
|
||||||
|
// In secretless/unsigned state, UI should render the signed-out prompt.
|
||||||
|
cy.contains(/sign in to view the feed/i).should("be.visible");
|
||||||
|
});
|
||||||
|
});
|
||||||
2
frontend/cypress/support/e2e.ts
Normal file
2
frontend/cypress/support/e2e.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Cypress support file.
|
||||||
|
// Place global hooks/commands here.
|
||||||
1578
frontend/package-lock.json
generated
1578
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,9 @@
|
|||||||
"test": "vitest run --passWithNoTests --coverage",
|
"test": "vitest run --passWithNoTests --coverage",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"dev:lan": "next dev --hostname 0.0.0.0 --port 3000",
|
"dev:lan": "next dev --hostname 0.0.0.0 --port 3000",
|
||||||
"api:gen": "orval --config ./orval.config.ts"
|
"api:gen": "orval --config ./orval.config.ts",
|
||||||
|
"e2e": "cypress run",
|
||||||
|
"e2e:open": "cypress open"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clerk/nextjs": "^6.37.1",
|
"@clerk/nextjs": "^6.37.1",
|
||||||
@@ -52,6 +54,7 @@
|
|||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"typescript": "^5",
|
"typescript": "^5",
|
||||||
"vitest": "^2.1.8"
|
"vitest": "^2.1.8",
|
||||||
|
"cypress": "^14.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user