Skip to content

Commit 48aafcd

Browse files
Playwright
1 parent 12e04c0 commit 48aafcd

File tree

27 files changed

+2806
-507
lines changed

27 files changed

+2806
-507
lines changed

.github/actions/docker-compose-app.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ services:
44
image: "ghcr.io/glpi-project/${PHP_IMAGE:-githubactions-php-apache:8.3}"
55
environment:
66
CODE_COVERAGE: "${CODE_COVERAGE:-false}"
7+
CI: true
8+
PLAYWRIGHT_BROWSERS_PATH: /opt/pw-browsers
79
volumes:
810
- type: "bind"
911
source: "${APPLICATION_ROOT}"

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,18 @@ jobs:
273273
with:
274274
name: cypress-screenshots
275275
path: tests/cypress/screenshots
276+
# Playwright specific steps
277+
- name: Install dependencies
278+
run: docker compose exec -T app npm ci
279+
- name: Install Playwright Browsers
280+
run: docker compose exec -T --user=root app sudo -E npx playwright install chromium --with-deps
281+
- name: Run type checks
282+
run: docker compose exec -T app npx tsc -p tsconfig.json --noEmit
283+
- name: Run Playwright tests
284+
run: docker compose exec -T app npx playwright test
285+
- uses: actions/upload-artifact@v4
286+
if: ${{ !cancelled() }}
287+
with:
288+
name: playwright-report
289+
path: playwright-report/
290+
retention-days: 30

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ phpstan.neon
4848
/phpunit/coverage/
4949
*.phar
5050
.env
51+
52+
# Playwright
53+
node_modules/
54+
/tests/playwright/test-results/
55+
/playwright-report/
56+
/blob-report/
57+
/playwright/.cache/
58+

eslint.config.mjs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import globals from "globals";
33
import vue from "eslint-plugin-vue";
44
import js from "@eslint/js";
55
import cypress from "eslint-plugin-cypress/flat";
6+
import playwright from 'eslint-plugin-playwright';
7+
import tsParser from "@typescript-eslint/parser";
68

79
export default [
810
{
@@ -19,10 +21,24 @@ export default [
1921
"public/lib/*",
2022
"tests/config/*",
2123
"vendor/*",
22-
"**/*.min.js"
24+
"**/*.min.js",
2325
],
2426
},
2527
js.configs.recommended,
28+
{
29+
files: ["tests/playwright/**/*.ts"],
30+
languageOptions: {
31+
parser: tsParser,
32+
parserOptions: {
33+
project: "./tsconfig.json",
34+
ecmaVersion: 'latest',
35+
sourceType: "module"
36+
},
37+
globals: {
38+
...globals.node,
39+
}
40+
},
41+
},
2642
{
2743
languageOptions: {
2844
ecmaVersion: 13,
@@ -161,5 +177,14 @@ export default [
161177
"rules": {
162178
"prefer-template": "off",
163179
}
180+
},
181+
{
182+
...playwright.configs['flat/recommended'],
183+
files: ['tests/playwright/**'],
184+
rules: {
185+
...playwright.configs['flat/recommended'].rules,
186+
"playwright/no-force-option": "error",
187+
"playwright/no-raw-locators": "error",
188+
},
164189
}
165190
];

0 commit comments

Comments
 (0)