playwright 1.46.0 → 1.46.1-beta-1723837512000
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/lib/runner/loadUtils.js +7 -6
- package/lib/runner/vcs.js +10 -0
- package/package.json +2 -2
- package/types/test.d.ts +2 -2
package/lib/runner/loadUtils.js
CHANGED
|
@@ -136,13 +136,13 @@ async function createRootSuite(testRun, errors, shouldFilterOnly, additionalFile
|
|
|
136
136
|
|
|
137
137
|
// Filter file suites for all projects.
|
|
138
138
|
for (const [project, fileSuites] of testRun.projectSuites) {
|
|
139
|
-
const
|
|
140
|
-
const projectSuite = createProjectSuite(project, filteredFileSuites);
|
|
139
|
+
const projectSuite = createProjectSuite(project, fileSuites);
|
|
141
140
|
projectSuites.set(project, projectSuite);
|
|
142
141
|
const filteredProjectSuite = filterProjectSuite(projectSuite, {
|
|
143
142
|
cliFileFilters,
|
|
144
143
|
cliTitleMatcher,
|
|
145
|
-
testIdMatcher: config.testIdMatcher
|
|
144
|
+
testIdMatcher: config.testIdMatcher,
|
|
145
|
+
additionalFileMatcher
|
|
146
146
|
});
|
|
147
147
|
filteredProjectSuites.set(project, filteredProjectSuite);
|
|
148
148
|
}
|
|
@@ -200,8 +200,8 @@ async function createRootSuite(testRun, errors, shouldFilterOnly, additionalFile
|
|
|
200
200
|
const projectClosure = new Map((0, _projectUtils.buildProjectsClosure)(rootSuite.suites.map(suite => suite._fullProject)));
|
|
201
201
|
|
|
202
202
|
// Clone file suites for dependency projects.
|
|
203
|
-
for (const project of projectClosure.
|
|
204
|
-
if (
|
|
203
|
+
for (const [project, level] of projectClosure.entries()) {
|
|
204
|
+
if (level === 'dependency') rootSuite._prependSuite(buildProjectSuite(project, projectSuites.get(project)));
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
return rootSuite;
|
|
@@ -220,12 +220,13 @@ function createProjectSuite(project, fileSuites) {
|
|
|
220
220
|
}
|
|
221
221
|
function filterProjectSuite(projectSuite, options) {
|
|
222
222
|
// Fast path.
|
|
223
|
-
if (!options.cliFileFilters.length && !options.cliTitleMatcher && !options.testIdMatcher) return projectSuite;
|
|
223
|
+
if (!options.cliFileFilters.length && !options.cliTitleMatcher && !options.testIdMatcher && !options.additionalFileMatcher) return projectSuite;
|
|
224
224
|
const result = projectSuite._deepClone();
|
|
225
225
|
if (options.cliFileFilters.length) (0, _suiteUtils.filterByFocusedLine)(result, options.cliFileFilters);
|
|
226
226
|
if (options.testIdMatcher) (0, _suiteUtils.filterByTestIds)(result, options.testIdMatcher);
|
|
227
227
|
(0, _suiteUtils.filterTestsRemoveEmptySuites)(result, test => {
|
|
228
228
|
if (options.cliTitleMatcher && !options.cliTitleMatcher(test._grepTitle())) return false;
|
|
229
|
+
if (options.additionalFileMatcher && !options.additionalFileMatcher(test.location.file)) return false;
|
|
229
230
|
return true;
|
|
230
231
|
});
|
|
231
232
|
return result;
|
package/lib/runner/vcs.js
CHANGED
|
@@ -34,6 +34,16 @@ async function detectChangedTestFiles(baseCommit, configDir) {
|
|
|
34
34
|
}).split('\n').filter(Boolean);
|
|
35
35
|
} catch (_error) {
|
|
36
36
|
const error = _error;
|
|
37
|
+
const unknownRevision = error.output.some(line => line === null || line === void 0 ? void 0 : line.includes('unknown revision'));
|
|
38
|
+
if (unknownRevision) {
|
|
39
|
+
const isShallowClone = _child_process.default.execSync('git rev-parse --is-shallow-repository', {
|
|
40
|
+
encoding: 'utf-8',
|
|
41
|
+
stdio: 'pipe'
|
|
42
|
+
}).trim() === 'true';
|
|
43
|
+
if (isShallowClone) {
|
|
44
|
+
throw new Error([`The repository is a shallow clone and does not have '${baseCommit}' available locally.`, `Note that GitHub Actions checkout is shallow by default: https://github.com/actions/checkout`].join('\n'));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
37
47
|
throw new Error([`Cannot detect changed files for --only-changed mode:`, `git ${command}`, '', ...error.output].join('\n'));
|
|
38
48
|
}
|
|
39
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright",
|
|
3
|
-
"version": "1.46.
|
|
3
|
+
"version": "1.46.1-beta-1723837512000",
|
|
4
4
|
"description": "A high-level API to automate web browsers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"license": "Apache-2.0",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"playwright-core": "1.46.
|
|
61
|
+
"playwright-core": "1.46.1-beta-1723837512000"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
64
|
"fsevents": "2.3.2"
|
package/types/test.d.ts
CHANGED
|
@@ -4815,9 +4815,9 @@ export type Fixtures<T extends KeyValue = {}, W extends KeyValue = {}, PT extend
|
|
|
4815
4815
|
} & {
|
|
4816
4816
|
[K in keyof PT]?: TestFixtureValue<PT[K], T & W & PT & PW> | [TestFixtureValue<PT[K], T & W & PT & PW>, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean }];
|
|
4817
4817
|
} & {
|
|
4818
|
-
[K in
|
|
4818
|
+
[K in keyof W]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
|
|
4819
4819
|
} & {
|
|
4820
|
-
[K in
|
|
4820
|
+
[K in keyof T]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
|
|
4821
4821
|
};
|
|
4822
4822
|
|
|
4823
4823
|
type BrowserName = 'chromium' | 'firefox' | 'webkit';
|