Skip to content

Commit 855f740

Browse files
authored
feat(report): supports playwright test report generation (#15)
* chore: collect playwright test data * feat: init * feat(visualizer-report): add visualizer-report project * feat(visualizer-report): add visualizer-report project * chore: add report test data * chore: add report test data * chore: optimize generate playwright test data * chore: optimize report logic * chore: optimize report logic * chore: optimize report logic * chore: optimize report logic * chore: optimize report logic * chore(cd): ignore unless code * chore: modify test command * chore: optimize sidebar content * chore: optimize report logic
1 parent beeebba commit 855f740

Some content is hidden

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

43 files changed

+4353
-219
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ output_resource
8686
tsconfig.tsbuildinfo
8787

8888
.temp
89+
.output
8990

9091
# emo infraDir: ''
9192

@@ -97,7 +98,7 @@ playwright/.cache/
9798

9899
# MidScene.js dump files
99100
midscene_run/
100-
101+
midscene-report/
101102
__ai_responses__/
102103

103104

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"[javascript]": {
1515
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
1616
},
17-
"editor.formatOnSave": true,
1817
"editor.formatOnSaveMode": "modifications",
1918
"[less]": {
2019
"editor.defaultFormatter": "esbenp.prettier-vscode"

packages/midscene/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"main": "./dist/lib/index.js",
77
"module": "./dist/es/index.js",
88
"types": "./dist/types/index.d.ts",
9+
"files": [
10+
"dist",
11+
"README.md"
12+
],
913
"exports": {
1014
".": {
1115
"types": "./dist/types/index.d.ts",

packages/playwright-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"devDependencies": {
2020
"@modern-js/module-tools": "2.56.1",
2121
"@modern-js/plugin-testing": "2.56.1",
22-
"@playwright/test": "^1.44.1",
22+
"@playwright/test": "1.44.1",
2323
"@types/jest": "~29.2.4",
2424
"@types/node": "~16.11.7",
2525
"eslint-plugin-prettier": "~4.2.1",

packages/playwright-demo/playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export default defineConfig({
1515
/* Run tests in files in parallel */
1616
fullyParallel: true,
1717
/* Fail the build on CI if you accidentally left test.only in the source code. */
18-
forbidOnly: !!process.env.CI,
18+
forbidOnly: Boolean(process.env.CI),
1919
/* Retry on CI only */
2020
retries: process.env.CI ? 2 : 0,
2121
/* Opt out of parallel tests on CI. */
2222
workers: process.env.CI ? 1 : undefined,
2323
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
24-
reporter: 'html',
24+
reporter: '@midscene/web/playwright-report',
2525
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2626
use: {
2727
/* Base URL to use in actions like `await page.goto('/')`. */
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
chrome >= 51
2+
edge >= 15
3+
firefox >= 54
4+
safari >= 10
5+
ios_saf >= 10

packages/visualizer-report/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Modern.js App
2+
3+
## Setup
4+
5+
Install the dependencies:
6+
7+
```bash
8+
pnpm install
9+
```
10+
11+
## Get Started
12+
13+
Start the dev server:
14+
15+
```bash
16+
pnpm dev
17+
```
18+
19+
Enable optional features or add a new entry:
20+
21+
```bash
22+
pnpm new
23+
```
24+
25+
Build the app for production:
26+
27+
```bash
28+
pnpm build
29+
```
30+
31+
Preview the production build locally:
32+
33+
```bash
34+
pnpm serve
35+
```
36+
37+
For more information, see the [Modern.js documentation](https://modernjs.dev/en).

packages/visualizer-report/config/public/playwright-31de72c0afc13db9dc09-00e11f768b63da0c779a.web-dump.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

packages/visualizer-report/config/public/playwright-31de72c0afc13db9dc09-50c9ddc9a1d0c466547f.web-dump.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

packages/visualizer-report/config/public/playwright-45161835cecba6378a04-b2821fd5751102caa08c.web-dump.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)