Skip to content

Commit e647c7d

Browse files
committed
run e2e tests on every PR
1 parent b4f8e9b commit e647c7d

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

.github/workflows/test.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- "*"
1010
jobs:
11-
test:
11+
unit-tests:
1212
name: "Run Tests"
1313
runs-on: "depot-ubuntu-24.04-small"
1414
steps:
@@ -24,3 +24,21 @@ jobs:
2424
- uses: "bahmutov/npm-install@v1"
2525
- name: "Run tests"
2626
run: "yarn test"
27+
e2e-tests:
28+
name: "Run E2E Tests"
29+
runs-on: "depot-ubuntu-24.04-small"
30+
steps:
31+
- uses: "actions/checkout@v4"
32+
- uses: "authzed/action-spicedb@v1"
33+
with:
34+
version: "latest"
35+
- uses: "actions/setup-node@v4"
36+
with:
37+
node-version: 22
38+
cache-dependency-path: "yarn.lock"
39+
cache: "yarn"
40+
- uses: "bahmutov/npm-install@v1"
41+
- name: "Run sever locally"
42+
run: "yarn dev"
43+
- name: "Run e2e tests"
44+
run: "yarn cy:run"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ zed
66
build
77
.vercel
88
.env
9+
cypress/screenshots
10+
cypress/videos

cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineConfig({
1010
chromeWebSecurity: false,
1111

1212
e2e: {
13-
baseUrl: "http://localhost:3000",
13+
baseUrl: "http://localhost:5173",
1414
specPattern: [
1515
"cypress/integration/**/*.spec.{js,ts}",
1616
"cypress/e2e/**/*.cy.{js,jsx,ts,tsx}",

cypress/integration/basic.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ describe("Playground", () => {
1919

2020
it("displays header buttons", () => {
2121
cy.dismissTour();
22-
cy.get("a").contains("Discuss on Discord").should("exist");
2322
cy.get("header > button").contains("Select Example Schema").should("exist");
2423
cy.get("header > button").contains("Share").should("exist");
2524
cy.get("header > button").contains("Download").should("exist");
2625
cy.get("header > button").contains("Load From File").should("exist");
27-
cy.contains("Sign In To Import").should("exist");
2826
});
2927

3028
it("default validation succeeds", () => {

cypress/support/e2e.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
import "./commands";
1818

1919
// Handle uncaught exceptions
20-
Cypress.on("uncaught:exception", (err) => {
21-
// TODO: Ignore transient network errors until either browser caching
22-
// or js fixtures are supported
23-
// https://github.com/cypress-io/cypress/issues/18335
24-
// https://github.com/cypress-io/cypress/issues/1271
25-
if (err.message.includes("Uncaught NetworkError")) {
26-
return false;
20+
Cypress.on("uncaught:exception", (err: { msg: string }) => {
21+
// https://github.com/suren-atoyan/monaco-react/issues/440
22+
if (err.msg.includes("operation is manually canceled")) {
23+
return false; // Prevents Cypress from failing the test
2724
}
2825
});

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const rootRoute = createRootRoute({
2424
component: () => (
2525
<>
2626
<Outlet />
27-
<TanStackRouterDevtools />
27+
<TanStackRouterDevtools position={"bottom-right"} />
2828
</>
2929
),
3030
});

0 commit comments

Comments
 (0)