mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(testrunner): dedup focused tests and suites by id (#1393)
This commit is contained in:
parent
e7eeefe4c7
commit
5816ec53f7
@ -48,14 +48,25 @@ class Reporter {
|
|||||||
} else {
|
} else {
|
||||||
console.log(`Running ${colors.yellow(runnableTests.length)} focused tests out of total ${colors.yellow(allTests.length)} on ${colors.yellow(this._runner.parallel())} worker${this._runner.parallel() > 1 ? 's' : ''}`);
|
console.log(`Running ${colors.yellow(runnableTests.length)} focused tests out of total ${colors.yellow(allTests.length)} on ${colors.yellow(this._runner.parallel())} worker${this._runner.parallel() > 1 ? 's' : ''}`);
|
||||||
console.log('');
|
console.log('');
|
||||||
const focusedSuites = this._runner.focusedSuites();
|
const focusedSuites = this._runner.focusedSuites().map(suite => ({
|
||||||
const focusedTests = this._runner.focusedTests();
|
id: suite.location.filePath + ':' + suite.location.lineNumber + ':' + suite.location.columnNumber,
|
||||||
if (focusedSuites.length || focusedTests.length) {
|
fullName: suite.fullName,
|
||||||
|
location: suite.location,
|
||||||
|
}));
|
||||||
|
const focusedTests = this._runner.focusedTests().map(test => ({
|
||||||
|
id: test.location.filePath + ':' + test.location.lineNumber + ':' + test.location.columnNumber,
|
||||||
|
fullName: test.fullName,
|
||||||
|
location: test.location,
|
||||||
|
}));
|
||||||
|
const focusedEntities = new Map([
|
||||||
|
...focusedSuites.map(suite => ([suite.id, suite])),
|
||||||
|
...focusedTests.map(test => ([test.id, test])),
|
||||||
|
]);
|
||||||
|
if (focusedEntities.size) {
|
||||||
console.log('Focused Suites and Tests:');
|
console.log('Focused Suites and Tests:');
|
||||||
for (let i = 0; i < focusedSuites.length; ++i)
|
const entities = [...focusedEntities.values()];
|
||||||
console.log(` ${i + 1}) ${focusedSuites[i].fullName} (${formatLocation(focusedSuites[i].location)})`);
|
for (let i = 0; i < entities.length; ++i)
|
||||||
for (let i = 0; i < focusedTests.length; ++i)
|
console.log(` ${i + 1}) ${entities[i].fullName} (${formatLocation(entities[i].location)})`);
|
||||||
console.log(` ${i + 1 + focusedSuites.length}) ${focusedTests[i].fullName} (${formatLocation(focusedTests[i].location)})`);
|
|
||||||
console.log('');
|
console.log('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user