Skip to content

Commit deb01f2

Browse files
authored
test: remove cypress + migrate existing tests to playwright (ietf-tools#4781)
* test: remove cypress + migrate existing tests to playwright + update workflows * ci: remove leftover condition in ci-run-tests workflow * ci: add missing matrix to tests-playwright-legacy * ci: run playwright legacy as user 1001 * ci: set home var for firefox * ci: allow firefox to run as root for tests
1 parent 72648dc commit deb01f2

169 files changed

Lines changed: 5639 additions & 3883 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"vue.volar",
7373
"mrmlnc.vscode-duplicate",
7474
"ms-azuretools.vscode-docker",
75+
"ms-playwright.playwright",
7576
"ms-python.python",
7677
"ms-python.vscode-pylance",
7778
"mtxr.sqltools-driver-mysql",

.devcontainer/docker-compose.extend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
- /workspace/.vite
1212
- /workspace/.yarn/unplugged
1313
- app-assets:/assets
14-
- datatracker-vscode-ext:/root/.vscode-server/extensions
14+
# - datatracker-vscode-ext:/root/.vscode-server/extensions
1515
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
1616
network_mode: service:db
1717

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ module.exports = {
99
},
1010
extends: [
1111
// 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
12-
'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
13-
'plugin:cypress/recommended'
12+
'plugin:vue/vue3-strongly-recommended' // Priority B: Strongly Recommended (Improving Readability)
1413
],
1514
globals: {
1615
d3: true

.github/workflows/build.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ jobs:
222222
path: playwright/test-results/
223223
if-no-files-found: ignore
224224

225-
tests-cypress:
226-
name: Run Tests (Cypress)
225+
tests-playwright-legacy:
226+
name: Run Tests (Playwright Legacy)
227227
if: ${{ github.event.inputs.skiptests == 'false' }}
228228
needs: [prepare]
229229
runs-on: ubuntu-latest
@@ -262,26 +262,26 @@ jobs:
262262
/usr/local/bin/wait-for localhost:8000 -- echo "Datatracker ready"
263263
264264
- name: Run all tests
265+
env:
266+
HOME: ""
265267
run: |
268+
echo "Installing dependencies..."
269+
yarn
270+
echo "Installing Playwright..."
271+
cd playwright
272+
mkdir test-results
273+
npm ci
274+
npx playwright install --with-deps ${{ matrix.project }}
266275
echo "Running tests..."
267-
yarn cypress:legacy
276+
npx playwright test --project=${{ matrix.project }} -c playwright-legacy.config.js
268277
269-
- name: Upload Video Recordings
270-
uses: actions/upload-artifact@v3
271-
if: ${{ always() }}
272-
continue-on-error: true
273-
with:
274-
name: videos-legacy
275-
path: cypress/videos/
276-
if-no-files-found: ignore
277-
278-
- name: Upload Screenshots
278+
- name: Upload Report
279279
uses: actions/upload-artifact@v3
280280
if: ${{ always() }}
281281
continue-on-error: true
282282
with:
283-
name: screenshots-modern
284-
path: cypress/screenshots/
283+
name: playwright-legacy-results-${{ matrix.project }}
284+
path: playwright/test-results/
285285
if-no-files-found: ignore
286286

287287
# -----------------------------------------------------------------
@@ -290,7 +290,7 @@ jobs:
290290
release:
291291
name: Make Release
292292
if: ${{ always() }}
293-
needs: [tests-python, tests-playwright, tests-cypress, prepare]
293+
needs: [tests-python, tests-playwright, tests-playwright-legacy, prepare]
294294
runs-on: ubuntu-latest
295295
env:
296296
SHOULD_DEPLOY: ${{needs.prepare.outputs.should_deploy}}

.github/workflows/ci-run-tests.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,67 @@ jobs:
110110
name: playwright-results-${{ matrix.project }}
111111
path: playwright/test-results/
112112
if-no-files-found: ignore
113+
114+
tests-playwright-legacy:
115+
name: Run Tests (Playwright Legacy)
116+
runs-on: ubuntu-latest
117+
container: ghcr.io/ietf-tools/datatracker-app-base:latest
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
project: [chromium, firefox]
122+
123+
services:
124+
db:
125+
image: ghcr.io/ietf-tools/datatracker-db:latest
126+
volumes:
127+
- mariadb-data:/var/lib/mysql
128+
env:
129+
MYSQL_ROOT_PASSWORD: ietf
130+
MYSQL_DATABASE: ietf_utf8
131+
MYSQL_USER: django
132+
MYSQL_PASSWORD: RkTkDPFnKpko
133+
134+
steps:
135+
- uses: actions/checkout@v3
136+
137+
- name: Prepare for tests
138+
run: |
139+
chmod +x ./dev/tests/prepare.sh
140+
sh ./dev/tests/prepare.sh
141+
142+
- name: Ensure DB is ready
143+
run: |
144+
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
145+
146+
- name: Start Datatracker
147+
run: |
148+
echo "Running checks..."
149+
./ietf/manage.py check
150+
echo "Starting datatracker..."
151+
./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local &
152+
echo "Waiting for datatracker to be ready..."
153+
/usr/local/bin/wait-for localhost:8000 -- echo "Datatracker ready"
154+
155+
- name: Run all tests
156+
env:
157+
HOME: ""
158+
run: |
159+
echo "Installing dependencies..."
160+
yarn
161+
echo "Installing Playwright..."
162+
cd playwright
163+
mkdir test-results
164+
npm ci
165+
npx playwright install --with-deps ${{ matrix.project }}
166+
echo "Running tests..."
167+
npx playwright test --project=${{ matrix.project }} -c playwright-legacy.config.js
168+
169+
- name: Upload Report
170+
uses: actions/upload-artifact@v3
171+
if: ${{ always() }}
172+
continue-on-error: true
173+
with:
174+
name: playwright-legacy-results-${{ matrix.project }}
175+
path: playwright/test-results/
176+
if-no-files-found: ignore

0 commit comments

Comments
 (0)