Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d972160
Add playwright ui for debugging
ahmedxgouda Dec 30, 2025
3506056
Fix e2e tests communication
ahmedxgouda Jan 26, 2026
2a30c68
Migrate ProjectDetails, About and update Makefile
ahmedxgouda Jan 27, 2026
8123029
Update CI/CD
ahmedxgouda Jan 27, 2026
a2181ae
Apply check-spelling
ahmedxgouda Jan 27, 2026
e49822f
Skip sonar
ahmedxgouda Jan 27, 2026
80ae01f
Add dayjs
ahmedxgouda Jan 27, 2026
a898168
Use Dockerfile instead of Dockerfile.e2e
ahmedxgouda Jan 28, 2026
458e7c9
Update CI/CD
ahmedxgouda Jan 28, 2026
b712f3c
Update tests
ahmedxgouda Jan 28, 2026
362685a
Fix cspell and codeql
ahmedxgouda Jan 29, 2026
6fa40c9
Update code
ahmedxgouda Jan 29, 2026
3992db1
Run checks
ahmedxgouda Jan 31, 2026
1b78068
Update code
ahmedxgouda Jan 31, 2026
da945f5
Update code and tests
ahmedxgouda Jan 31, 2026
7382d7a
Update docs
ahmedxgouda Jan 31, 2026
cb36a6d
Update docs
ahmedxgouda Jan 31, 2026
7967a8d
Update config
ahmedxgouda Feb 1, 2026
9e96137
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 1, 2026
3b6b75d
Test with one worker
ahmedxgouda Feb 1, 2026
ede87ea
Revert "Test with one worker"
ahmedxgouda Feb 1, 2026
219da29
Update code
ahmedxgouda Feb 2, 2026
d555e15
Try csrf_exempt
ahmedxgouda Feb 2, 2026
cf39763
Revert "Try csrf_exempt"
ahmedxgouda Feb 2, 2026
45a40c0
Update envs
ahmedxgouda Feb 2, 2026
4b98d10
Update workers
ahmedxgouda Feb 2, 2026
bec8e54
Update workers
ahmedxgouda Feb 2, 2026
a9b1c7d
Update code and tests
ahmedxgouda Feb 2, 2026
5771f57
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 2, 2026
0ebd1a0
Skip sonar
ahmedxgouda Feb 2, 2026
12fcf23
Update code
ahmedxgouda Feb 2, 2026
a427697
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 3, 2026
d6d72ed
Apply sonar suggestions and update tests and config
ahmedxgouda Feb 3, 2026
56e0c35
Make tests parallel
ahmedxgouda Feb 3, 2026
ef5d754
Apply rabbit suggestion
ahmedxgouda Feb 3, 2026
34f42dc
Apply rabbit suggestions
ahmedxgouda Feb 3, 2026
2ac3a6d
Update code
arkid15r Feb 4, 2026
8495de8
Apply suggestions and fix dockerignore
ahmedxgouda Feb 4, 2026
65a24f5
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 6, 2026
be885e1
Update UserDetails Test
ahmedxgouda Feb 6, 2026
647f0a4
Run checks
ahmedxgouda Feb 6, 2026
e9cb768
Update code
ahmedxgouda Feb 6, 2026
4842512
Update tests
ahmedxgouda Feb 6, 2026
3110ebc
Update envs
ahmedxgouda Feb 6, 2026
e014056
Update run-ci-cd
ahmedxgouda Feb 6, 2026
e930b23
Update run-ci-cd
ahmedxgouda Feb 6, 2026
3ad7b02
Reorder build-args in CI/CD
ahmedxgouda Feb 8, 2026
6be04cb
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 8, 2026
0931b22
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 12, 2026
166059c
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 15, 2026
2125d16
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 22, 2026
247c5a2
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Feb 25, 2026
91afdd5
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Mar 3, 2026
8b4565b
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Mar 7, 2026
8c0fbb0
Run checks
ahmedxgouda Mar 7, 2026
9a2f6ce
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Mar 16, 2026
9e8094c
Merge branch 'main' into e2e/migrate-e2e-tests
ahmedxgouda Mar 18, 2026
c1af227
Merge branch 'main' into pr/ahmedxgouda/3591
arkid15r Mar 19, 2026
54a4f43
Update code
arkid15r Mar 19, 2026
ba25c0d
Merge branch 'main' into e2e/migrate-e2e-tests
arkid15r Mar 19, 2026
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
44 changes: 39 additions & 5 deletions .github/workflows/run-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ jobs:
run: |
timeout 5m bash -c '
until wget --spider http://localhost:9000/a; do
echo "Waiting for backend..."
echo "Waiting for the backend..."
sleep 5
done
'
Expand All @@ -321,12 +321,42 @@ jobs:
run: |
pg_restore -h localhost -U nest_user_e2e -d nest_db_e2e < backend/data/nest.dump

- name: Build frontend end-to-end testing image
- name: Build frontend image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
cache-from: |
type=gha
type=registry,ref=owasp/nest:test-frontend-e2e-cache
type=registry,ref=owasp/nest:frontend-e2e-cache
context: frontend
file: docker/frontend/Dockerfile
build-args: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering what's your approach for finding a good spot for a new arg/param

ENV_FILE=.env.e2e.example
NEXT_PUBLIC_E2E_BACKEND_BASE_URL=http://localhost:9000
load: true
platforms: linux/amd64
tags: owasp/nest:frontend-e2e-latest
Comment thread
ahmedxgouda marked this conversation as resolved.

Comment thread
ahmedxgouda marked this conversation as resolved.
- name: Run frontend in the background
run: |
docker run -d --name e2e-nest-frontend \
--env-file frontend/.env.e2e.example \
--network host \
-p 3000:3000 \
owasp/nest:frontend-e2e-latest
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Wait for frontend to be ready
run: |
timeout 5m bash -c '
until wget --spider http://localhost:3000/; do
echo "Waiting for the frontend..."
sleep 5
done
'
echo "Frontend is up!"

- name: Build e2e testing image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: frontend
file: docker/frontend/Dockerfile.e2e.test
load: true
Expand All @@ -335,8 +365,12 @@ jobs:

- name: Run frontend end-to-end tests
run: |
docker run --env-file frontend/.env.e2e.example owasp/nest:test-frontend-e2e-latest pnpm run test:e2e
timeout-minutes: 15
docker run --network host \
-e FRONTEND_URL=http://localhost:3000 \
-e NEXTAUTH_SECRET=secret \
-e NEXTAUTH_URL=http://localhost:3000 \
owasp/nest:test-frontend-e2e-latest npx playwright test
timeout-minutes: 20
Comment thread
ahmedxgouda marked this conversation as resolved.

run-frontend-a11y-tests:
name: Run frontend accessibility tests
Expand Down
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ This command automatically:
- Executes the e2e tests
- Cleans up containers when done

To run e2e tests without initializing the database, use the following command:

```bash
make test-frontend-e2e-no-init
```

For debugging, you can run the e2e backend separately:

```bash
Expand All @@ -468,6 +474,20 @@ Then load data manually in another terminal:
make load-data-e2e
```

For debugging the frontend e2e tests UI mode, run:

```bash
make test-frontend-e2e-ui
```

To run the frontend e2e tests UI mode without the database initialized, use the following command:

```bash
make test-frontend-e2e-ui-no-init
```

You can access the UI at [http://localhost:3800](http://localhost:3800).

### Running Fuzz Tests

Run the fuzz tests with the following command:
Expand Down
5 changes: 1 addition & 4 deletions .dockerignore → backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
.bash_history
.cache
.dockerignore
.env
.env.*
.envs
.git
.gitignore
.local
Expand All @@ -17,13 +14,13 @@
*.log
*.pem
**/__pycache__
backend/data
backend/staticfiles
build
coverage
dist
docker
Dockerfile.*
node_modules
**/node_modules
npm-debug.log
venv
5 changes: 5 additions & 0 deletions cspell/custom-dict.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
AVD
Abhay
Agentic
Agsoc
Aichi
Aissue
Atqc
Aupdated
BOTTOMPADDING
Balbin
Balbin's
Birda
CCSP
CISSP
Expand Down Expand Up @@ -46,6 +49,7 @@ Sivagangai
Sonarqube
Stegen
T04T40NHX
Tarandach
Truncator
Turbopack
Twitterbot
Expand Down Expand Up @@ -93,6 +97,7 @@ geocoders
geoloc
geopy
gha
glueup
graphiql
graphqler
gunicorn
Expand Down
38 changes: 32 additions & 6 deletions docker-compose/e2e/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,45 @@ services:
volumes:
- e2e-cache-data:/data

frontend:
container_name: e2e-nest-frontend
build:
context: ../../frontend
dockerfile: ../docker/frontend/Dockerfile
args:
ENV_FILE: .env.e2e.example

env_file: ../../frontend/.env.e2e.example
depends_on:
backend:
condition: service_healthy
ports:
- 3500:3000
networks:
- e2e-nest-network
healthcheck:
interval: 5s
start_period: 20s
retries: 10
test: >
sh -c '
wget --spider http://0.0.0.0:3000/
Comment thread
ahmedxgouda marked this conversation as resolved.
'
timeout: 5s
Comment thread
ahmedxgouda marked this conversation as resolved.

e2e-tests:
container_name: e2e-nest-tests
build:
context: ../../frontend
dockerfile: ../docker/frontend/Dockerfile.e2e.test
command: >
sh -c '
pnpm run test:e2e
'
depends_on:
backend:
frontend:
condition: service_healthy
env_file: ../../frontend/.env.e2e.example
command: ${E2E_TEST_COMMAND:-sh -c "pnpm run test:e2e"}
environment:
- FRONTEND_URL=http://frontend:3000
ports:
- 3800:3800
networks:
- e2e-nest-network

Expand Down
9 changes: 7 additions & 2 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ ENV APK_CACHE_DIR="/app/.cache/apk" \
NPM_CACHE="/app/.npm" \
PNPM_HOME="/pnpm"

ENV PATH="$PNPM_HOME:$PATH"
ARG ENV_FILE=.env
ARG NEXT_PUBLIC_E2E_BACKEND_BASE_URL=http://backend:9000

ENV PATH="$PNPM_HOME:$PATH" \
NEXT_PUBLIC_E2E_BACKEND_BASE_URL=${NEXT_PUBLIC_E2E_BACKEND_BASE_URL}

RUN mkdir -p ${APK_CACHE_DIR} && \
ln -fns ${APK_CACHE_DIR} ${APK_SYMLINK_DIR}
Expand All @@ -29,7 +33,8 @@ COPY --chmod=444 package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile --ignore-scripts

COPY --chmod=444 .env .pnpmrc next.config.ts postcss.config.js tailwind.config.mjs tsconfig.json ./
COPY --chmod=444 .pnpmrc next.config.ts postcss.config.js tailwind.config.mjs tsconfig.json ./
COPY --chmod=444 ${ENV_FILE} ./.env
Comment thread
ahmedxgouda marked this conversation as resolved.
COPY --chmod=555 public public
COPY --chmod=555 src src

Expand Down
13 changes: 7 additions & 6 deletions docker/frontend/Dockerfile.e2e.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ RUN --mount=type=cache,target=${NPM_CACHE} \

WORKDIR /app

COPY --chmod=444 package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile --ignore-scripts
COPY --chmod=444 __tests__/e2e/package.json __tests__/e2e/pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile --ignore-scripts
Comment thread
ahmedxgouda marked this conversation as resolved.
Outdated
Comment thread
ahmedxgouda marked this conversation as resolved.
Outdated

COPY .pnpmrc next.config.ts postcss.config.js playwright.config.ts tailwind.config.mjs tsconfig.json ./
Comment thread
ahmedxgouda marked this conversation as resolved.
COPY src/utils src/utils
COPY __tests__/e2e __tests__/e2e
COPY __tests__/mockData __tests__/mockData
COPY .pnpmrc next.config.ts postcss.config.js playwright.config.ts tailwind.config.mjs tsconfig.json ./
COPY public public
COPY src src

EXPOSE 3800
26 changes: 26 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.ash_history
.bash_history
.cache
.dockerignore
.git
.gitignore
.local
.next
.pnpm-store
.pytest_cache
.ruff_cache
.venv
.vscode
*.log
*.pem
**/__pycache__
backend/staticfiles
build
coverage
dist
docker
Dockerfile.*
node_modules
**/node_modules
npm-debug.log
venv
14 changes: 7 additions & 7 deletions frontend/.env.e2e.example
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
NEXTAUTH_SECRET=<your-nextauth-secret>
NEXTAUTH_SECRET=secret3234
NEXTAUTH_URL=http://localhost:3000/
NEXT_PUBLIC_API_URL=http://localhost:9000/
NEXT_PUBLIC_CSRF_URL=http://localhost:9000/csrf/
NEXT_PUBLIC_ENVIRONMENT=local
NEXT_PUBLIC_GRAPHQL_URL=http://localhost:9000/graphql/
NEXT_PUBLIC_API_URL=/
NEXT_PUBLIC_CSRF_URL=/csrf/
NEXT_PUBLIC_ENVIRONMENT=production

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right.

NEXT_PUBLIC_GRAPHQL_URL=/graphql/
NEXT_PUBLIC_GTM_ID=
NEXT_PUBLIC_IDX_URL=http://localhost:9000/idx/
NEXT_PUBLIC_IS_PROJECT_HEALTH_ENABLED=true
NEXT_PUBLIC_RELEASE_VERSION=
NEXT_PUBLIC_SENTRY_DSN=
NEXT_SERVER_CSRF_URL=http://localhost:9000/csrf/
NEXT_SERVER_DISABLE_SSR=false
NEXT_SERVER_GITHUB_CLIENT_ID=your-github-client-id
NEXT_SERVER_GITHUB_CLIENT_SECRET=your-github-client-secret
NEXT_SERVER_GITHUB_CLIENT_ID=retye6y6
NEXT_SERVER_GITHUB_CLIENT_SECRET=tyurtyu5
NEXT_SERVER_GRAPHQL_URL=http://localhost:9000/graphql/
22 changes: 16 additions & 6 deletions frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ format-frontend-code:
graphql-codegen:
@cd frontend && pnpm run graphql-codegen

init-e2e-db:
@docker container rm -f e2e-nest-db >/dev/null 2>&1 || true
@docker volume rm -f nest-e2e_e2e-db-data >/dev/null 2>&1 || true
@DOCKER_BUILDKIT=1 \
docker compose --project-name nest-e2e -f docker-compose/e2e/compose.yaml up --build --remove-orphans --abort-on-container-exit db cache backend data-loader

lighthouse-ci:
@cd frontend && pnpm run lighthouse-ci

Expand Down Expand Up @@ -90,13 +96,17 @@ test-frontend-a11y:
-t nest-test-frontend-a11y
@docker run --env-file frontend/.env.example --rm nest-test-frontend-a11y pnpm run test:a11y

test-frontend-e2e:
@docker container rm -f e2e-nest-db >/dev/null 2>&1 || true
@docker volume rm -f nest-e2e_e2e-db-data >/dev/null 2>&1 || true
test-frontend-e2e-no-db-init:
@DOCKER_BUILDKIT=1 \
docker compose --project-name nest-e2e -f docker-compose/e2e/compose.yaml up --build --remove-orphans --abort-on-container-exit db cache backend data-loader
@DOCKER_BUILDKIT=1 NEXT_PUBLIC_ENVIRONMENT=local \
docker compose --project-name nest-e2e -f docker-compose/e2e/compose.yaml up --build --remove-orphans --abort-on-container-exit db cache backend e2e-tests
docker compose --project-name nest-e2e -f docker-compose/e2e/compose.yaml up --build --remove-orphans --abort-on-container-exit db cache backend frontend e2e-tests

test-frontend-e2e: init-e2e-db test-frontend-e2e-no-db-init

test-frontend-e2e-ui-no-db-init:
@DOCKER_BUILDKIT=1 E2E_TEST_COMMAND="pnpm run test:e2e:ui" \
docker compose --project-name nest-e2e -f docker-compose/e2e/compose.yaml up --build --remove-orphans --abort-on-container-exit db cache backend frontend e2e-tests

test-frontend-e2e-ui: init-e2e-db test-frontend-e2e-ui-no-db-init

test-frontend-unit:
@DOCKER_BUILDKIT=1 NEXT_PUBLIC_ENVIRONMENT=local docker build \
Expand Down
29 changes: 0 additions & 29 deletions frontend/__tests__/e2e/components/Footer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { mockHomeData } from '@e2e/data/mockHomeData'
import { test, expect, devices } from '@playwright/test'

// Desktop tests
Expand All @@ -9,20 +8,6 @@ test.describe('Footer - Desktop (Chrome)', () => {
})

test.beforeEach(async ({ page }) => {
await page.route('**/graphql/', async (route) => {
await route.fulfill({
status: 200,
json: mockHomeData,
})
})
await page.context().addCookies([
{
name: 'csrftoken',
value: 'abc123',
domain: 'localhost',
path: '/',
},
])
await page.goto('/')
})
test('should have buttons', async ({ page }) => {
Expand All @@ -45,20 +30,6 @@ test.use({

test.describe('Footer - Mobile (iPhone 13)', () => {
test.beforeEach(async ({ page }) => {
await page.route('**/graphql/', async (route) => {
await route.fulfill({
status: 200,
json: mockHomeData,
})
})
await page.context().addCookies([
{
name: 'csrftoken',
value: 'abc123',
domain: 'localhost',
path: '/',
},
])
await page.goto('/')
})
test('should have buttons', async ({ page }) => {
Expand Down
Loading
Loading