playwright/tests/playwright-test
Ross Wollman 854f321532
feat(api): add explicit async testInfo.attach (#10121)
feat(api): add explicit async testInfo.attach

We add an explicit async API for attaching file paths (and Buffers) to
tests that can be awaited to help users ensure they are attaching files
that actually exist at both the time of the invocation and later when
reporters (like the HTML Reporter) run and package up test artifacts.

This is intended to help surface attachment issues as soon as possible
so you aren't silently left with a missing attachment
minutes/days/months later when you go to debug a suddenly breaking test
expecting an attachment to be there.

NB: The current implemntation incurs an extra file copy compared to
manipulating the raw attachments array. If users encounter performance
issues because of this, we can consider an option parameter that uses
rename under the hood instead of copy. However, that would need to be
used with care if the file were to be accessed later in the test.
2021-11-23 09:30:53 -08:00
..
assets
stable-test-runner chore: introduce docker integration dogfood (#9998) 2021-11-03 15:26:18 -07:00
access-data.spec.ts
basic.spec.ts feat(test runner): allow top-level test.fixme similar to test.skip (#10250) 2021-11-19 11:40:40 -08:00
config.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
exit-code.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
expect.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
fixture-errors.spec.ts feat(test runner): collect test error from worker teardown (#9190) 2021-09-28 10:56:50 -07:00
fixtures.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
gitignore.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
global-setup.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
golden.spec.ts feat: add `snapshotDir` to set base snapshot directory (#9260) 2021-11-02 08:02:49 -07:00
hooks.spec.ts feat(serial): better errors from beforeAll (#10419) 2021-11-18 14:36:55 -08:00
list-mode.spec.ts chore: add npm run lint-tests (#10252) 2021-11-11 13:27:50 -08:00
loader.spec.ts fix(test runner): better error message when importing typescript from esmodule (#10061) 2021-11-08 16:25:40 -05:00
match-grep.spec.ts
max-failures.spec.ts
override-timeout.spec.ts
playwright-test-fixtures.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
playwright-test.config.ts chore: introduce docker integration dogfood (#9998) 2021-11-03 15:26:18 -07:00
playwright.artifacts.spec.ts fix(trace): do not call tracing.stopChunk() twice (#10054) 2021-11-04 21:08:42 -07:00
playwright.expect.misc.spec.ts feat(expect): show expect timeout in the error message (#10388) 2021-11-17 17:28:30 -08:00
playwright.expect.text.spec.ts chore(expect): simplify expect implementation (#9459) 2021-10-13 08:56:57 -07:00
playwright.expect.true.spec.ts test: add several toBeEnabled methods (#9821) 2021-10-27 16:12:54 -07:00
playwright.fetch.spec.ts test: add missing request tests (#9343) 2021-10-06 10:15:13 -07:00
playwright.spec.ts chore(zones): prepare to remove wrapApiCall, introduce zones (#10427) 2021-11-18 22:30:09 -08:00
playwright.trace.spec.ts feat(test-runner): allow specifying fine-grained trace options (#10147) 2021-11-08 15:39:58 -08:00
repeat-each.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
reporter-attachment.spec.ts feat(api): add explicit async testInfo.attach (#10121) 2021-11-23 09:30:53 -08:00
reporter-base.spec.ts chore(test runner): route runner errors through Reporter.onError (#10257) 2021-11-11 16:48:08 -08:00
reporter-dot.spec.ts feat(html): unhide html reporter (#9512) 2021-10-14 11:17:35 -07:00
reporter-github.spec.ts fix(github reporter): handle global onError (#10256) 2021-11-11 13:25:38 -08:00
reporter-html.spec.ts fix(html reporter): show missing attachments as warnings (#10400) 2021-11-17 18:03:13 -08:00
reporter-json.spec.ts feat(reporters): augment non-stdio reporters with dot/line (#10003) 2021-11-03 08:25:16 -07:00
reporter-junit.spec.ts feat(html): unhide html reporter (#9512) 2021-10-14 11:17:35 -07:00
reporter-line.spec.ts feat(html): unhide html reporter (#9512) 2021-10-14 11:17:35 -07:00
reporter-list.spec.ts feat(html): unhide html reporter (#9512) 2021-10-14 11:17:35 -07:00
reporter-raw.spec.ts feat(api): add explicit async testInfo.attach (#10121) 2021-11-23 09:30:53 -08:00
reporter.spec.ts fix(test runner): route more errors to reporter (#10263) 2021-11-12 06:47:41 -08:00
retry.spec.ts fix(reporters): move `Running X tests using Y workers` to reporters (#10014) 2021-11-03 11:17:23 -07:00
runner.spec.ts feat(test runner): rewrite dispatcher to avoid unneded stalls (#9629) 2021-10-22 11:10:37 -07:00
shard.spec.ts
stdio.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
test-extend.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
test-ignore.spec.ts test: improve child process utilities in tests (#9036) 2021-09-20 17:17:12 -07:00
test-info.spec.ts
test-modifiers.spec.ts feat(test runner): allow top-level test.fixme similar to test.skip (#10250) 2021-11-19 11:40:40 -08:00
test-output-dir.spec.ts chore(test-runner): make outputDir based on cwd instead of testDir (#9360) 2021-10-11 22:24:46 +02:00
test-parallel.spec.ts feat(test runner): describe.parallel (#8662) 2021-09-02 15:42:07 -07:00
test-serial.spec.ts fix(test runner): proper serial mode with beforeAll/afterAll failures (#9183) 2021-09-27 15:58:26 -07:00
test-step.spec.ts fix(stack): hide test runner stack frames (#9735) 2021-10-25 11:49:59 -07:00
test-use.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
timeout.spec.ts
types-2.spec.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
types.spec.ts Revert "feat(test-runner): allow parametrized tests that don't extend base (#9301)" 2021-10-11 17:32:31 +02:00
web-server.spec.ts chore: roll Electron to 12.2.1 (#9271) 2021-10-01 19:40:47 -07:00
worker-index.spec.ts feat(test runner): introduce TestInfo.parallelIndex (#9762) 2021-11-01 10:37:34 -07:00