mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
f753ec6b04
`testRunner.run()` might have 4 different outcomes: - `ok` - all non-skipped tests passed - `failed` - some tests failed or timed out - `terminated` - process received SIGHUP/SIGINT while testrunner was running tests. This happens on CI's under certain circumstances, e.g. when VM is getting re-scheduled. - `crashed` - testrunner terminated test execution due to either `UnhandledPromiseRejection` or some of the hooks (`beforeEach/afterEach/beforeAll/afterAll`) failures. As an implication, there are 2 new test results: `terminated` and `crashed`. All possible test results are: - `ok` - test worked just fine - `skipped` - test was skipped with `xit` - `timedout` - test timed out - `failed` - test threw an exception while running - `terminated` - testrunner got terminated while running this test - `crashed` - some `beforeEach` / `afterEach` hook corresponding to this test timed out of threw an exception. This patch changes a few parts of the testrunner API: - `testRunner.run()` now returns an object `{result: string, terminationError?: Error, terminationMessage?: string}` - the same object is dispatched via `testRunner.on('finished')` event - `testRunner.on('terminated')` got removed - tests now might have `crashed` and `terminated` results - `testRunner.on('teststarted')` dispatched before running all related `beforeEach` hooks, and `testRunner.on('testfinished')` dispatched after running all related `afterEach` hooks. |
||
---|---|---|
.. | ||
assets | ||
fixtures | ||
golden-chromium | ||
golden-firefox | ||
accessibility.spec.js | ||
browser.spec.js | ||
browsercontext.spec.js | ||
CDPSession.spec.js | ||
chromiumonly.spec.js | ||
click.spec.js | ||
cookies.spec.js | ||
coverage.spec.js | ||
dialog.spec.js | ||
diffstyle.css | ||
elementhandle.spec.js | ||
emulation.spec.js | ||
evaluation.spec.js | ||
fixtures.spec.js | ||
frame.spec.js | ||
golden-utils.js | ||
headful.spec.js | ||
ignorehttpserrors.spec.js | ||
input.spec.js | ||
jshandle.spec.js | ||
keyboard.spec.js | ||
launcher.spec.js | ||
mouse.spec.js | ||
navigation.spec.js | ||
network.spec.js | ||
oopif.spec.js | ||
page.spec.js | ||
puppeteer.spec.js | ||
queryselector.spec.js | ||
requestinterception.spec.js | ||
run_static_server.js | ||
screenshot.spec.js | ||
target.spec.js | ||
test.js | ||
touchscreen.spec.js | ||
tracing.spec.js | ||
utils.js | ||
waittask.spec.js | ||
worker.spec.js |