@dxos/test-utils 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/playwright.mjs +37 -19
- package/dist/lib/browser/playwright.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/playwright.mjs +37 -19
- package/dist/lib/node-esm/playwright.mjs.map +3 -3
- package/dist/types/src/lock.d.ts.map +1 -1
- package/dist/types/src/playwright.d.ts.map +1 -1
- package/dist/types/src/resource.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -12
- package/src/playwright.ts +25 -4
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/test-utils",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "Test utilities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"type": "module",
|
|
@@ -20,25 +24,18 @@
|
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
"types": "dist/types/src/index.d.ts",
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {
|
|
25
|
-
"playwright": [
|
|
26
|
-
"dist/types/src/playwright.d.ts"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
27
|
"files": [
|
|
31
28
|
"dist",
|
|
32
29
|
"src"
|
|
33
30
|
],
|
|
34
31
|
"dependencies": {
|
|
35
|
-
"@playwright/test": "
|
|
32
|
+
"@playwright/test": "1.57.0",
|
|
36
33
|
"pkg-up": "^3.1.0",
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
34
|
+
"@dxos/node-std": "0.8.4-main.dfabb4ec29",
|
|
35
|
+
"@dxos/async": "0.8.4-main.dfabb4ec29"
|
|
39
36
|
},
|
|
40
37
|
"peerDependencies": {
|
|
41
|
-
"vitest": "
|
|
38
|
+
"vitest": "4.1.5"
|
|
42
39
|
},
|
|
43
40
|
"publishConfig": {
|
|
44
41
|
"access": "public"
|
package/src/playwright.ts
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable no-console */
|
|
6
6
|
|
|
7
|
+
import { type Browser, type BrowserContext, type Page, type PlaywrightTestConfig, devices } from '@playwright/test';
|
|
7
8
|
import { existsSync, readFileSync } from 'node:fs';
|
|
8
9
|
import { dirname, join, resolve } from 'node:path';
|
|
9
|
-
|
|
10
|
-
import { type Browser, type BrowserContext, type Page, type PlaywrightTestConfig } from '@playwright/test';
|
|
11
10
|
import pkgUp from 'pkg-up';
|
|
12
11
|
|
|
13
12
|
import { Lock } from './lock';
|
|
@@ -51,6 +50,24 @@ export const e2ePreset = (testDir: string): PlaywrightTestConfig => {
|
|
|
51
50
|
const testResultOuputDir = join(workspaceRoot, 'test-results/playwright/output', packageDirName);
|
|
52
51
|
const reporterOutputFile = join(workspaceRoot, 'test-results/playwright/report', `${packageDirName}.json`);
|
|
53
52
|
|
|
53
|
+
const browser = process.env.PLAYWRIGHT_BROWSER || (process.env.CI ? 'all' : 'chromium');
|
|
54
|
+
const projects = [
|
|
55
|
+
{
|
|
56
|
+
name: 'chromium',
|
|
57
|
+
use: { ...devices['Desktop Chrome'] },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'firefox',
|
|
61
|
+
use: { ...devices['Desktop Firefox'] },
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'webkit',
|
|
65
|
+
use: { ...devices['Desktop Safari'] },
|
|
66
|
+
},
|
|
67
|
+
].filter((project) => {
|
|
68
|
+
return browser === 'all' || project.name === browser;
|
|
69
|
+
});
|
|
70
|
+
|
|
54
71
|
return {
|
|
55
72
|
testDir,
|
|
56
73
|
outputDir: testResultOuputDir,
|
|
@@ -58,10 +75,12 @@ export const e2ePreset = (testDir: string): PlaywrightTestConfig => {
|
|
|
58
75
|
fullyParallel: true,
|
|
59
76
|
// Fail the build on CI if you accidentally left test.only in the source code.
|
|
60
77
|
forbidOnly: !!process.env.CI,
|
|
61
|
-
// Retry on CI
|
|
78
|
+
// Retry on CI to ride out the residual d&d / startup flakes while the
|
|
79
|
+
// underlying causes are still being chased. Local runs stay strict so
|
|
80
|
+
// flakes are visible while iterating.
|
|
62
81
|
retries: process.env.CI ? 2 : 0,
|
|
63
82
|
// Opt out of parallel tests on CI.
|
|
64
|
-
workers: process.env.CI ? 1 :
|
|
83
|
+
workers: process.env.CI ? 1 : 4,
|
|
65
84
|
// Reporter to use. See https://playwright.dev/docs/test-reporters.
|
|
66
85
|
reporter: process.env.CI
|
|
67
86
|
? [
|
|
@@ -72,11 +91,13 @@ export const e2ePreset = (testDir: string): PlaywrightTestConfig => {
|
|
|
72
91
|
outputFile: reporterOutputFile,
|
|
73
92
|
},
|
|
74
93
|
],
|
|
94
|
+
['junit', { outputFile: reporterOutputFile.replace(/\.json$/, '.xml') }],
|
|
75
95
|
]
|
|
76
96
|
: [['list']],
|
|
77
97
|
use: {
|
|
78
98
|
trace: 'retain-on-failure',
|
|
79
99
|
},
|
|
100
|
+
projects,
|
|
80
101
|
};
|
|
81
102
|
};
|
|
82
103
|
|