playwright/tests
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
..
android test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
assets feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
chromium test(chromium): ensure that arguments can be passed with spaces (#10057) 2021-11-23 02:59:56 -05:00
config feat(proxy): unify local network proxy behavior (#10719) 2021-12-10 14:01:56 -08:00
electron fix(electron): make recordVideo work (#10810) 2021-12-08 17:34:50 -08:00
emulation-focus.spec.ts-snapshots test: roll to folio@0.4.0-alpha28 (#6918) 2021-06-04 20:54:58 -07:00
firefox test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
inspector fix(inspector): do not show internal calls (#10982) 2021-12-16 17:17:24 -08:00
page test: unflake page-click.spec.ts test (#11050) 2021-12-21 17:31:13 -08:00
playwright-test fix(html reporter): fix too much strikethrough in diffs (#11115) 2021-12-28 09:56:34 -08:00
screenshot.spec.ts-snapshots test: add screenshot test with hanging main resource (#9972) 2021-11-02 16:55:32 +01:00
trace-viewer test: mark trace-viewer tests as slow, unflake resource order (#11070) 2021-12-22 11:17:43 -08:00
beforeunload.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
browser.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-add-cookies.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
browsercontext-add-init-script.spec.ts test: roll to folio@0.4.0-alpha3 (#6262) 2021-04-29 11:11:32 -07:00
browsercontext-base-url.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
browsercontext-basic.spec.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
browsercontext-clearcookies.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-cookies.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
browsercontext-credentials.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-csp.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-device.spec.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
browsercontext-dsf.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-expose-function.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-fetch.spec.ts feat(expext): toBeOK for APIResponse (#10596) 2021-11-30 18:12:19 -08:00
browsercontext-locale.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-network-event.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-page-event.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-pages.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-proxy.spec.ts feat(proxy): unify local network proxy behavior (#10719) 2021-12-10 14:01:56 -08:00
browsercontext-route.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
browsercontext-set-extra-http-headers.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-storage-state.spec.ts fix: support cookies with empty value (#9376) 2021-10-07 15:37:47 -07:00
browsercontext-strict.spec.ts fix: strict mode on page.* methods on context level (#8324) 2021-08-19 23:08:28 +02:00
browsercontext-timezone-id.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-user-agent.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-viewport-mobile.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
browsercontext-viewport.spec.ts test: newContext works when both screen and viewport specified (#9520) 2021-10-18 10:45:47 -07:00
browsertype-basic.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
browsertype-connect.spec.ts feat(tracing): pack sources to trace on the driver side (#10815) 2021-12-09 17:21:17 -08:00
browsertype-launch-selenium.spec.ts test: move grid tests to installation-tests (#10418) 2021-11-18 15:32:09 -08:00
browsertype-launch-server.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
browsertype-launch.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
capabilities.spec.ts test: can open page with mp4 video (#11030) 2021-12-20 12:44:06 -08:00
channels.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
component-parser.spec.ts fix(monorepo): explicitly list package.json exports instead of using glob patterns (#9584) 2021-10-19 12:28:02 -04:00
css-parser.spec.ts fix(monorepo): explicitly list package.json exports instead of using glob patterns (#9584) 2021-10-19 12:28:02 -04:00
defaultbrowsercontext-1.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
defaultbrowsercontext-2.spec.ts feat(chromium): roll to r950899 (#10930) 2021-12-15 11:23:01 -08:00
download.spec.ts feat(acceptDownload): revert acceptDownload (#10709) 2021-12-06 09:25:24 -08:00
downloads-path.spec.ts feat(acceptDownload): revert acceptDownload (#10709) 2021-12-06 09:25:24 -08:00
emulation-focus.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
favicon.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
geolocation.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
global-fetch-cookie.spec.ts chore(fetch): rename ApiRequest* to APIRequest* (#9606) 2021-10-19 07:38:27 -07:00
global-fetch.spec.ts fix(fetch): basic authentication without realm (#10979) 2021-12-16 13:40:52 -08:00
har.spec.ts fix: use HTTP/2.0 instead of h2 as Response.httpVersion (#10812) 2021-12-10 11:24:52 -08:00
headful.spec.ts feat(firefox-beta): roll to r1310 (#10954) 2021-12-15 17:33:09 -08:00
hit-target.spec.ts test: add a test for clicking on material ui select (#10652) 2021-12-01 15:14:28 -08:00
ignorehttpserrors.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
index.d.ts test: added tests for WebSocket over Socks proxy (#7235) 2021-06-24 18:50:16 +02:00
launcher.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
logger.spec.ts chore(zones): prepare to remove wrapApiCall, introduce zones (#10427) 2021-11-18 22:30:09 -08:00
modernizr.spec.ts feat(webkit): roll to r1578 (#10323) 2021-11-15 08:43:51 -08:00
pdf.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
permissions.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
popup.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
port-forwarding-server.spec.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
proxy.spec.ts feat(proxy): unify local network proxy behavior (#10719) 2021-12-10 14:01:56 -08:00
resource-timing.spec.ts test: roll to folio@0.4.0-alpha3 (#6262) 2021-04-29 11:11:32 -07:00
screenshot.spec.ts chore(chromium): Capture off-screen content without resizing viewport (#10606) 2021-11-30 14:11:15 -08:00
selector-generator.spec.ts chore: escape CSS selectors in codegen correctly (#10608) 2021-11-30 21:13:41 +01:00
selectors-register.spec.ts chore(zones): prepare to remove wrapApiCall, introduce zones (#10427) 2021-11-18 22:30:09 -08:00
signals.spec.ts fix: do not show taskkill.exe output (#10244) 2021-11-11 18:32:22 +01:00
slowmo.spec.ts chore: enable object-curly-spacing in ESLint (#9168) 2021-09-27 18:58:08 +02:00
snapshotter.spec.ts fix(tracing): trace frame (#10846) 2021-12-17 10:43:19 -08:00
tap.spec.ts fix(click): revert layout shift logic (#10653) 2021-12-01 12:54:20 -08:00
tracing.spec.ts test(tracing): skip test in ff and wk (#10955) 2021-12-15 17:40:34 -08:00
tsconfig.json fix: support even older node 12 (#9718) 2021-10-22 15:59:52 -04:00
video.spec.ts test: entire viewport is captured on hidpi (#10813) 2021-12-08 18:13:12 -08:00
web-socket.spec.ts test: unflake some websocket tests (#11069) 2021-12-22 11:17:34 -08:00