@dionlarson/playwright-orchestrator-core 1.3.4 → 1.3.6
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.
|
@@ -35,7 +35,11 @@ export class RunBuilder {
|
|
|
35
35
|
if (!file)
|
|
36
36
|
return false;
|
|
37
37
|
const fileTests = this.getFileTests(file);
|
|
38
|
-
|
|
38
|
+
// Handle undefined location (happens with file-level serial suites)
|
|
39
|
+
// Use '0:0' as a marker for "whole file" - test-runner will handle this
|
|
40
|
+
const line = entry.location?.line ?? 0;
|
|
41
|
+
const column = entry.location?.column ?? 0;
|
|
42
|
+
const position = `${line}:${column}`;
|
|
39
43
|
// Use position:title as key to support parameterized tests at same location
|
|
40
44
|
const key = `${position}:${entry.title}`;
|
|
41
45
|
if (fileTests[key]) {
|
package/dist/test-runner.js
CHANGED
|
@@ -73,7 +73,8 @@ export class TestRunner {
|
|
|
73
73
|
await mkdir(`./${this.outputFolder}`, { recursive: true });
|
|
74
74
|
}
|
|
75
75
|
async runTest(test, config) {
|
|
76
|
-
|
|
76
|
+
// Position 0:0 means file-level serial suite (undefined location) - run whole file
|
|
77
|
+
const testPosition = test.position === '0:0' ? test.file : `${test.file}:${test.position}`;
|
|
77
78
|
const testName = `[${test.project}] > ${testPosition}`;
|
|
78
79
|
const testHash = createHash('md5').update(testName).digest('hex');
|
|
79
80
|
const resultFile = `${this.outputFolder}/${testHash}.result.json`;
|
|
@@ -129,13 +130,22 @@ export class TestRunner {
|
|
|
129
130
|
async createTempConfig(file) {
|
|
130
131
|
if (!file)
|
|
131
132
|
return;
|
|
132
|
-
// Modify config: remove webServer, add our reporters
|
|
133
|
+
// Modify config: remove webServer, clear project dependencies, add our reporters
|
|
133
134
|
const content = `
|
|
134
135
|
import config from '${path.resolve(file)}';
|
|
135
136
|
|
|
136
137
|
// Remove webServer - not supported in orchestrator (server should already be running)
|
|
137
138
|
delete config.webServer;
|
|
138
139
|
|
|
140
|
+
// Clear project dependencies - setup projects should be run separately before orchestrator
|
|
141
|
+
// Each orchestrator test runs in a fresh playwright process, and we don't want
|
|
142
|
+
// setup projects re-running for every test
|
|
143
|
+
if (config.projects) {
|
|
144
|
+
for (const project of config.projects) {
|
|
145
|
+
project.dependencies = [];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
139
149
|
// Add our reporters while preserving existing reporters from config
|
|
140
150
|
const existingReporters = Array.isArray(config.reporter) ? config.reporter :
|
|
141
151
|
config.reporter ? [[config.reporter]] : [];
|