playwright/tests/playwright-test
Ross Wollman dadb5cbc30
fix(html reporter): fix too much strikethrough in diffs (#11115)
Textual snapshot diffs were previously broken in the HTML Report. The strikethrough'd text extended beyond the intended region.

HTML Report Before: 
<img width="693" alt="Screen Shot 2021-12-27 at 4 43 35 PM" src="https://user-images.githubusercontent.com/11915034/147518750-a60f9002-6eed-48a1-a412-20fabd076fa6.png">

HTML Report After:
<img width="206" alt="Screen Shot 2021-12-27 at 4 48 37 PM" src="https://user-images.githubusercontent.com/11915034/147518762-19a4c8f9-ccc3-4a3c-a962-5a42edc6fc5d.png">

This now matches what's expected and shown in the terminal (which has always been correct):

<img width="1384" alt="Screen Shot 2021-12-27 at 4 36 29 PM" src="https://user-images.githubusercontent.com/11915034/147518799-f538259e-5a45-4d6f-916c-a12ccb620c5b.png">

NB: This MR is a workaround, but not a root cause fix. It works, but I never fully got to the root cause so a bug upstream may be required. It's unclear whether it's (1) in [`colors`](https://www.npmjs.com/package/colors), (2) in [`ansi-to-html`](https://www.npmjs.com/package/ansi-to-html), or (3) Playwright's use of the two. Since the terminal output is correct, I suspect it is in `ansi-to-html`. For example:

```js
const colors = require("colors");
const Convert = require('ansi-to-html');
const convert = new Convert();

// original (strike incorrectly wraps everything in the HTML)
console.log(convert.toHtml(colors.strikethrough("crossed out") + ' ' + colors.red("red")))
// prints: <strike>crossed out <span style="color:#A00">red<span style="color:#FFF"></span></span></strike>

// workaround
console.log(convert.toHtml(colors.reset(colors.strikethrough("crossed out")) + ' ' + colors.red("red")))
// prints: <strike>crossed out</strike> <span style="color:#A00">red<span style="color:#FFF"></span></span>
```

Fixes #11116
2021-12-28 09:56:34 -08:00
..
assets chore: add blink-diff third party library (#10984) 2021-12-17 15:53:37 -08:00
stable-test-runner chore: roll stable-test-runner to dec-18-2021 (#11008) 2021-12-18 10:12:35 -08:00
access-data.spec.ts feat(test-runner): introduce attachments (#7685) 2021-07-16 13:48:37 -07:00
basic.spec.ts feat(test runner): allow top-level test.fixme similar to test.skip (#10250) 2021-11-19 11:40:40 -08:00
blink-diff.spec.ts chore: add blink-diff third party library (#10984) 2021-12-17 15:53:37 -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 feat(test-runner): specific playwright types for expect (#10670) 2021-12-13 13:42:36 -05:00
fixture-errors.spec.ts fix(fixtures): await fixture teardown when shutting down the worker (#11033) 2021-12-20 16:19:21 -08: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 fix(html reporter): fix too much strikethrough in diffs (#11115) 2021-12-28 09:56:34 -08:00
hooks.spec.ts fix(test runner): show the location of afterAll timeout (#11007) 2021-12-18 09:32:41 -08:00
list-mode.spec.ts chore: add npm run lint-tests (#10252) 2021-11-11 13:27:50 -08:00
loader.spec.ts feat(esm): introduce experimental PW_EXPERIMENTAL_TS_ESM option (#10519) 2021-11-24 14:17:01 -08:00
match-grep.spec.ts test(test-runner): add tests to show that grep is case insensitive (#8091) 2021-08-09 14:05:51 -04:00
max-failures.spec.ts chore(test runner): create TestResult instances lazily in dispatcher (#10921) 2021-12-14 14:10:56 -08:00
override-timeout.spec.ts test(test-runner): unflake override-timeout.spec.ts (#7869) 2021-07-29 13:34:46 -07:00
playwright-test-fixtures.ts chore: roll stable-test-runner to dec-18-2021 (#11008) 2021-12-18 10:12:35 -08:00
playwright-test.config.ts chore: introduce docker integration dogfood (#9998) 2021-11-03 15:26:18 -07:00
playwright.artifacts.spec.ts feat(test runner): save traces for beforeAll/afterAll hooks (#10950) 2021-12-15 16:06:10 -08: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 feat(inputValue): allow on labels, retarget (#10666) 2021-12-02 10:31:06 -08:00
playwright.expect.true.spec.ts feat(toBeChecked): allow passing checked: false (#10665) 2021-12-02 10:31:26 -08:00
playwright.fetch.spec.ts test: add missing request tests (#9343) 2021-10-06 10:15:13 -07:00
playwright.spec.ts fix(test-runner): apply default options to all browserTypes (#10507) 2021-11-29 12:21:15 -05: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): fix too much strikethrough in diffs (#11115) 2021-12-28 09:56:34 -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(reporters): show retry #x when running a test (#11003) 2021-12-17 21:07:04 -08:00
reporter-list.spec.ts feat(reporters): show retry #x when running a test (#11003) 2021-12-17 21:07:04 -08:00
reporter-raw.spec.ts fix(html): render text attachments as text (#10778) 2021-12-08 08:51:44 -08:00
reporter.spec.ts feat(test runner): show beforeAll/afterAll hooks similar to tests (#10923) 2021-12-15 10:39:49 -08:00
resolver.spec.ts feat(tsconfig): respect baseUrl and paths from tsconfig (#10525) 2021-12-08 22:43:00 -08:00
retry.spec.ts feat(test runner): show beforeAll/afterAll hooks similar to tests (#10923) 2021-12-15 10:39:49 -08: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 fix(test runner): disallow use(workerFixture) in describes (#8119) 2021-08-10 16:32:32 -07:00
stdio.spec.ts feat(test runner): show beforeAll/afterAll hooks similar to tests (#10923) 2021-12-15 10:39:49 -08: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 feat(test.info): expose information on the currently running test (#10708) 2021-12-06 09:25:11 -08:00
test-modifiers.spec.ts fix(test runner): show the location of afterAll timeout (#11007) 2021-12-18 09:32:41 -08:00
test-output-dir.spec.ts feat(test-runner): shorten long output paths (#10523) 2021-12-13 10:56:03 -08: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 fix(test runner): test.setTimeout whould not break debugging (#11004) 2021-12-17 15:17:48 -08:00
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 test: using custom baseURL with webServer (#10539) 2021-11-29 17:41:26 +01:00
worker-index.spec.ts feat(test runner): introduce TestInfo.parallelIndex (#9762) 2021-11-01 10:37:34 -07:00