Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
016aee8
chore: update .gitignore to include Playwright and test report direct…
tyler-dane Oct 14, 2025
629c41e
feat: add end-to-end testing support with Playwright
tyler-dane Oct 14, 2025
7beca37
feat(e2e): add Playwright configuration and login tests
tyler-dane Oct 14, 2025
f2097da
feat(e2e): update Node.js version requirement and add E2E workflow
tyler-dane Oct 14, 2025
af8d448
deps: update yarn.lock
tyler-dane Oct 14, 2025
16d71cb
deps(scripts): update @types/node to version 24.7.2 in package.json a…
tyler-dane Oct 14, 2025
9809ff6
chore(github): update Node.js version to 24 in CI workflows
tyler-dane Oct 14, 2025
37e4a24
chore(github): rename test files for clarify
tyler-dane Oct 14, 2025
4112601
chore(web): fix webpack URL message
tyler-dane Oct 14, 2025
b201eed
chore: update playwright and e2e vars
tyler-dane Oct 14, 2025
9b23b09
deps(web): update html-webpack-plugin to version 5.6.4 in package.jso…
tyler-dane Oct 14, 2025
1564e98
fix(web): improve error message for missing GOOGLE_CLIENT_ID in webpa…
tyler-dane Oct 14, 2025
39429a4
Potential fix for code scanning alert no. 42: Workflow does not conta…
tyler-dane Oct 14, 2025
2a313be
fix(scripts): update clientId variable
tyler-dane Oct 14, 2025
063f186
fix(e2e): simplify e2e test to check for login redirect
tyler-dane Oct 14, 2025
a459ed2
fix(e2e): mock /auth/google response
tyler-dane Oct 14, 2025
21e8827
fix(e2e): mock auth apis
tyler-dane Oct 14, 2025
278e402
fix(e2e): enhance login redirect tests with detailed logging and debu…
tyler-dane Oct 14, 2025
9af3c98
fix(e2e): enhance Playwright config for CI with timeouts and retries
tyler-dane Oct 14, 2025
0eaaa93
chore: revert debugging and simplify test
tyler-dane Oct 14, 2025
4d93a05
test(e2e): simplify test
tyler-dane Oct 14, 2025
3674606
chore: reduce timeout
tyler-dane Oct 14, 2025
cbf7bc5
Update e2e/render.spec.ts
tyler-dane Oct 14, 2025
4753eff
Update packages/web/webpack.config.js
tyler-dane Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "24"
cache: "yarn"

- name: Install dependencies
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test

on:
pull_request:
branches:
- main

permissions:
contents: read
jobs:
e2e:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 300000

- name: Install Playwright browsers
run: npx playwright install --with-deps chromium

- name: Run e2e tests
env:
TZ: Etc/UTC
GOOGLE_CLIENT_ID: test-client-id
API_BASEURL: http://localhost:3000/api
API_PORT: 3000
run: yarn test:e2e
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test
on: [push]

jobs:
install-test-compile:
unit:
runs-on: ubuntu-latest

steps:
Expand All @@ -13,7 +13,7 @@ jobs:
- name: Install Node.js and Yarn
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: "yarn"

- name: Install Dependencies
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ build/
buildcache/
logs/
node_modules/
playwright-report/
test-results/
blob-report/

#core
packages/core/build/
Expand All @@ -45,4 +48,4 @@ packages/backend/.env
packages/backend/.prod.env


!.env.example
!.env.example
8 changes: 8 additions & 0 deletions e2e/render.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect, test } from "@playwright/test";

test("DOM is not empty", async ({ page }) => {
await page.goto("/");

const html = await page.content();
expect(html.length).toBeGreaterThan(0);
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browserslist": "last 2 Chrome versions",
"main": "",
"engines": {
"node": ">=18.18.0"
"node": ">=24.0.0"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
Expand All @@ -28,6 +28,7 @@
"dev:web": "node packages/scripts/src/commands/devWeb.js",
"postinstall": "husky install | chmod ug+x .husky/*",
"test": "cross-env-shell TZ=Etc/UTC yarn jest",
"test:e2e": "playwright test",
"test:backend": "yarn test backend",
"test:core": "yarn test core",
"test:web": "yarn test web",
Expand All @@ -51,6 +52,7 @@
"@eslint/compat": "^1.2.6",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.20.0",
"@playwright/test": "^1.56.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@types/inquirer": "^9.0.1",
"@types/lodash.uniqby": "^4.7.9",
"@types/node": "^20.6.3",
"@types/node": "^24.7.2",
"@types/shelljs": "^0.8.15",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/commands/devWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require("path");
const envPath = path.join(__dirname, "..", "..", "..", "backend", ".env");
dotenv.config({ path: envPath });

const clientId = process.env.CLIENT_ID;
const clientId = process.env.GOOGLE_CLIENT_ID || process.env.CLIENT_ID;
const port = process.env.PORT;
const baseUrl = process.env.BASEURL || `http://localhost:${port}/api`;
const posthogKey = process.env.POSTHOG_KEY;
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"classnames": "^2.3.1",
"css-loader": "^6.3.0",
"dayjs": "^1.10.7",
"html-webpack-plugin": "^5.3.2",
"html-webpack-plugin": "^5.6.4",
"http-server": "^14.1.0",
"immutability-helper": "^3.1.1",
"lodash.debounce": "^4.0.8",
Expand Down
6 changes: 3 additions & 3 deletions packages/web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ module.exports = (env, argv) => {
const POSTHOG_KEY = env.POSTHOG_KEY;
const POSTHOG_HOST = env.POSTHOG_HOST;

if (!argv.mode || GOOGLE_CLIENT_ID === "undefined") {
console.error(`Oopsies, you're missing a required parameter.
if (GOOGLE_CLIENT_ID === "undefined") {
console.error(`Oopsies, you're missing the GOOGLE_CLIENT_ID variable.
Make sure you include all required environment variables in the .env file.
Reference: https://docs.compasscalendar.com/docs/get-started/configuration/env
Reference: https://docs.compasscalendar.com/docs/get-started/setup
`);
return;
}
Expand Down
37 changes: 37 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: "./e2e",
timeout: 30_000,
expect: {
timeout: 10_000,
},
use: {
baseURL: "http://localhost:9080",
trace: "on-first-retry",
},
projects: [
{
name: "chromium-desktop",
use: { ...devices["Desktop Chrome"] },
},
{
name: "chromium-mobile",
use: { ...devices["Pixel 5"] },
},
],
webServer: {
command: "yarn dev:web",
env: {
NODE_ENV: "test",
WEB_IS_DEV: "false",
GOOGLE_CLIENT_ID: "test-client-id",
API_BASEURL: "http://localhost:3000/api",
API_PORT: "3000",
POSTHOG_KEY: "test-posthog-key",
POSTHOG_HOST: "https://app.posthog.com",
},
port: 9080,
reuseExistingServer: !process.env.CI,
},
});
Loading