Skip to content

Commit 36ccde3

Browse files
tyler-danegithub-advanced-security[bot]Copilot
authored
feat!: bump node to v24 and setup playwright (#1116)
* chore: update .gitignore to include Playwright and test report directories * feat: add end-to-end testing support with Playwright * feat(e2e): add Playwright configuration and login tests * feat(e2e): update Node.js version requirement and add E2E workflow * deps: update yarn.lock * deps(scripts): update @types/node to version 24.7.2 in package.json and yarn.lock * chore(github): update Node.js version to 24 in CI workflows * chore(github): rename test files for clarify * chore(web): fix webpack URL message * chore: update playwright and e2e vars * deps(web): update html-webpack-plugin to version 5.6.4 in package.json and yarn.lock * fix(web): improve error message for missing GOOGLE_CLIENT_ID in webpack config * Potential fix for code scanning alert no. 42: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix(scripts): update clientId variable * fix(e2e): simplify e2e test to check for login redirect * fix(e2e): mock /auth/google response * fix(e2e): mock auth apis * fix(e2e): enhance login redirect tests with detailed logging and debugging * fix(e2e): enhance Playwright config for CI with timeouts and retries * chore: revert debugging and simplify test * test(e2e): simplify test * chore: reduce timeout * Update e2e/render.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/web/webpack.config.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent be215aa commit 36ccde3

File tree

12 files changed

+1461
-1109
lines changed

12 files changed

+1461
-1109
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Node.js
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: "20"
24+
node-version: "24"
2525
cache: "yarn"
2626

2727
- name: Install dependencies

.github/workflows/test-e2e.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
jobs:
11+
e2e:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 24
22+
cache: yarn
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile --network-timeout 300000
26+
27+
- name: Install Playwright browsers
28+
run: npx playwright install --with-deps chromium
29+
30+
- name: Run e2e tests
31+
env:
32+
TZ: Etc/UTC
33+
GOOGLE_CLIENT_ID: test-client-id
34+
API_BASEURL: http://localhost:3000/api
35+
API_PORT: 3000
36+
run: yarn test:e2e
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test
33
on: [push]
44

55
jobs:
6-
install-test-compile:
6+
unit:
77
runs-on: ubuntu-latest
88

99
steps:
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install Node.js and Yarn
1414
uses: actions/setup-node@v4
1515
with:
16-
node-version: 20
16+
node-version: 24
1717
cache: "yarn"
1818

1919
- name: Install Dependencies

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ build/
2828
buildcache/
2929
logs/
3030
node_modules/
31+
playwright-report/
32+
test-results/
33+
blob-report/
3134

3235
#core
3336
packages/core/build/
@@ -45,4 +48,4 @@ packages/backend/.env
4548
packages/backend/.prod.env
4649

4750

48-
!.env.example
51+
!.env.example

e2e/render.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { expect, test } from "@playwright/test";
2+
3+
test("DOM is not empty", async ({ page }) => {
4+
await page.goto("/");
5+
6+
const html = await page.content();
7+
expect(html.length).toBeGreaterThan(0);
8+
});

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"browserslist": "last 2 Chrome versions",
88
"main": "",
99
"engines": {
10-
"node": ">=18.18.0"
10+
"node": ">=24.0.0"
1111
},
1212
"lint-staged": {
1313
"**/*": "prettier --write --ignore-unknown"
@@ -28,6 +28,7 @@
2828
"dev:web": "node packages/scripts/src/commands/devWeb.js",
2929
"postinstall": "husky install | chmod ug+x .husky/*",
3030
"test": "cross-env-shell TZ=Etc/UTC yarn jest",
31+
"test:e2e": "playwright test",
3132
"test:backend": "yarn test backend",
3233
"test:core": "yarn test core",
3334
"test:web": "yarn test web",
@@ -51,6 +52,7 @@
5152
"@eslint/compat": "^1.2.6",
5253
"@eslint/eslintrc": "^3.2.0",
5354
"@eslint/js": "^9.20.0",
55+
"@playwright/test": "^1.56.0",
5456
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
5557
"@types/uuid": "^9.0.0",
5658
"@typescript-eslint/eslint-plugin": "^8.0.0",

packages/scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@types/inquirer": "^9.0.1",
1919
"@types/lodash.uniqby": "^4.7.9",
20-
"@types/node": "^20.6.3",
20+
"@types/node": "^24.7.2",
2121
"@types/shelljs": "^0.8.15",
2222
"ts-node-dev": "^2.0.0",
2323
"tsconfig-paths": "^4.0.0",

packages/scripts/src/commands/devWeb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require("path");
55
const envPath = path.join(__dirname, "..", "..", "..", "backend", ".env");
66
dotenv.config({ path: envPath });
77

8-
const clientId = process.env.CLIENT_ID;
8+
const clientId = process.env.GOOGLE_CLIENT_ID || process.env.CLIENT_ID;
99
const port = process.env.PORT;
1010
const baseUrl = process.env.BASEURL || `http://localhost:${port}/api`;
1111
const posthogKey = process.env.POSTHOG_KEY;

packages/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"classnames": "^2.3.1",
2020
"css-loader": "^6.3.0",
2121
"dayjs": "^1.10.7",
22-
"html-webpack-plugin": "^5.3.2",
22+
"html-webpack-plugin": "^5.6.4",
2323
"http-server": "^14.1.0",
2424
"immutability-helper": "^3.1.1",
2525
"lodash.debounce": "^4.0.8",

packages/web/webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ module.exports = (env, argv) => {
2222
const POSTHOG_KEY = env.POSTHOG_KEY;
2323
const POSTHOG_HOST = env.POSTHOG_HOST;
2424

25-
if (!argv.mode || GOOGLE_CLIENT_ID === "undefined") {
26-
console.error(`Oopsies, you're missing a required parameter.
25+
if (GOOGLE_CLIENT_ID === "undefined") {
26+
console.error(`Oopsies, you're missing the GOOGLE_CLIENT_ID variable.
2727
Make sure you include all required environment variables in the .env file.
28-
Reference: https://docs.compasscalendar.com/docs/get-started/configuration/env
28+
Reference: https://docs.compasscalendar.com/docs/get-started/setup
2929
`);
3030
return;
3131
}

0 commit comments

Comments
 (0)