Skip to content

Commit 23773e9

Browse files
committed
test(playwright): add complete Grid.js Docs automation tests (Data, From, Server) and update Playwright config
1 parent 50d8227 commit 23773e9

8 files changed

Lines changed: 445 additions & 11 deletions

File tree

package-lock.json

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"start": "docusaurus start",
88
"build": "docusaurus build",
99
"swizzle": "docusaurus swizzle",
10-
"deploy": "docusaurus deploy"
10+
"deploy": "docusaurus deploy",
11+
12+
"test": "playwright test",
13+
"test:list": "playwright test --list",
14+
"test:ui": "playwright test --ui",
15+
"show-report": "playwright show-report"
1116
},
1217
"dependencies": {
1318
"@docusaurus/core": "^2.2.0",
@@ -25,18 +30,11 @@
2530
"react-dom": "^17.0.2"
2631
},
2732
"browserslist": {
28-
"production": [
29-
">0.2%",
30-
"not dead",
31-
"not op_mini all"
32-
],
33-
"development": [
34-
"last 1 chrome version",
35-
"last 1 firefox version",
36-
"last 1 safari version"
37-
]
33+
"production": [">0.2%","not dead","not op_mini all"],
34+
"development": ["last 1 chrome version","last 1 firefox version","last 1 safari version"]
3835
},
3936
"devDependencies": {
37+
"@playwright/test": "^1.56.1",
4038
"@types/faker": "^5.5.6"
4139
}
4240
}

playwright-report/index.html

Lines changed: 85 additions & 0 deletions
Large diffs are not rendered by default.

playwright.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/** @type {import('@playwright/test').PlaywrightTestConfig} */
2+
const config = {
3+
testDir: 'tests',
4+
testMatch: /.*\.js$/, // biar 01_Data.js ikut discan
5+
testIgnore: [],
6+
7+
timeout: 30_000,
8+
expect: { timeout: 10_000 },
9+
10+
use: {
11+
baseURL: process.env.BASE_URL || 'http://localhost:3000',
12+
headless: true,
13+
trace: 'retain-on-failure',
14+
screenshot: 'only-on-failure',
15+
video: 'off'
16+
},
17+
18+
projects: [
19+
{ name: 'chromium', use: { browserName: 'chromium' } }
20+
],
21+
22+
reporter: [['html', { open: 'never' }]]
23+
};
24+
module.exports = config;

test-results/.last-run.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"status": "passed",
3+
"failedTests": []
4+
}

0 commit comments

Comments
 (0)