mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(testrunner): report tests as passed in the trial-run mode (#3654)
This commit is contained in:
parent
06154060a2
commit
efd45f8b51
@ -58,6 +58,7 @@ class JSONReporter extends BaseReporter {
|
|||||||
|
|
||||||
private _serializeTestResult(result: TestResult): any {
|
private _serializeTestResult(result: TestResult): any {
|
||||||
return {
|
return {
|
||||||
|
status: result.status,
|
||||||
duration: result.duration,
|
duration: result.duration,
|
||||||
error: result.error,
|
error: result.error,
|
||||||
stdout: result.stdout.map(s => stdioEntry(s)),
|
stdout: result.stdout.map(s => stdioEntry(s)),
|
||||||
|
@ -170,12 +170,14 @@ export class TestRunner extends EventEmitter {
|
|||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
try {
|
try {
|
||||||
const testInfo = { config: this._config, test, result };
|
const testInfo = { config: this._config, test, result };
|
||||||
await this._runHooks(test.suite, 'beforeEach', 'before', testInfo);
|
|
||||||
if (!this._trialRun) {
|
if (!this._trialRun) {
|
||||||
|
await this._runHooks(test.suite, 'beforeEach', 'before', testInfo);
|
||||||
const timeout = test.slow ? this._timeout * 3 : this._timeout;
|
const timeout = test.slow ? this._timeout * 3 : this._timeout;
|
||||||
await fixturePool.runTestWithFixtures(test.fn, timeout, testInfo);
|
await fixturePool.runTestWithFixtures(test.fn, timeout, testInfo);
|
||||||
|
await this._runHooks(test.suite, 'afterEach', 'after', testInfo);
|
||||||
|
} else {
|
||||||
|
result.status = 'passed';
|
||||||
}
|
}
|
||||||
await this._runHooks(test.suite, 'afterEach', 'after', testInfo);
|
|
||||||
result.duration = Date.now() - startTime;
|
result.duration = Date.now() - startTime;
|
||||||
this.emit('testEnd', { id, result });
|
this.emit('testEnd', { id, result });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user