@dionlarson/playwright-orchestrator-core 1.3.6 → 1.3.8
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.
|
@@ -6,6 +6,7 @@ export default class TestResultReporter {
|
|
|
6
6
|
onBegin(config, suite) {
|
|
7
7
|
const tests = suite.allTests();
|
|
8
8
|
if (tests.length > 1) {
|
|
9
|
+
// Build path from first test to root
|
|
9
10
|
const path = [];
|
|
10
11
|
let current = tests[0].parent;
|
|
11
12
|
while (current) {
|
|
@@ -13,15 +14,19 @@ export default class TestResultReporter {
|
|
|
13
14
|
current = current.parent;
|
|
14
15
|
}
|
|
15
16
|
let lastCommonParent = path.length - 1;
|
|
17
|
+
// Find lowest common ancestor across all tests
|
|
16
18
|
for (const test of tests.slice(1)) {
|
|
17
19
|
current = test.parent;
|
|
18
|
-
|
|
20
|
+
// Walk up from this test's parent until we find one in path
|
|
21
|
+
while (current) {
|
|
19
22
|
const index = path.indexOf(current);
|
|
20
|
-
if (index !== -1
|
|
21
|
-
lastCommonParent
|
|
23
|
+
if (index !== -1) {
|
|
24
|
+
if (index < lastCommonParent) {
|
|
25
|
+
lastCommonParent = index;
|
|
26
|
+
}
|
|
22
27
|
break;
|
|
23
28
|
}
|
|
24
|
-
current = current
|
|
29
|
+
current = current.parent;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
this.commonParent = path[lastCommonParent];
|