From f21f47889efb58f69920704c297548cdd5e3531b Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Sun, 4 Apr 2021 19:32:14 -0700 Subject: [PATCH] test: migrate more page tests to folio (#6062) --- .github/workflows/tests.yml | 90 ++++---- .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin ...creenshot-element-larger-than-viewport.png | Bin ...creenshot-element-larger-than-viewport.png | Bin ...creenshot-element-larger-than-viewport.png | Bin ...creenshot-element-larger-than-viewport.png | Bin ...creenshot-element-larger-than-viewport.png | Bin ...creenshot-element-larger-than-viewport.png | Bin .../screenshot-element-scrolled-into-view.png | Bin .../screenshot-element-scrolled-into-view.png | Bin .../screenshot-element-scrolled-into-view.png | Bin .../screenshot-element-scrolled-into-view.png | Bin .../screenshot-element-scrolled-into-view.png | Bin .../screenshot-element-scrolled-into-view.png | Bin .../screenshot-element-padding-border.png | Bin .../screenshot-element-padding-border.png | Bin .../screenshot-element-padding-border.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-fractional-offset.png | Bin .../screenshot-element-fractional-offset.png | Bin .../screenshot-element-fractional-offset.png | Bin .../screenshot-element-fractional.png | Bin .../firefox/screenshot-element-fractional.png | Bin .../webkit/screenshot-element-fractional.png | Bin .../chromium/screenshot-element-mobile.png | Bin .../webkit/screenshot-element-mobile.png | Bin .../chromium/screenshot-element-rotate.png | Bin .../firefox/screenshot-element-rotate.png | Bin .../webkit/screenshot-element-rotate.png | Bin .../screenshot-element-mobile-dsf.png | Bin .../webkit/screenshot-element-mobile-dsf.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../screenshot-element-bounding-box.png | Bin .../chromium/grid-cell-0.png | Bin .../chromium/screenshot-sanity.png | Bin .../firefox/grid-cell-0.png | Bin .../firefox/screenshot-sanity.png | Bin .../webkit/grid-cell-0.png | Bin .../webkit/screenshot-sanity.png | Bin .../chromium/mock-binary-response.png | Bin .../firefox/mock-binary-response.png | Bin .../webkit/mock-binary-response.png | Bin .../chromium/mock-svg.png | Bin .../firefox/mock-svg.png | Bin .../webkit/mock-svg.png | Bin .../chromium/mock-binary-response.png | Bin .../firefox/mock-binary-response.png | Bin .../webkit/mock-binary-response.png | Bin .../chromium/screenshot-sanity.png | Bin .../firefox/screenshot-sanity.png | Bin .../webkit/screenshot-sanity.png | Bin .../chromium/white.jpg | Bin .../firefox/white.jpg | Bin .../webkit/white.jpg | Bin .../chromium/screenshot-sanity.png | Bin .../firefox/screenshot-sanity.png | Bin .../webkit/screenshot-sanity.png | Bin .../chromium/transparent.png | Bin .../webkit/transparent.png | Bin .../chromium/screenshot-offscreen-clip.png | Bin .../firefox/screenshot-offscreen-clip.png | Bin .../webkit/screenshot-offscreen-clip.png | Bin .../chromium/screenshot-clip-rect.png | Bin .../firefox/screenshot-clip-rect.png | Bin .../webkit/screenshot-clip-rect.png | Bin .../chromium/screenshot-clip-rect.png | Bin .../firefox/screenshot-clip-rect.png | Bin .../webkit/screenshot-clip-rect.png | Bin .../chromium/white.jpg | Bin .../firefox/white.jpg | Bin .../webkit/white.jpg | Bin .../chromium/grid-cell-0.png | Bin .../chromium/grid-cell-1.png | Bin .../firefox/grid-cell-0.png | Bin .../firefox/grid-cell-1.png | Bin .../webkit/grid-cell-0.png | Bin .../webkit/grid-cell-1.png | Bin .../chromium/grid-cell-1.png | Bin .../firefox/grid-cell-1.png | Bin .../webkit/grid-cell-1.png | Bin .../chromium/screenshot-grid-fullpage.png | Bin .../firefox/screenshot-grid-fullpage.png | Bin .../webkit/screenshot-grid-fullpage.png | Bin .../chromium/screenshot-canvas.png | Bin .../firefox/screenshot-canvas.png | Bin .../webkit/screenshot-canvas.png | Bin .../chromium/screenshot-translateZ.png | Bin .../firefox/screenshot-translateZ.png | Bin .../webkit/screenshot-translateZ.png | Bin .../chromium/screenshot-webgl.png | Bin .../webkit/screenshot-webgl.png | Bin .../chromium/screenshot-mobile-clip.png | Bin .../webkit/screenshot-mobile-clip.png | Bin .../chromium/screenshot-mobile-fullpage.png | Bin .../webkit/screenshot-mobile-fullpage.png | Bin .../chromium/screenshot-mobile.png | Bin .../webkit/screenshot-mobile.png | Bin .../screenshot-device-scale-factor.png | Bin .../screenshot-device-scale-factor.png | Bin .../webkit/screenshot-device-scale-factor.png | Bin .../chromium/screenshot-iframe.png | Bin .../firefox/screenshot-iframe.png | Bin .../webkit/screenshot-iframe.png | Bin .../chromium/screenshot-clip-odd-size.png | Bin .../firefox/screenshot-clip-odd-size.png | Bin .../webkit/screenshot-clip-odd-size.png | Bin .../chromium/screenshot-sanity.png | Bin .../should-work/firefox/screenshot-sanity.png | Bin .../should-work/webkit/screenshot-sanity.png | Bin tests/config/android.config.ts | 2 +- tests/config/androidEnv.ts | 10 +- tests/config/browserTest.ts | 1 + tests/config/default.config.ts | 3 +- tests/config/pageTest.ts | 1 + tests/config/playwrightTest.ts | 1 - .../elementhandle-bounding-box.spec.ts | 18 +- .../elementhandle-screenshot.spec.ts | 182 ++++++++-------- {test => tests}/emulation-focus.spec.ts | 14 +- tests/folio/src/dispatcher.ts | 24 ++- {test => tests}/frame-evaluate.spec.ts | 33 +-- {test => tests}/frame-frame-element.spec.ts | 4 +- {test => tests}/frame-goto.spec.ts | 6 +- {test => tests}/frame-hierarchy.spec.ts | 12 +- {test => tests}/interception.spec.ts | 24 ++- {test => tests}/network-post-data.spec.ts | 6 +- {test => tests}/page-accessibility.spec.ts | 24 ++- .../page-autowaiting-basic.spec.ts | 12 +- .../page-autowaiting-no-hang.spec.ts | 3 +- {test => tests}/page-basic.spec.ts | 8 +- tests/page-click-react.spec.ts | 2 +- {test => tests}/page-close.spec.ts | 5 +- {test => tests}/page-drag.spec.ts | 34 +-- {test => tests}/page-emulate-media.spec.ts | 13 +- {test => tests}/page-expose-function.spec.ts | 17 +- {test => tests}/page-focus.spec.ts | 22 +- {test => tests}/page-goto.spec.ts | 35 +++- {test => tests}/page-history.spec.ts | 9 +- {test => tests}/page-in-context.spec.ts | 22 +- {test => tests}/page-keyboard.spec.ts | 29 +-- {test => tests}/page-mouse.spec.ts | 11 +- {test => tests}/page-navigation.spec.ts | 2 +- {test => tests}/page-network-idle.spec.ts | 6 +- {test => tests}/page-network-request.spec.ts | 30 ++- {test => tests}/page-network-response.spec.ts | 6 +- {test => tests}/page-request-continue.spec.ts | 8 +- {test => tests}/page-request-fulfill.spec.ts | 50 +++-- tests/page-route.spec.ts | 6 +- {test => tests}/page-screenshot.spec.ts | 198 ++++++++++-------- tests/page-set-input-files.spec.ts | 2 + {test => tests}/queryselector.spec.ts | 2 +- {test => tests}/selectors-css.spec.ts | 2 +- {test => tests}/selectors-misc.spec.ts | 9 +- {test => tests}/selectors-register.spec.ts | 17 +- {test => tests}/selectors-text.spec.ts | 2 +- {test => tests}/slowmo.spec.ts | 13 +- {test => tests}/workers.spec.ts | 15 +- types/types.d.ts | 24 ++- 165 files changed, 613 insertions(+), 456 deletions(-) rename {test => tests}/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/chromium/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/firefox/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/webkit/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/chromium/screenshot-element-larger-than-viewport.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/firefox/screenshot-element-larger-than-viewport.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/webkit/screenshot-element-larger-than-viewport.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/chromium/screenshot-element-larger-than-viewport.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/firefox/screenshot-element-larger-than-viewport.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/webkit/screenshot-element-larger-than-viewport.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/chromium/screenshot-element-scrolled-into-view.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/firefox/screenshot-element-scrolled-into-view.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/webkit/screenshot-element-scrolled-into-view.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/chromium/screenshot-element-scrolled-into-view.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/firefox/screenshot-element-scrolled-into-view.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/webkit/screenshot-element-scrolled-into-view.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/chromium/screenshot-element-padding-border.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/firefox/screenshot-element-padding-border.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/webkit/screenshot-element-padding-border.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/chromium/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/firefox/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/webkit/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-wait-for-visible/chromium/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-wait-for-visible/firefox/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-wait-for-visible/webkit/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/chromium/screenshot-element-fractional-offset.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/firefox/screenshot-element-fractional-offset.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/webkit/screenshot-element-fractional-offset.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/chromium/screenshot-element-fractional.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/firefox/screenshot-element-fractional.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/webkit/screenshot-element-fractional.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-element-mobile.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-element-mobile.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/chromium/screenshot-element-rotate.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/firefox/screenshot-element-rotate.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/webkit/screenshot-element-rotate.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/chromium/screenshot-element-mobile-dsf.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/webkit/screenshot-element-mobile-dsf.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work/chromium/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work/firefox/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/elementhandle-screenshot/should-work/webkit/screenshot-element-bounding-box.png (100%) rename {test => tests}/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/grid-cell-0.png (100%) rename {test => tests}/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/grid-cell-0.png (100%) rename {test => tests}/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/grid-cell-0.png (100%) rename {test => tests}/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/chromium/mock-binary-response.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/firefox/mock-binary-response.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/webkit/mock-binary-response.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/chromium/mock-svg.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/firefox/mock-svg.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/webkit/mock-svg.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-work-with-file-path/chromium/mock-binary-response.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-work-with-file-path/firefox/mock-binary-response.png (100%) rename {test => tests}/__snapshots__/page-request-fulfill/should-work-with-file-path/webkit/mock-binary-response.png (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-create-subdirectories/chromium/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-create-subdirectories/firefox/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-create-subdirectories/webkit/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-detect-jpeg/chromium/white.jpg (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-detect-jpeg/firefox/white.jpg (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-detect-jpeg/webkit/white.jpg (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-work/chromium/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-work/firefox/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/path-option-should-work/webkit/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-allow-transparency/chromium/transparent.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-allow-transparency/webkit/transparent.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/chromium/screenshot-offscreen-clip.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/firefox/screenshot-offscreen-clip.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/webkit/screenshot-offscreen-clip.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/chromium/screenshot-clip-rect.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/firefox/screenshot-clip-rect.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/webkit/screenshot-clip-rect.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-rect/chromium/screenshot-clip-rect.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-rect/firefox/screenshot-clip-rect.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-clip-rect/webkit/screenshot-clip-rect.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/chromium/white.jpg (100%) rename {test => tests}/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/firefox/white.jpg (100%) rename {test => tests}/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/webkit/white.jpg (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-0.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-1.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-0.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-1.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-0.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-1.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel/chromium/grid-cell-1.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel/firefox/grid-cell-1.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-run-in-parallel/webkit/grid-cell-1.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-take-fullPage-screenshots/chromium/screenshot-grid-fullpage.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-take-fullPage-screenshots/firefox/screenshot-grid-fullpage.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-take-fullPage-screenshots/webkit/screenshot-grid-fullpage.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-canvas/chromium/screenshot-canvas.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-canvas/firefox/screenshot-canvas.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-canvas/webkit/screenshot-canvas.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-translateZ/chromium/screenshot-translateZ.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-translateZ/firefox/screenshot-translateZ.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-translateZ/webkit/screenshot-translateZ.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-webgl/chromium/screenshot-webgl.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-for-webgl/webkit/screenshot-webgl.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/chromium/screenshot-mobile-clip.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/webkit/screenshot-mobile-clip.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/chromium/screenshot-mobile-fullpage.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/webkit/screenshot-mobile-fullpage.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-mobile.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-mobile.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-device-scale-factor/chromium/screenshot-device-scale-factor.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-device-scale-factor/firefox/screenshot-device-scale-factor.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-device-scale-factor/webkit/screenshot-device-scale-factor.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/chromium/screenshot-iframe.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/firefox/screenshot-iframe.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/webkit/screenshot-iframe.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/chromium/screenshot-clip-odd-size.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/firefox/screenshot-clip-odd-size.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/webkit/screenshot-clip-odd-size.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work/chromium/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work/firefox/screenshot-sanity.png (100%) rename {test => tests}/__snapshots__/page-screenshot/should-work/webkit/screenshot-sanity.png (100%) rename {test => tests}/elementhandle-bounding-box.spec.ts (91%) rename {test => tests}/elementhandle-screenshot.spec.ts (89%) rename {test => tests}/emulation-focus.spec.ts (93%) rename {test => tests}/frame-evaluate.spec.ts (91%) rename {test => tests}/frame-frame-element.spec.ts (95%) rename {test => tests}/frame-goto.spec.ts (95%) rename {test => tests}/frame-hierarchy.spec.ts (96%) rename {test => tests}/interception.spec.ts (90%) rename {test => tests}/network-post-data.spec.ts (95%) rename {test => tests}/page-accessibility.spec.ts (94%) rename {test => tests}/page-autowaiting-basic.spec.ts (97%) rename {test => tests}/page-autowaiting-no-hang.spec.ts (97%) rename {test => tests}/page-basic.spec.ts (97%) rename {test => tests}/page-close.spec.ts (88%) rename {test => tests}/page-drag.spec.ts (89%) rename {test => tests}/page-emulate-media.spec.ts (94%) rename {test => tests}/page-expose-function.spec.ts (95%) rename {test => tests}/page-focus.spec.ts (89%) rename {test => tests}/page-goto.spec.ts (94%) rename {test => tests}/page-history.spec.ts (94%) rename {test => tests}/page-in-context.spec.ts (85%) rename {test => tests}/page-keyboard.spec.ts (96%) rename {test => tests}/page-mouse.spec.ts (95%) rename {test => tests}/page-navigation.spec.ts (96%) rename {test => tests}/page-network-idle.spec.ts (97%) rename {test => tests}/page-network-request.spec.ts (91%) rename {test => tests}/page-network-response.spec.ts (94%) rename {test => tests}/page-request-continue.spec.ts (97%) rename {test => tests}/page-request-fulfill.spec.ts (81%) rename {test => tests}/page-screenshot.spec.ts (83%) rename {test => tests}/queryselector.spec.ts (98%) rename {test => tests}/selectors-css.spec.ts (99%) rename {test => tests}/selectors-misc.spec.ts (96%) rename {test => tests}/selectors-register.spec.ts (92%) rename {test => tests}/selectors-text.spec.ts (99%) rename {test => tests}/slowmo.spec.ts (98%) rename {test => tests}/workers.spec.ts (94%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b310b6a614..108767961c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,12 +38,12 @@ jobs: # XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR # Wrap `npm run` in a subshell to redirect STDERR to file. # Enable core dumps in the subshell. - - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- ${{ matrix.browser }} --reporter=dot,json" - env: - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json" env: BROWSER: ${{ matrix.browser }} + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- ${{ matrix.browser }} --reporter=dot,json" + env: FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" # Checking coverage across two test suites is hard. Temporary disabled. # - run: node test/checkCoverage.js @@ -73,12 +73,12 @@ jobs: - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps ${{ matrix.browser }} chromium - - run: npm run folio -- ${{ matrix.browser }} --reporter=dot,json - env: - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json env: BROWSER: ${{ matrix.browser }} + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: npm run folio -- ${{ matrix.browser }} --reporter=dot,json + env: FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-')) @@ -106,14 +106,14 @@ jobs: - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps - - run: npm run folio -- ${{ matrix.browser }} --reporter=dot,json - shell: bash - env: - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json shell: bash env: BROWSER: ${{ matrix.browser }} + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: npm run folio -- ${{ matrix.browser }} --reporter=dot,json + shell: bash + env: FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-')) @@ -164,15 +164,15 @@ jobs: # XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR # Wrap `npm run` in a subshell to redirect STDERR to file. # Enable core dumps in the subshell. - - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- ${{ matrix.browser }} --reporter=dot,json" - if: ${{ always() }} - env: - HEADFUL: 1 - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json" if: ${{ always() }} env: BROWSER: ${{ matrix.browser }} + HEADFUL: 1 + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- ${{ matrix.browser }} --reporter=dot,json" + if: ${{ always() }} + env: HEADFUL: 1 FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json @@ -204,13 +204,13 @@ jobs: # XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR # Wrap `npm run` in a subshell to redirect STDERR to file. # Enable core dumps in the subshell. - - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- chromium --reporter=dot,json" - env: - PWMODE: "${{ matrix.mode }}" - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json" env: BROWSER: "chromium" + PWMODE: "${{ matrix.mode }}" + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- chromium --reporter=dot,json" + env: PWMODE: "${{ matrix.mode }}" FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json @@ -242,13 +242,13 @@ jobs: # XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR # Wrap `npm run` in a subshell to redirect STDERR to file. # Enable core dumps in the subshell. - - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- ${{ matrix.browser }} --reporter=dot,json" - env: - PWVIDEO: 1 - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --timeout=60000 --global-timeout=5400000 --retries=3 --reporter=dot,json -p video" env: BROWSER: ${{ matrix.browser }} + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- ${{ matrix.browser }} --reporter=dot,json" + env: + PWVIDEO: 1 FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-')) @@ -259,7 +259,11 @@ jobs: path: test-results test_android: - name: Android Emulator + name: Android Emulator (shard ${{ matrix.shard }}) + strategy: + fail-fast: false + matrix: + shard: [1, 2] runs-on: macos-10.15 env: FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" @@ -277,7 +281,7 @@ jobs: - name: Start Android Emulator run: utils/avd_start.sh - name: Run tests - run: npm run build-folio && node tests/folio/cli.js --config=tests/config/android.config.ts --reporter=dot,json + run: npm run build-folio && node tests/folio/cli.js --config=tests/config/android.config.ts --reporter=dot,json --shard=${{ matrix.shard }}/2 - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-')) - uses: actions/upload-artifact@v1 @@ -311,13 +315,13 @@ jobs: # XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR # Wrap `npm run` in a subshell to redirect STDERR to file. # Enable core dumps in the subshell. - - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- chromium --reporter=dot,json" - env: - PW_CHROMIUM_CHANNEL: "chrome" - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --timeout=60000 --global-timeout=5400000 --retries=3 --reporter=dot,json" env: BROWSER: "chromium" + PW_CHROMIUM_CHANNEL: "chrome" + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run folio -- chromium --reporter=dot,json" + env: PW_CHROMIUM_CHANNEL: "chrome" FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - uses: actions/upload-artifact@v1 @@ -343,15 +347,15 @@ jobs: - run: npm run build # This only created problems, should we move ffmpeg back into npm? - run: node lib/cli/cli install ffmpeg - - run: npm run folio -- chromium --reporter=dot,json - shell: bash - env: - PW_CHROMIUM_CHANNEL: "chrome" - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json shell: bash env: BROWSER: "chromium" + PW_CHROMIUM_CHANNEL: "chrome" + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: npm run folio -- chromium --reporter=dot,json + shell: bash + env: PW_CHROMIUM_CHANNEL: "chrome" FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - uses: actions/upload-artifact@v1 @@ -374,13 +378,13 @@ jobs: - run: npm run build # This only created problems, should we move ffmpeg back into npm? - run: node lib/cli/cli install ffmpeg - - run: npm run folio -- chromium --reporter=dot,json - env: - PW_CHROMIUM_CHANNEL: "chrome" - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json env: BROWSER: "chromium" + PW_CHROMIUM_CHANNEL: "chrome" + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: npm run folio -- chromium --reporter=dot,json + env: PW_CHROMIUM_CHANNEL: "chrome" FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - uses: actions/upload-artifact@v1 @@ -406,15 +410,15 @@ jobs: - run: npm run build # This only created problems, should we move ffmpeg back into npm? - run: node lib/cli/cli install ffmpeg - - run: npm run folio -- chromium --reporter=dot,json - shell: bash - env: - PW_CHROMIUM_CHANNEL: "msedge" - FOLIO_JSON_OUTPUT_NAME: "test-results/report-new.json" - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json shell: bash env: BROWSER: "chromium" + PW_CHROMIUM_CHANNEL: "msedge" + FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json" + - run: npm run folio -- chromium --reporter=dot,json + shell: bash + env: PW_CHROMIUM_CHANNEL: "msedge" FOLIO_JSON_OUTPUT_NAME: "test-results/report.json" - uses: actions/upload-artifact@v1 diff --git a/test/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/chromium/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/chromium/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/chromium/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/chromium/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/firefox/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/firefox/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/firefox/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/firefox/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/webkit/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/webkit/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/webkit/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/path-option-should-create-subdirectories/webkit/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/chromium/screenshot-element-larger-than-viewport.png b/tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/chromium/screenshot-element-larger-than-viewport.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/chromium/screenshot-element-larger-than-viewport.png rename to tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/chromium/screenshot-element-larger-than-viewport.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/firefox/screenshot-element-larger-than-viewport.png b/tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/firefox/screenshot-element-larger-than-viewport.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/firefox/screenshot-element-larger-than-viewport.png rename to tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/firefox/screenshot-element-larger-than-viewport.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/webkit/screenshot-element-larger-than-viewport.png b/tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/webkit/screenshot-element-larger-than-viewport.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/webkit/screenshot-element-larger-than-viewport.png rename to tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport-in-parallel/webkit/screenshot-element-larger-than-viewport.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/chromium/screenshot-element-larger-than-viewport.png b/tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/chromium/screenshot-element-larger-than-viewport.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/chromium/screenshot-element-larger-than-viewport.png rename to tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/chromium/screenshot-element-larger-than-viewport.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/firefox/screenshot-element-larger-than-viewport.png b/tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/firefox/screenshot-element-larger-than-viewport.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/firefox/screenshot-element-larger-than-viewport.png rename to tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/firefox/screenshot-element-larger-than-viewport.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/webkit/screenshot-element-larger-than-viewport.png b/tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/webkit/screenshot-element-larger-than-viewport.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/webkit/screenshot-element-larger-than-viewport.png rename to tests/__snapshots__/elementhandle-screenshot/should-capture-full-element-when-larger-than-viewport/webkit/screenshot-element-larger-than-viewport.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/chromium/screenshot-element-scrolled-into-view.png b/tests/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/chromium/screenshot-element-scrolled-into-view.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/chromium/screenshot-element-scrolled-into-view.png rename to tests/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/chromium/screenshot-element-scrolled-into-view.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/firefox/screenshot-element-scrolled-into-view.png b/tests/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/firefox/screenshot-element-scrolled-into-view.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/firefox/screenshot-element-scrolled-into-view.png rename to tests/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/firefox/screenshot-element-scrolled-into-view.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/webkit/screenshot-element-scrolled-into-view.png b/tests/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/webkit/screenshot-element-scrolled-into-view.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/webkit/screenshot-element-scrolled-into-view.png rename to tests/__snapshots__/elementhandle-screenshot/should-scroll-15000px-into-view/webkit/screenshot-element-scrolled-into-view.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/chromium/screenshot-element-scrolled-into-view.png b/tests/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/chromium/screenshot-element-scrolled-into-view.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/chromium/screenshot-element-scrolled-into-view.png rename to tests/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/chromium/screenshot-element-scrolled-into-view.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/firefox/screenshot-element-scrolled-into-view.png b/tests/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/firefox/screenshot-element-scrolled-into-view.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/firefox/screenshot-element-scrolled-into-view.png rename to tests/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/firefox/screenshot-element-scrolled-into-view.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/webkit/screenshot-element-scrolled-into-view.png b/tests/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/webkit/screenshot-element-scrolled-into-view.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/webkit/screenshot-element-scrolled-into-view.png rename to tests/__snapshots__/elementhandle-screenshot/should-scroll-element-into-view/webkit/screenshot-element-scrolled-into-view.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/chromium/screenshot-element-padding-border.png b/tests/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/chromium/screenshot-element-padding-border.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/chromium/screenshot-element-padding-border.png rename to tests/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/chromium/screenshot-element-padding-border.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/firefox/screenshot-element-padding-border.png b/tests/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/firefox/screenshot-element-padding-border.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/firefox/screenshot-element-padding-border.png rename to tests/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/firefox/screenshot-element-padding-border.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/webkit/screenshot-element-padding-border.png b/tests/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/webkit/screenshot-element-padding-border.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/webkit/screenshot-element-padding-border.png rename to tests/__snapshots__/elementhandle-screenshot/should-take-into-account-padding-and-border/webkit/screenshot-element-padding-border.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/chromium/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/chromium/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/chromium/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/chromium/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/firefox/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/firefox/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/firefox/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/firefox/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/webkit/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/webkit/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/webkit/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-wait-for-element-to-stop-moving/webkit/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-wait-for-visible/chromium/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-wait-for-visible/chromium/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-wait-for-visible/chromium/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-wait-for-visible/chromium/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-wait-for-visible/firefox/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-wait-for-visible/firefox/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-wait-for-visible/firefox/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-wait-for-visible/firefox/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-wait-for-visible/webkit/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-wait-for-visible/webkit/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-wait-for-visible/webkit/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-wait-for-visible/webkit/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/chromium/screenshot-element-fractional-offset.png b/tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/chromium/screenshot-element-fractional-offset.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/chromium/screenshot-element-fractional-offset.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/chromium/screenshot-element-fractional-offset.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/firefox/screenshot-element-fractional-offset.png b/tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/firefox/screenshot-element-fractional-offset.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/firefox/screenshot-element-fractional-offset.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/firefox/screenshot-element-fractional-offset.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/webkit/screenshot-element-fractional-offset.png b/tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/webkit/screenshot-element-fractional-offset.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/webkit/screenshot-element-fractional-offset.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-an-offset/webkit/screenshot-element-fractional-offset.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/chromium/screenshot-element-fractional.png b/tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/chromium/screenshot-element-fractional.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/chromium/screenshot-element-fractional.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/chromium/screenshot-element-fractional.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/firefox/screenshot-element-fractional.png b/tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/firefox/screenshot-element-fractional.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/firefox/screenshot-element-fractional.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/firefox/screenshot-element-fractional.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/webkit/screenshot-element-fractional.png b/tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/webkit/screenshot-element-fractional.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/webkit/screenshot-element-fractional.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-for-an-element-with-fractional-dimensions/webkit/screenshot-element-fractional.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-element-mobile.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-element-mobile.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-element-mobile.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-element-mobile.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-element-mobile.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-element-mobile.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-element-mobile.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-element-mobile.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/chromium/screenshot-element-rotate.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/chromium/screenshot-element-rotate.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/chromium/screenshot-element-rotate.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/chromium/screenshot-element-rotate.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/firefox/screenshot-element-rotate.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/firefox/screenshot-element-rotate.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/firefox/screenshot-element-rotate.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/firefox/screenshot-element-rotate.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/webkit/screenshot-element-rotate.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/webkit/screenshot-element-rotate.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/webkit/screenshot-element-rotate.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-a-rotated-element/webkit/screenshot-element-rotate.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/chromium/screenshot-element-mobile-dsf.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/chromium/screenshot-element-mobile-dsf.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/chromium/screenshot-element-mobile-dsf.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/chromium/screenshot-element-mobile-dsf.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/webkit/screenshot-element-mobile-dsf.png b/tests/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/webkit/screenshot-element-mobile-dsf.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/webkit/screenshot-element-mobile-dsf.png rename to tests/__snapshots__/elementhandle-screenshot/should-work-with-device-scale-factor/webkit/screenshot-element-mobile-dsf.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work/chromium/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-work/chromium/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work/chromium/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-work/chromium/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work/firefox/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-work/firefox/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work/firefox/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-work/firefox/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/elementhandle-screenshot/should-work/webkit/screenshot-element-bounding-box.png b/tests/__snapshots__/elementhandle-screenshot/should-work/webkit/screenshot-element-bounding-box.png similarity index 100% rename from test/__snapshots__/elementhandle-screenshot/should-work/webkit/screenshot-element-bounding-box.png rename to tests/__snapshots__/elementhandle-screenshot/should-work/webkit/screenshot-element-bounding-box.png diff --git a/test/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/grid-cell-0.png b/tests/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/grid-cell-0.png similarity index 100% rename from test/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/grid-cell-0.png rename to tests/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/grid-cell-0.png diff --git a/test/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/screenshot-sanity.png b/tests/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/screenshot-sanity.png rename to tests/__snapshots__/emulation-focus/should-not-affect-screenshots/chromium/screenshot-sanity.png diff --git a/test/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/grid-cell-0.png b/tests/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/grid-cell-0.png similarity index 100% rename from test/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/grid-cell-0.png rename to tests/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/grid-cell-0.png diff --git a/test/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/screenshot-sanity.png b/tests/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/screenshot-sanity.png rename to tests/__snapshots__/emulation-focus/should-not-affect-screenshots/firefox/screenshot-sanity.png diff --git a/test/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/grid-cell-0.png b/tests/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/grid-cell-0.png similarity index 100% rename from test/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/grid-cell-0.png rename to tests/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/grid-cell-0.png diff --git a/test/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/screenshot-sanity.png b/tests/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/screenshot-sanity.png rename to tests/__snapshots__/emulation-focus/should-not-affect-screenshots/webkit/screenshot-sanity.png diff --git a/test/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/chromium/mock-binary-response.png b/tests/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/chromium/mock-binary-response.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/chromium/mock-binary-response.png rename to tests/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/chromium/mock-binary-response.png diff --git a/test/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/firefox/mock-binary-response.png b/tests/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/firefox/mock-binary-response.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/firefox/mock-binary-response.png rename to tests/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/firefox/mock-binary-response.png diff --git a/test/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/webkit/mock-binary-response.png b/tests/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/webkit/mock-binary-response.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/webkit/mock-binary-response.png rename to tests/__snapshots__/page-request-fulfill/should-allow-mocking-binary-responses/webkit/mock-binary-response.png diff --git a/test/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/chromium/mock-svg.png b/tests/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/chromium/mock-svg.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/chromium/mock-svg.png rename to tests/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/chromium/mock-svg.png diff --git a/test/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/firefox/mock-svg.png b/tests/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/firefox/mock-svg.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/firefox/mock-svg.png rename to tests/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/firefox/mock-svg.png diff --git a/test/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/webkit/mock-svg.png b/tests/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/webkit/mock-svg.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/webkit/mock-svg.png rename to tests/__snapshots__/page-request-fulfill/should-allow-mocking-svg-with-charset/webkit/mock-svg.png diff --git a/test/__snapshots__/page-request-fulfill/should-work-with-file-path/chromium/mock-binary-response.png b/tests/__snapshots__/page-request-fulfill/should-work-with-file-path/chromium/mock-binary-response.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-work-with-file-path/chromium/mock-binary-response.png rename to tests/__snapshots__/page-request-fulfill/should-work-with-file-path/chromium/mock-binary-response.png diff --git a/test/__snapshots__/page-request-fulfill/should-work-with-file-path/firefox/mock-binary-response.png b/tests/__snapshots__/page-request-fulfill/should-work-with-file-path/firefox/mock-binary-response.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-work-with-file-path/firefox/mock-binary-response.png rename to tests/__snapshots__/page-request-fulfill/should-work-with-file-path/firefox/mock-binary-response.png diff --git a/test/__snapshots__/page-request-fulfill/should-work-with-file-path/webkit/mock-binary-response.png b/tests/__snapshots__/page-request-fulfill/should-work-with-file-path/webkit/mock-binary-response.png similarity index 100% rename from test/__snapshots__/page-request-fulfill/should-work-with-file-path/webkit/mock-binary-response.png rename to tests/__snapshots__/page-request-fulfill/should-work-with-file-path/webkit/mock-binary-response.png diff --git a/test/__snapshots__/page-screenshot/path-option-should-create-subdirectories/chromium/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/path-option-should-create-subdirectories/chromium/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-create-subdirectories/chromium/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/path-option-should-create-subdirectories/chromium/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/path-option-should-create-subdirectories/firefox/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/path-option-should-create-subdirectories/firefox/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-create-subdirectories/firefox/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/path-option-should-create-subdirectories/firefox/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/path-option-should-create-subdirectories/webkit/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/path-option-should-create-subdirectories/webkit/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-create-subdirectories/webkit/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/path-option-should-create-subdirectories/webkit/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/path-option-should-detect-jpeg/chromium/white.jpg b/tests/__snapshots__/page-screenshot/path-option-should-detect-jpeg/chromium/white.jpg similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-detect-jpeg/chromium/white.jpg rename to tests/__snapshots__/page-screenshot/path-option-should-detect-jpeg/chromium/white.jpg diff --git a/test/__snapshots__/page-screenshot/path-option-should-detect-jpeg/firefox/white.jpg b/tests/__snapshots__/page-screenshot/path-option-should-detect-jpeg/firefox/white.jpg similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-detect-jpeg/firefox/white.jpg rename to tests/__snapshots__/page-screenshot/path-option-should-detect-jpeg/firefox/white.jpg diff --git a/test/__snapshots__/page-screenshot/path-option-should-detect-jpeg/webkit/white.jpg b/tests/__snapshots__/page-screenshot/path-option-should-detect-jpeg/webkit/white.jpg similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-detect-jpeg/webkit/white.jpg rename to tests/__snapshots__/page-screenshot/path-option-should-detect-jpeg/webkit/white.jpg diff --git a/test/__snapshots__/page-screenshot/path-option-should-work/chromium/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/path-option-should-work/chromium/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-work/chromium/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/path-option-should-work/chromium/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/path-option-should-work/firefox/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/path-option-should-work/firefox/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-work/firefox/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/path-option-should-work/firefox/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/path-option-should-work/webkit/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/path-option-should-work/webkit/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/path-option-should-work/webkit/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/path-option-should-work/webkit/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/should-allow-transparency/chromium/transparent.png b/tests/__snapshots__/page-screenshot/should-allow-transparency/chromium/transparent.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-allow-transparency/chromium/transparent.png rename to tests/__snapshots__/page-screenshot/should-allow-transparency/chromium/transparent.png diff --git a/test/__snapshots__/page-screenshot/should-allow-transparency/webkit/transparent.png b/tests/__snapshots__/page-screenshot/should-allow-transparency/webkit/transparent.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-allow-transparency/webkit/transparent.png rename to tests/__snapshots__/page-screenshot/should-allow-transparency/webkit/transparent.png diff --git a/test/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/chromium/screenshot-offscreen-clip.png b/tests/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/chromium/screenshot-offscreen-clip.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/chromium/screenshot-offscreen-clip.png rename to tests/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/chromium/screenshot-offscreen-clip.png diff --git a/test/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/firefox/screenshot-offscreen-clip.png b/tests/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/firefox/screenshot-offscreen-clip.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/firefox/screenshot-offscreen-clip.png rename to tests/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/firefox/screenshot-offscreen-clip.png diff --git a/test/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/webkit/screenshot-offscreen-clip.png b/tests/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/webkit/screenshot-offscreen-clip.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/webkit/screenshot-offscreen-clip.png rename to tests/__snapshots__/page-screenshot/should-clip-elements-to-the-viewport/webkit/screenshot-offscreen-clip.png diff --git a/test/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/chromium/screenshot-clip-rect.png b/tests/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/chromium/screenshot-clip-rect.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/chromium/screenshot-clip-rect.png rename to tests/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/chromium/screenshot-clip-rect.png diff --git a/test/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/firefox/screenshot-clip-rect.png b/tests/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/firefox/screenshot-clip-rect.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/firefox/screenshot-clip-rect.png rename to tests/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/firefox/screenshot-clip-rect.png diff --git a/test/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/webkit/screenshot-clip-rect.png b/tests/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/webkit/screenshot-clip-rect.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/webkit/screenshot-clip-rect.png rename to tests/__snapshots__/page-screenshot/should-clip-rect-with-fullPage/webkit/screenshot-clip-rect.png diff --git a/test/__snapshots__/page-screenshot/should-clip-rect/chromium/screenshot-clip-rect.png b/tests/__snapshots__/page-screenshot/should-clip-rect/chromium/screenshot-clip-rect.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-rect/chromium/screenshot-clip-rect.png rename to tests/__snapshots__/page-screenshot/should-clip-rect/chromium/screenshot-clip-rect.png diff --git a/test/__snapshots__/page-screenshot/should-clip-rect/firefox/screenshot-clip-rect.png b/tests/__snapshots__/page-screenshot/should-clip-rect/firefox/screenshot-clip-rect.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-rect/firefox/screenshot-clip-rect.png rename to tests/__snapshots__/page-screenshot/should-clip-rect/firefox/screenshot-clip-rect.png diff --git a/test/__snapshots__/page-screenshot/should-clip-rect/webkit/screenshot-clip-rect.png b/tests/__snapshots__/page-screenshot/should-clip-rect/webkit/screenshot-clip-rect.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-clip-rect/webkit/screenshot-clip-rect.png rename to tests/__snapshots__/page-screenshot/should-clip-rect/webkit/screenshot-clip-rect.png diff --git a/test/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/chromium/white.jpg b/tests/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/chromium/white.jpg similarity index 100% rename from test/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/chromium/white.jpg rename to tests/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/chromium/white.jpg diff --git a/test/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/firefox/white.jpg b/tests/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/firefox/white.jpg similarity index 100% rename from test/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/firefox/white.jpg rename to tests/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/firefox/white.jpg diff --git a/test/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/webkit/white.jpg b/tests/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/webkit/white.jpg similarity index 100% rename from test/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/webkit/white.jpg rename to tests/__snapshots__/page-screenshot/should-render-white-background-on-jpeg-file/webkit/white.jpg diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-0.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-0.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-0.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-0.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-1.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-1.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-1.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/chromium/grid-cell-1.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-0.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-0.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-0.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-0.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-1.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-1.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-1.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/firefox/grid-cell-1.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-0.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-0.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-0.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-0.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-1.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-1.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-1.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel-in-multiple-pages/webkit/grid-cell-1.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel/chromium/grid-cell-1.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel/chromium/grid-cell-1.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel/chromium/grid-cell-1.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel/chromium/grid-cell-1.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel/firefox/grid-cell-1.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel/firefox/grid-cell-1.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel/firefox/grid-cell-1.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel/firefox/grid-cell-1.png diff --git a/test/__snapshots__/page-screenshot/should-run-in-parallel/webkit/grid-cell-1.png b/tests/__snapshots__/page-screenshot/should-run-in-parallel/webkit/grid-cell-1.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-run-in-parallel/webkit/grid-cell-1.png rename to tests/__snapshots__/page-screenshot/should-run-in-parallel/webkit/grid-cell-1.png diff --git a/test/__snapshots__/page-screenshot/should-take-fullPage-screenshots/chromium/screenshot-grid-fullpage.png b/tests/__snapshots__/page-screenshot/should-take-fullPage-screenshots/chromium/screenshot-grid-fullpage.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-take-fullPage-screenshots/chromium/screenshot-grid-fullpage.png rename to tests/__snapshots__/page-screenshot/should-take-fullPage-screenshots/chromium/screenshot-grid-fullpage.png diff --git a/test/__snapshots__/page-screenshot/should-take-fullPage-screenshots/firefox/screenshot-grid-fullpage.png b/tests/__snapshots__/page-screenshot/should-take-fullPage-screenshots/firefox/screenshot-grid-fullpage.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-take-fullPage-screenshots/firefox/screenshot-grid-fullpage.png rename to tests/__snapshots__/page-screenshot/should-take-fullPage-screenshots/firefox/screenshot-grid-fullpage.png diff --git a/test/__snapshots__/page-screenshot/should-take-fullPage-screenshots/webkit/screenshot-grid-fullpage.png b/tests/__snapshots__/page-screenshot/should-take-fullPage-screenshots/webkit/screenshot-grid-fullpage.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-take-fullPage-screenshots/webkit/screenshot-grid-fullpage.png rename to tests/__snapshots__/page-screenshot/should-take-fullPage-screenshots/webkit/screenshot-grid-fullpage.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-canvas/chromium/screenshot-canvas.png b/tests/__snapshots__/page-screenshot/should-work-for-canvas/chromium/screenshot-canvas.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-canvas/chromium/screenshot-canvas.png rename to tests/__snapshots__/page-screenshot/should-work-for-canvas/chromium/screenshot-canvas.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-canvas/firefox/screenshot-canvas.png b/tests/__snapshots__/page-screenshot/should-work-for-canvas/firefox/screenshot-canvas.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-canvas/firefox/screenshot-canvas.png rename to tests/__snapshots__/page-screenshot/should-work-for-canvas/firefox/screenshot-canvas.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-canvas/webkit/screenshot-canvas.png b/tests/__snapshots__/page-screenshot/should-work-for-canvas/webkit/screenshot-canvas.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-canvas/webkit/screenshot-canvas.png rename to tests/__snapshots__/page-screenshot/should-work-for-canvas/webkit/screenshot-canvas.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-translateZ/chromium/screenshot-translateZ.png b/tests/__snapshots__/page-screenshot/should-work-for-translateZ/chromium/screenshot-translateZ.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-translateZ/chromium/screenshot-translateZ.png rename to tests/__snapshots__/page-screenshot/should-work-for-translateZ/chromium/screenshot-translateZ.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-translateZ/firefox/screenshot-translateZ.png b/tests/__snapshots__/page-screenshot/should-work-for-translateZ/firefox/screenshot-translateZ.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-translateZ/firefox/screenshot-translateZ.png rename to tests/__snapshots__/page-screenshot/should-work-for-translateZ/firefox/screenshot-translateZ.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-translateZ/webkit/screenshot-translateZ.png b/tests/__snapshots__/page-screenshot/should-work-for-translateZ/webkit/screenshot-translateZ.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-translateZ/webkit/screenshot-translateZ.png rename to tests/__snapshots__/page-screenshot/should-work-for-translateZ/webkit/screenshot-translateZ.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-webgl/chromium/screenshot-webgl.png b/tests/__snapshots__/page-screenshot/should-work-for-webgl/chromium/screenshot-webgl.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-webgl/chromium/screenshot-webgl.png rename to tests/__snapshots__/page-screenshot/should-work-for-webgl/chromium/screenshot-webgl.png diff --git a/test/__snapshots__/page-screenshot/should-work-for-webgl/webkit/screenshot-webgl.png b/tests/__snapshots__/page-screenshot/should-work-for-webgl/webkit/screenshot-webgl.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-for-webgl/webkit/screenshot-webgl.png rename to tests/__snapshots__/page-screenshot/should-work-for-webgl/webkit/screenshot-webgl.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/chromium/screenshot-mobile-clip.png b/tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/chromium/screenshot-mobile-clip.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/chromium/screenshot-mobile-clip.png rename to tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/chromium/screenshot-mobile-clip.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/webkit/screenshot-mobile-clip.png b/tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/webkit/screenshot-mobile-clip.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/webkit/screenshot-mobile-clip.png rename to tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-clip/webkit/screenshot-mobile-clip.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/chromium/screenshot-mobile-fullpage.png b/tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/chromium/screenshot-mobile-fullpage.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/chromium/screenshot-mobile-fullpage.png rename to tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/chromium/screenshot-mobile-fullpage.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/webkit/screenshot-mobile-fullpage.png b/tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/webkit/screenshot-mobile-fullpage.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/webkit/screenshot-mobile-fullpage.png rename to tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport-and-fullPage/webkit/screenshot-mobile-fullpage.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-mobile.png b/tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-mobile.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-mobile.png rename to tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/chromium/screenshot-mobile.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-mobile.png b/tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-mobile.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-mobile.png rename to tests/__snapshots__/page-screenshot/should-work-with-a-mobile-viewport/webkit/screenshot-mobile.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-device-scale-factor/chromium/screenshot-device-scale-factor.png b/tests/__snapshots__/page-screenshot/should-work-with-device-scale-factor/chromium/screenshot-device-scale-factor.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-device-scale-factor/chromium/screenshot-device-scale-factor.png rename to tests/__snapshots__/page-screenshot/should-work-with-device-scale-factor/chromium/screenshot-device-scale-factor.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-device-scale-factor/firefox/screenshot-device-scale-factor.png b/tests/__snapshots__/page-screenshot/should-work-with-device-scale-factor/firefox/screenshot-device-scale-factor.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-device-scale-factor/firefox/screenshot-device-scale-factor.png rename to tests/__snapshots__/page-screenshot/should-work-with-device-scale-factor/firefox/screenshot-device-scale-factor.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-device-scale-factor/webkit/screenshot-device-scale-factor.png b/tests/__snapshots__/page-screenshot/should-work-with-device-scale-factor/webkit/screenshot-device-scale-factor.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-device-scale-factor/webkit/screenshot-device-scale-factor.png rename to tests/__snapshots__/page-screenshot/should-work-with-device-scale-factor/webkit/screenshot-device-scale-factor.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/chromium/screenshot-iframe.png b/tests/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/chromium/screenshot-iframe.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/chromium/screenshot-iframe.png rename to tests/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/chromium/screenshot-iframe.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/firefox/screenshot-iframe.png b/tests/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/firefox/screenshot-iframe.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/firefox/screenshot-iframe.png rename to tests/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/firefox/screenshot-iframe.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/webkit/screenshot-iframe.png b/tests/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/webkit/screenshot-iframe.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/webkit/screenshot-iframe.png rename to tests/__snapshots__/page-screenshot/should-work-with-iframe-in-shadow/webkit/screenshot-iframe.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/chromium/screenshot-clip-odd-size.png b/tests/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/chromium/screenshot-clip-odd-size.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/chromium/screenshot-clip-odd-size.png rename to tests/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/chromium/screenshot-clip-odd-size.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/firefox/screenshot-clip-odd-size.png b/tests/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/firefox/screenshot-clip-odd-size.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/firefox/screenshot-clip-odd-size.png rename to tests/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/firefox/screenshot-clip-odd-size.png diff --git a/test/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/webkit/screenshot-clip-odd-size.png b/tests/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/webkit/screenshot-clip-odd-size.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/webkit/screenshot-clip-odd-size.png rename to tests/__snapshots__/page-screenshot/should-work-with-odd-clip-size-on-Retina-displays/webkit/screenshot-clip-odd-size.png diff --git a/test/__snapshots__/page-screenshot/should-work/chromium/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/should-work/chromium/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work/chromium/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/should-work/chromium/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/should-work/firefox/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/should-work/firefox/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work/firefox/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/should-work/firefox/screenshot-sanity.png diff --git a/test/__snapshots__/page-screenshot/should-work/webkit/screenshot-sanity.png b/tests/__snapshots__/page-screenshot/should-work/webkit/screenshot-sanity.png similarity index 100% rename from test/__snapshots__/page-screenshot/should-work/webkit/screenshot-sanity.png rename to tests/__snapshots__/page-screenshot/should-work/webkit/screenshot-sanity.png diff --git a/tests/config/android.config.ts b/tests/config/android.config.ts index 1755a35e36..1a76850954 100644 --- a/tests/config/android.config.ts +++ b/tests/config/android.config.ts @@ -29,7 +29,7 @@ const config: Config = { if (process.env.CI) { config.workers = 1; config.forbidOnly = true; - config.retries = 3; + config.retries = 1; // Multiple retries are too slow on Android. } setConfig(config); diff --git a/tests/config/androidEnv.ts b/tests/config/androidEnv.ts index 250e0f782d..061605bf87 100644 --- a/tests/config/androidEnv.ts +++ b/tests/config/androidEnv.ts @@ -30,7 +30,7 @@ export class AndroidEnv implements Env { this._device = (await playwright._android.devices())[0]; await this._device.shell('am force-stop org.chromium.webview_shell'); await this._device.shell('am force-stop com.android.chrome'); - this._device.setDefaultTimeout(120000); + this._device.setDefaultTimeout(90000); } async beforeEach(testInfo: TestInfo) { @@ -48,6 +48,7 @@ export class AndroidEnv implements Env { isLinux: os.platform() === 'linux', platform: os.platform() as ('win32' | 'darwin' | 'linux'), video: false, + headful: true, toImpl: (playwright as any)._toImpl, playwright, androidDevice: this._device!, @@ -71,8 +72,6 @@ export class AndroidPageEnv extends AndroidEnv implements Env { async beforeEach(testInfo: TestInfo) { const result = await super.beforeEach(testInfo); - for (const page of this._context!.pages()) - await page.close(); const page = await this._context!.newPage(); return { ...result, @@ -80,4 +79,9 @@ export class AndroidPageEnv extends AndroidEnv implements Env { page, }; } + + async afterEach(testInfo: TestInfo) { + for (const page of this._context!.pages()) + await page.close(); + } } diff --git a/tests/config/browserTest.ts b/tests/config/browserTest.ts index de8c7a50ef..29945fa462 100644 --- a/tests/config/browserTest.ts +++ b/tests/config/browserTest.ts @@ -27,6 +27,7 @@ export type BrowserTestArgs = PlaywrightTestArgs & { }; export const test = newTestType(); +export const slowTest = newTestType(); export const proxyTest = newTestType(); // Context test guarantees an isolated context. diff --git a/tests/config/default.config.ts b/tests/config/default.config.ts index 7b1d59490c..ff59b5590c 100644 --- a/tests/config/default.config.ts +++ b/tests/config/default.config.ts @@ -17,7 +17,7 @@ import { setConfig, Config } from '../folio/out'; import * as path from 'path'; import { test as playwrightTest, slowTest as playwrightSlowTest } from './playwrightTest'; -import { test as browserTest, contextTest, proxyTest } from './browserTest'; +import { test as browserTest, contextTest, proxyTest, slowTest as browserSlowTest } from './browserTest'; import { test as pageTest } from './pageTest'; import { test as electronTest } from './electronTest'; import { test as cliTest } from './cliTest'; @@ -64,6 +64,7 @@ for (const browserName of browsers) { playwrightTest.runWith(browserName, serverEnv, new PlaywrightEnv(browserName, options), {}); playwrightSlowTest.runWith(browserName, serverEnv, new PlaywrightEnv(browserName, options), { timeout: config.timeout * 3 }); browserTest.runWith(browserName, serverEnv, new BrowserEnv(browserName, options), {}); + browserSlowTest.runWith(browserName, serverEnv, new BrowserEnv(browserName, options), { timeout: config.timeout * 3 }); // TODO: perhaps export proxyTest from the test file? proxyTest.runWith(browserName, serverEnv, new BrowserEnv(browserName, { ...options, proxy: { server: 'per-context' } }), {}); pageTest.runWith(browserName, serverEnv, new PageEnv(browserName, options), {}); diff --git a/tests/config/pageTest.ts b/tests/config/pageTest.ts index 6add16dad5..45e18d33e2 100644 --- a/tests/config/pageTest.ts +++ b/tests/config/pageTest.ts @@ -23,6 +23,7 @@ export type CommonTestArgs = { mode: 'default' | 'driver' | 'service'; platform: 'win32' | 'darwin' | 'linux'; video: boolean; + headful: boolean; playwright: typeof import('../../index'); toImpl: (rpcObject: any) => any; diff --git a/tests/config/playwrightTest.ts b/tests/config/playwrightTest.ts index a020039b8c..fb8669aa41 100644 --- a/tests/config/playwrightTest.ts +++ b/tests/config/playwrightTest.ts @@ -24,7 +24,6 @@ export { expect } from '../folio/out'; export type PlaywrightTestArgs = CommonTestArgs & { browserType: BrowserType; browserOptions: LaunchOptions; - headful: boolean; createUserDataDir: () => Promise; launchPersistent: (options?: Parameters['launchPersistentContext']>[1]) => Promise<{ context: BrowserContext, page: Page }>; startRemoteServer: (options?: RemoteServerOptions) => Promise; diff --git a/test/elementhandle-bounding-box.spec.ts b/tests/elementhandle-bounding-box.spec.ts similarity index 91% rename from test/elementhandle-bounding-box.spec.ts rename to tests/elementhandle-bounding-box.spec.ts index 14568ecca9..bb64c406c5 100644 --- a/test/elementhandle-bounding-box.spec.ts +++ b/tests/elementhandle-bounding-box.spec.ts @@ -15,12 +15,16 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; +it.beforeEach(async () => { + it.skip(!!process.env.PW_ANDROID_TESTS); +}); + +it('should work', async ({ page, server, browserName, headful }) => { + it.fail(browserName === 'firefox' && headful); -it('should work', (test, { browserName, headful }) => { - test.fail(browserName === 'firefox' && headful); -}, async ({ page, server }) => { await page.setViewportSize({ width: 500, height: 500 }); await page.goto(server.PREFIX + '/grid.html'); const elementHandle = await page.$('.box:nth-of-type(13)'); @@ -86,9 +90,9 @@ it('should work with SVG nodes', async ({ page, server }) => { expect(pwBoundingBox).toEqual(webBoundingBox); }); -it('should work with page scale', (test, { browserName }) => { - test.skip(browserName === 'firefox'); -}, async ({ browser, server }) => { +browserTest('should work with page scale', async ({ browser, server, browserName }) => { + browserTest.skip(browserName === 'firefox'); + const context = await browser.newContext({ viewport: { width: 400, height: 400 }, isMobile: true }); const page = await context.newPage(); await page.goto(server.PREFIX + '/input/button.html'); diff --git a/test/elementhandle-screenshot.spec.ts b/tests/elementhandle-screenshot.spec.ts similarity index 89% rename from test/elementhandle-screenshot.spec.ts rename to tests/elementhandle-screenshot.spec.ts index 66ffb55733..9429421461 100644 --- a/test/elementhandle-screenshot.spec.ts +++ b/tests/elementhandle-screenshot.spec.ts @@ -15,16 +15,19 @@ * limitations under the License. */ -import { it, expect, describe } from './fixtures'; -import { verifyViewport } from './utils'; - +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; +import { verifyViewport } from '../test/utils'; import {PNG} from 'pngjs'; import path from 'path'; import fs from 'fs'; -describe('element screenshot', (suite, parameters) => { - suite.skip(parameters.browserName === 'firefox' && parameters.headful); -}, () => { +it.describe('element screenshot', () => { + it.beforeEach(async ({ browserName, headful }) => { + it.skip(browserName === 'firefox' && headful); + it.skip(!!process.env.PW_ANDROID_TESTS, 'Different dpr. Remove after using 1x scale for screenshots.'); + }); + it('should work', async ({page, server}) => { await page.setViewportSize({width: 500, height: 500}); await page.goto(server.PREFIX + '/grid.html'); @@ -211,9 +214,77 @@ describe('element screenshot', (suite, parameters) => { expect(screenshot).toMatchSnapshot('screenshot-element-fractional.png'); }); - it('should work with a mobile viewport', (test, { browserName }) => { - test.skip(browserName === 'firefox'); - }, async ({browser, server}) => { + it('should work for an element with an offset', async ({page}) => { + await page.setContent('
'); + const elementHandle = await page.$('div'); + const screenshot = await elementHandle.screenshot(); + expect(screenshot).toMatchSnapshot('screenshot-element-fractional-offset.png'); + }); + + it('should wait for element to stop moving', async ({ page, server }) => { + await page.setViewportSize({ width: 500, height: 500 }); + await page.goto(server.PREFIX + '/grid.html'); + const elementHandle = await page.$('.box:nth-of-type(3)'); + await elementHandle.evaluate(e => { + e.classList.add('animation'); + return new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f))); + }); + const screenshot = await elementHandle.screenshot(); + expect(screenshot).toMatchSnapshot('screenshot-element-bounding-box.png'); + }); + + it('should take screenshot of disabled button', async ({page}) => { + await page.setViewportSize({ width: 500, height: 500 }); + await page.setContent(``); + const button = await page.$('button'); + const screenshot = await button.screenshot(); + expect(screenshot).toBeInstanceOf(Buffer); + }); + + it('path option should create subdirectories', async ({page, server}, testInfo) => { + await page.setViewportSize({width: 500, height: 500}); + await page.goto(server.PREFIX + '/grid.html'); + await page.evaluate(() => window.scrollBy(50, 100)); + const elementHandle = await page.$('.box:nth-of-type(3)'); + const outputPath = testInfo.outputPath(path.join('these', 'are', 'directories', 'screenshot.png')); + await elementHandle.screenshot({path: outputPath}); + expect(await fs.promises.readFile(outputPath)).toMatchSnapshot('screenshot-element-bounding-box.png'); + }); + + it('should prefer type over extension', async ({page, server}, testInfo) => { + await page.setViewportSize({width: 500, height: 500}); + await page.goto(server.PREFIX + '/grid.html'); + await page.evaluate(() => window.scrollBy(50, 100)); + const elementHandle = await page.$('.box:nth-of-type(3)'); + const outputPath = testInfo.outputPath('file.png'); + const buffer = await elementHandle.screenshot({ path: outputPath, type: 'jpeg' }); + expect([buffer[0], buffer[1], buffer[2]]).toEqual([0xFF, 0xD8, 0xFF]); + }); + + it('should not issue resize event', async ({page, server}) => { + await page.goto(server.PREFIX + '/grid.html'); + let resizeTriggered = false; + await page.exposeFunction('resize', () => { + resizeTriggered = true; + }); + await page.evaluate(() => { + window.addEventListener('resize', () => (window as any).resize()); + }); + const elementHandle = await page.$('.box:nth-of-type(3)'); + await elementHandle.screenshot(); + expect(resizeTriggered).toBeFalsy(); + }); +}); + +browserTest.describe('element sceenshot', () => { + browserTest.beforeEach(async ({ browserName, headful }) => { + browserTest.skip(browserName === 'firefox' && headful); + browserTest.skip(!!process.env.PW_ANDROID_TESTS, 'Different dpr. Remove after using 1x scale for screenshots.'); + }); + + browserTest('should work with a mobile viewport', async ({browser, server, browserName}) => { + browserTest.skip(browserName === 'firefox'); + const context = await browser.newContext({viewport: { width: 320, height: 480 }, isMobile: true}); const page = await context.newPage(); await page.goto(server.PREFIX + '/grid.html'); @@ -224,9 +295,9 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should work with device scale factor', (test, { browserName }) => { - test.skip(browserName === 'firefox'); - }, async ({browser, server}) => { + browserTest('should work with device scale factor', async ({browser, server, browserName}) => { + browserTest.skip(browserName === 'firefox'); + const context = await browser.newContext({ viewport: { width: 320, height: 480 }, deviceScaleFactor: 2 }); const page = await context.newPage(); await page.goto(server.PREFIX + '/grid.html'); @@ -237,14 +308,7 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should work for an element with an offset', async ({page}) => { - await page.setContent('
'); - const elementHandle = await page.$('div'); - const screenshot = await elementHandle.screenshot(); - expect(screenshot).toMatchSnapshot('screenshot-element-fractional-offset.png'); - }); - - it('should take screenshots when default viewport is null', async ({server, browser}) => { + browserTest('should take screenshots when default viewport is null', async ({server, browser}) => { const context = await browser.newContext({ viewport: null }); const page = await context.newPage(); await page.setContent(`
`); @@ -263,7 +327,7 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should take fullPage screenshots when default viewport is null', async ({server, browser}) => { + browserTest('should take fullPage screenshots when default viewport is null', async ({server, browser}) => { const context = await browser.newContext({ viewport: null }); const page = await context.newPage(); await page.goto(server.PREFIX + '/grid.html'); @@ -279,7 +343,7 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should restore default viewport after fullPage screenshot', async ({ browser }) => { + browserTest('should restore default viewport after fullPage screenshot', async ({ browser }) => { const context = await browser.newContext({ viewport: { width: 456, height: 789 } }); const page = await context.newPage(); await verifyViewport(page, 456, 789); @@ -289,9 +353,9 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should restore viewport after page screenshot and exception', (test, { mode }) => { - test.skip(mode !== 'default'); - }, async ({ browser, server }) => { + browserTest('should restore viewport after page screenshot and exception', async ({ browser, server, mode }) => { + browserTest.skip(mode !== 'default'); + const context = await browser.newContext({ viewport: { width: 350, height: 360 } }); const page = await context.newPage(); await page.goto(server.PREFIX + '/grid.html'); @@ -302,9 +366,9 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should restore viewport after page screenshot and timeout', (test, { mode }) => { - test.skip(mode !== 'default'); - }, async ({ browser, server }) => { + browserTest('should restore viewport after page screenshot and timeout', async ({ browser, server, mode }) => { + browserTest.skip(mode !== 'default'); + const context = await browser.newContext({ viewport: { width: 350, height: 360 } }); const page = await context.newPage(); await page.goto(server.PREFIX + '/grid.html'); @@ -318,7 +382,7 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should take element screenshot when default viewport is null and restore back', async ({server, browser}) => { + browserTest('should take element screenshot when default viewport is null and restore back', async ({server, browser}) => { const context = await browser.newContext({viewport: null}); const page = await context.newPage(); await page.setContent(` @@ -348,9 +412,9 @@ describe('element screenshot', (suite, parameters) => { await context.close(); }); - it('should restore viewport after element screenshot and exception', (test, { mode }) => { - test.skip(mode !== 'default'); - }, async ({browser}) => { + browserTest('should restore viewport after element screenshot and exception', async ({browser, mode}) => { + browserTest.skip(mode !== 'default'); + const context = await browser.newContext({ viewport: { width: 350, height: 360 } }); const page = await context.newPage(); await page.setContent(`
`); @@ -361,58 +425,4 @@ describe('element screenshot', (suite, parameters) => { await verifyViewport(page, 350, 360); await context.close(); }); - - it('should wait for element to stop moving', async ({ page, server }) => { - await page.setViewportSize({ width: 500, height: 500 }); - await page.goto(server.PREFIX + '/grid.html'); - const elementHandle = await page.$('.box:nth-of-type(3)'); - await elementHandle.evaluate(e => { - e.classList.add('animation'); - return new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f))); - }); - const screenshot = await elementHandle.screenshot(); - expect(screenshot).toMatchSnapshot('screenshot-element-bounding-box.png'); - }); - - it('should take screenshot of disabled button', async ({page}) => { - await page.setViewportSize({ width: 500, height: 500 }); - await page.setContent(``); - const button = await page.$('button'); - const screenshot = await button.screenshot(); - expect(screenshot).toBeInstanceOf(Buffer); - }); - - it('path option should create subdirectories', async ({page, server, testInfo}) => { - await page.setViewportSize({width: 500, height: 500}); - await page.goto(server.PREFIX + '/grid.html'); - await page.evaluate(() => window.scrollBy(50, 100)); - const elementHandle = await page.$('.box:nth-of-type(3)'); - const outputPath = testInfo.outputPath(path.join('these', 'are', 'directories', 'screenshot.png')); - await elementHandle.screenshot({path: outputPath}); - expect(await fs.promises.readFile(outputPath)).toMatchSnapshot('screenshot-element-bounding-box.png'); - }); - - it('should prefer type over extension', async ({page, server, testInfo}) => { - await page.setViewportSize({width: 500, height: 500}); - await page.goto(server.PREFIX + '/grid.html'); - await page.evaluate(() => window.scrollBy(50, 100)); - const elementHandle = await page.$('.box:nth-of-type(3)'); - const outputPath = testInfo.outputPath('file.png'); - const buffer = await elementHandle.screenshot({ path: outputPath, type: 'jpeg' }); - expect([buffer[0], buffer[1], buffer[2]]).toEqual([0xFF, 0xD8, 0xFF]); - }); - - it('should not issue resize event', async ({page, server}) => { - await page.goto(server.PREFIX + '/grid.html'); - let resizeTriggered = false; - await page.exposeFunction('resize', () => { - resizeTriggered = true; - }); - await page.evaluate(() => { - window.addEventListener('resize', () => (window as any).resize()); - }); - const elementHandle = await page.$('.box:nth-of-type(3)'); - await elementHandle.screenshot(); - expect(resizeTriggered).toBeFalsy(); - }); }); diff --git a/test/emulation-focus.spec.ts b/tests/emulation-focus.spec.ts similarity index 93% rename from test/emulation-focus.spec.ts rename to tests/emulation-focus.spec.ts index 75d9b1abba..ed47bc8d0d 100644 --- a/test/emulation-focus.spec.ts +++ b/tests/emulation-focus.spec.ts @@ -15,8 +15,9 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; +import { attachFrame } from '../test/utils'; it('should think that it is focused by default', async ({page}) => { expect(await page.evaluate('document.hasFocus()')).toBe(true); @@ -101,9 +102,10 @@ it('should change document.activeElement', async ({page, server}) => { expect(active).toEqual(['INPUT', 'TEXTAREA']); }); -it('should not affect screenshots', (test, { browserName, headful }) => { - test.skip(browserName === 'firefox' && headful); -}, async ({page, server}) => { +it('should not affect screenshots', async ({page, server, browserName, headful}) => { + it.skip(browserName === 'firefox' && headful); + it.skip(!!process.env.PW_ANDROID_TESTS); + // Firefox headful produces a different image. const page2 = await page.context().newPage(); await Promise.all([ @@ -173,7 +175,7 @@ it('should change focused iframe', async ({page, server}) => { }); // @see https://github.com/microsoft/playwright/issues/3476 -it('should focus with more than one page/context', async ({contextFactory}) => { +browserTest('should focus with more than one page/context', async ({contextFactory}) => { const page1 = await (await contextFactory()).newPage(); const page2 = await (await contextFactory()).newPage(); await page1.setContent(``); diff --git a/tests/folio/src/dispatcher.ts b/tests/folio/src/dispatcher.ts index e94129bd79..18c4b7ca3b 100644 --- a/tests/folio/src/dispatcher.ts +++ b/tests/folio/src/dispatcher.ts @@ -66,12 +66,12 @@ export class Dispatcher { const shard = this._loader.config().shard; if (shard) { - total = 0; const shardSize = Math.ceil(total / shard.total); const from = shardSize * shard.current; const to = shardSize * (shard.current + 1); shardDetails = `, shard ${shard.current + 1} of ${shard.total}`; let current = 0; + total = 0; const filteredQueue: DispatcherEntry[] = []; for (const entry of this._queue) { if (current >= from && current < to) { @@ -183,24 +183,28 @@ export class Dispatcher { // When worker encounters error, we will stop it and create a new one. worker.stop(); - // In case of fatal error, we are done with the entry. + let remaining = params.remaining; + const failedTestIds = new Set(); + + // In case of fatal error, report all remaining tests as failing with this error. if (params.fatalError) { - // Report all the tests are failing with this error. - for (const { testId } of entry.runPayload.entries) { + for (const { testId } of remaining) { const { test, result } = this._testById.get(testId); this._reporter.onTestBegin(test); result.error = params.fatalError; this._reportTestEnd(test, result, 'failed'); + failedTestIds.add(testId); } - doneCallback(); - return; + // Since we pretent that all remaining tests failed, there is nothing else to run, + // except for possible retries. + remaining = []; } - - const remaining = params.remaining; + if (params.failedTestId) + failedTestIds.add(params.failedTestId); // Only retry expected failures, not passes and only if the test failed. - if (this._loader.config().retries && params.failedTestId) { - const pair = this._testById.get(params.failedTestId); + for (const testId of failedTestIds) { + const pair = this._testById.get(testId); if (pair.test.expectedStatus === 'passed' && pair.test.results.length < this._loader.config().retries + 1) { pair.result = pair.test._appendTestResult(); remaining.unshift({ diff --git a/test/frame-evaluate.spec.ts b/tests/frame-evaluate.spec.ts similarity index 91% rename from test/frame-evaluate.spec.ts rename to tests/frame-evaluate.spec.ts index 1ffe8ddc76..aa8f1706c4 100644 --- a/test/frame-evaluate.spec.ts +++ b/tests/frame-evaluate.spec.ts @@ -15,9 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame, detachFrame } from './utils'; - +import { test as it, expect } from './config/pageTest'; +import { attachFrame, detachFrame } from '../test/utils'; import type { Frame } from '../src/client/frame'; it('should have different execution contexts', async ({ page, server }) => { @@ -44,9 +43,9 @@ function expectContexts(pageImpl, count, isChromium) { expect(pageImpl._delegate._contextIdToContext.size).toBe(count); } -it('should dispose context on navigation', (test, { mode }) => { - test.skip(mode !== 'default'); -}, async ({ page, server, toImpl, isChromium }) => { +it('should dispose context on navigation', async ({ page, server, toImpl, isChromium, mode }) => { + it.skip(mode !== 'default'); + await page.goto(server.PREFIX + '/frames/one-frame.html'); expect(page.frames().length).toBe(2); expectContexts(toImpl(page), 4, isChromium); @@ -54,9 +53,9 @@ it('should dispose context on navigation', (test, { mode }) => { expectContexts(toImpl(page), 2, isChromium); }); -it('should dispose context on cross-origin navigation', (test, { mode }) => { - test.skip(mode !== 'default'); -}, async ({ page, server, toImpl, isChromium }) => { +it('should dispose context on cross-origin navigation', async ({ page, server, toImpl, isChromium, mode }) => { + it.skip(mode !== 'default'); + await page.goto(server.PREFIX + '/frames/one-frame.html'); expect(page.frames().length).toBe(2); expectContexts(toImpl(page), 4, isChromium); @@ -98,6 +97,8 @@ it('should allow cross-frame element handles', async ({ page, server }) => { }); it('should not allow cross-frame element handles when frames do not script each other', async ({ page, server }) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); const frame = await attachFrame(page, 'frame1', server.CROSS_PROCESS_PREFIX + '/empty.html'); const bodyHandle = await frame.$('body'); @@ -132,10 +133,10 @@ it('should be isolated between frames', async ({page, server}) => { expect(a2).toBe(2); }); -it('should work in iframes that failed initial navigation', (test, { browserName }) => { - test.fail(browserName === 'chromium'); - test.fixme(browserName === 'firefox'); -}, async ({page}) => { +it('should work in iframes that failed initial navigation', async ({page, browserName}) => { + it.fail(browserName === 'chromium'); + it.fixme(browserName === 'firefox'); + // - Firefox does not report domcontentloaded for the iframe. // - Chromium and Firefox report empty url. // - Chromium does not report main/utility worlds for the iframe. @@ -156,9 +157,9 @@ it('should work in iframes that failed initial navigation', (test, { browserName expect(await page.frames()[1].$('div')).toBeTruthy(); }); -it('should work in iframes that interrupted initial javascript url navigation', (test, { browserName }) => { - test.fixme(browserName === 'chromium'); -}, async ({page, server}) => { +it('should work in iframes that interrupted initial javascript url navigation', async ({page, server, browserName}) => { + it.fixme(browserName === 'chromium'); + // Chromium does not report isolated world for the iframe. await page.goto(server.EMPTY_PAGE); await page.evaluate(() => { diff --git a/test/frame-frame-element.spec.ts b/tests/frame-frame-element.spec.ts similarity index 95% rename from test/frame-frame-element.spec.ts rename to tests/frame-frame-element.spec.ts index 033c1e8a10..692183c86e 100644 --- a/test/frame-frame-element.spec.ts +++ b/tests/frame-frame-element.spec.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame } from '../test/utils'; it('should work', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/frame-goto.spec.ts b/tests/frame-goto.spec.ts similarity index 95% rename from test/frame-goto.spec.ts rename to tests/frame-goto.spec.ts index 7ff31ca203..b2ab907b08 100644 --- a/test/frame-goto.spec.ts +++ b/tests/frame-goto.spec.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame } from '../test/utils'; it('should navigate subframes', async ({page, server}) => { await page.goto(server.PREFIX + '/frames/one-frame.html'); @@ -41,6 +41,8 @@ it('should reject when frame detaches', async ({page, server}) => { }); it('should continue after client redirect', async ({page, server}) => { + it.fixme(!!process.env.PW_ANDROID_TESTS); + server.setRoute('/frames/script.js', () => {}); const url = server.PREFIX + '/frames/child-redirect.html'; const error = await page.goto(url, { timeout: 5000, waitUntil: 'networkidle' }).catch(e => e); diff --git a/test/frame-hierarchy.spec.ts b/tests/frame-hierarchy.spec.ts similarity index 96% rename from test/frame-hierarchy.spec.ts rename to tests/frame-hierarchy.spec.ts index b6289e6177..11d4dcbedf 100644 --- a/test/frame-hierarchy.spec.ts +++ b/tests/frame-hierarchy.spec.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame, detachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame, detachFrame } from '../test/utils'; import type { Frame } from '../index'; function dumpFrames(frame: Frame, indentation: string = ''): string[] { @@ -36,6 +36,8 @@ function dumpFrames(frame: Frame, indentation: string = ''): string[] { } it('should handle nested frames', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.PREFIX + '/frames/nested-frames.html'); expect(dumpFrames(page.mainFrame())).toEqual([ 'http://localhost:/frames/nested-frames.html', @@ -189,9 +191,9 @@ it('should report different frame instance when frame re-attaches', async ({page expect(frame1).not.toBe(frame2); }); -it('should refuse to display x-frame-options:deny iframe', (test, { browserName }) => { - test.fixme(browserName === 'firefox'); -}, async ({page, server}) => { +it('should refuse to display x-frame-options:deny iframe', async ({page, server, browserName}) => { + it.fixme(browserName === 'firefox'); + server.setRoute('/x-frame-options-deny.html', async (req, res) => { res.setHeader('Content-Type', 'text/html'); res.setHeader('X-Frame-Options', 'DENY'); diff --git a/test/interception.spec.ts b/tests/interception.spec.ts similarity index 90% rename from test/interception.spec.ts rename to tests/interception.spec.ts index d830944376..7826ded8ee 100644 --- a/test/interception.spec.ts +++ b/tests/interception.spec.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; - +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; import { globToRegex } from '../lib/client/clientHelper'; import vm from 'vm'; @@ -34,7 +34,7 @@ it('should work with navigation', async ({page, server}) => { expect(requests.get('style.css').isNavigationRequest()).toBe(false); }); -it('should work with ignoreHTTPSErrors', async ({browser, httpsServer}) => { +browserTest('should work with ignoreHTTPSErrors', async ({browser, httpsServer}) => { const context = await browser.newContext({ ignoreHTTPSErrors: true }); const page = await context.newPage(); @@ -44,7 +44,9 @@ it('should work with ignoreHTTPSErrors', async ({browser, httpsServer}) => { await context.close(); }); -it('should intercept after a service worker', async ({browser, page, server, context}) => { +it('should intercept after a service worker', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.PREFIX + '/serviceworkers/fetchdummy/sw.html'); await page.evaluate(() => window['activationPromise']); @@ -89,6 +91,8 @@ it('should work with glob', async () => { }); it('should intercept network activity from worker', async function({page, server}) { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); server.setRoute('/data_for_worker', (req, res) => res.end('failed to intercept')); const url = server.PREFIX + '/data_for_worker'; @@ -107,7 +111,9 @@ it('should intercept network activity from worker', async function({page, server expect(msg.text()).toBe('intercepted'); }); -it('should intercept network activity from worker', async function({page, server}) { +it('should intercept network activity from worker 2', async function({page, server}) { + it.skip(!!process.env.PW_ANDROID_TESTS); + const url = server.PREFIX + '/worker/worker.js'; await page.route(url, route => { route.fulfill({ @@ -147,10 +153,10 @@ it('should work with regular expression passed from a different context', async expect(intercepted).toBe(true); }); -it('should not break remote worker importScripts', (test, { browserName }) => { - test.fail(browserName === 'chromium'); -}, async ({ page, server, context }) => { - context.route('**', async request => { +it('should not break remote worker importScripts', async ({ page, server, browserName }) => { + it.fail(browserName === 'chromium'); + + await page.route('**', async request => { await request.continue(); }); await page.goto(server.PREFIX + '/worker/worker-http-import.html'); diff --git a/test/network-post-data.spec.ts b/tests/network-post-data.spec.ts similarity index 95% rename from test/network-post-data.spec.ts rename to tests/network-post-data.spec.ts index 16f6b90a15..169bb52152 100644 --- a/test/network-post-data.spec.ts +++ b/tests/network-post-data.spec.ts @@ -14,7 +14,11 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; + +it.beforeEach(async () => { + it.skip(!!process.env.PW_ANDROID_TESTS); +}); it('should return correct postData buffer for utf-8 body', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/page-accessibility.spec.ts b/tests/page-accessibility.spec.ts similarity index 94% rename from test/page-accessibility.spec.ts rename to tests/page-accessibility.spec.ts index 262d36c912..3e281affee 100644 --- a/test/page-accessibility.spec.ts +++ b/tests/page-accessibility.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { it, expect, describe } from './fixtures'; +import { test as it, expect } from './config/pageTest'; it('should work', async ({ page, isFirefox, isChromium }) => { await page.setContent(` @@ -139,9 +139,9 @@ it('should not report text nodes inside controls', async function({page, isFiref expect(await page.accessibility.snapshot()).toEqual(golden); }); -it('rich text editable fields should have children', (test, { browserName }) => { - test.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); -}, async function({page, isFirefox}) { +it('rich text editable fields should have children', async function({page, isFirefox, browserName}) { + it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); + await page.setContent(`
Edit this image: my fake image @@ -172,9 +172,9 @@ it('rich text editable fields should have children', (test, { browserName }) => expect(snapshot.children[0]).toEqual(golden); }); -it('rich text editable fields with role should have children', (test, { browserName }) => { - test.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); -}, async function({page, isFirefox}) { +it('rich text editable fields with role should have children', async function({page, isFirefox, browserName}) { + it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); + await page.setContent(`
Edit this image: my fake image @@ -203,10 +203,12 @@ it('rich text editable fields with role should have children', (test, { browserN expect(snapshot.children[0]).toEqual(golden); }); -describe('contenteditable', (suite, { browserName }) => { - suite.skip(browserName === 'firefox', 'Firefox does not support contenteditable="plaintext-only"'); - suite.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); -}, () => { +it.describe('contenteditable', () => { + it.beforeEach(async ({browserName}) => { + it.skip(browserName === 'firefox', 'Firefox does not support contenteditable="plaintext-only"'); + it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); + }); + it('plain text field with role should not have children', async function({page}) { await page.setContent(`
Edit this image:my fake image
`); diff --git a/test/page-autowaiting-basic.spec.ts b/tests/page-autowaiting-basic.spec.ts similarity index 97% rename from test/page-autowaiting-basic.spec.ts rename to tests/page-autowaiting-basic.spec.ts index c4cb6ffdd3..01306c16a2 100644 --- a/test/page-autowaiting-basic.spec.ts +++ b/tests/page-autowaiting-basic.spec.ts @@ -16,7 +16,7 @@ */ import { TestServer } from '../utils/testserver'; -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; function initServer(server: TestServer): string[] { const messages = []; @@ -28,6 +28,10 @@ function initServer(server: TestServer): string[] { return messages; } +it.beforeEach(async () => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'Too flaky on Android'); +}); + it('should await navigation when clicking anchor', async ({page, server}) => { const messages = initServer(server); await page.setContent(`empty.html`); @@ -208,9 +212,9 @@ it('should work with goto following click', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); }); -it('should report navigation in the log when clicking anchor', (test, { mode }) => { - test.skip(mode !== 'default'); -}, async ({page, server}) => { +it('should report navigation in the log when clicking anchor', async ({page, server, mode}) => { + it.skip(mode !== 'default'); + await page.setContent(`click me`); const __testHookAfterPointerAction = () => new Promise(f => setTimeout(f, 6000)); const error = await page.click('a', { timeout: 5000, __testHookAfterPointerAction } as any).catch(e => e); diff --git a/test/page-autowaiting-no-hang.spec.ts b/tests/page-autowaiting-no-hang.spec.ts similarity index 97% rename from test/page-autowaiting-no-hang.spec.ts rename to tests/page-autowaiting-no-hang.spec.ts index 0a6a278d91..a725641acb 100644 --- a/test/page-autowaiting-no-hang.spec.ts +++ b/tests/page-autowaiting-no-hang.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { it } from './fixtures'; + +import { test as it } from './config/pageTest'; it('clicking on links which do not commit navigation', async ({page, server, httpsServer}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/page-basic.spec.ts b/tests/page-basic.spec.ts similarity index 97% rename from test/page-basic.spec.ts rename to tests/page-basic.spec.ts index 1996e587c6..0798bbe1a1 100644 --- a/test/page-basic.spec.ts +++ b/tests/page-basic.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; it('should reject all promises when page is closed', async ({page}) => { let error = null; @@ -33,6 +33,8 @@ it('should set the page close state', async ({page}) => { }); it('should pass page to close event', async ({page}) => { + it.fixme(!!process.env.PW_ANDROID_TESTS); + const [closedPage] = await Promise.all([ page.waitForEvent('close'), page.close() @@ -120,6 +122,8 @@ it('should pass self as argument to load event', async ({page}) => { }); it('should fail with error upon disconnect', async ({page}) => { + it.fixme(!!process.env.PW_ANDROID_TESTS); + let error; const waitForPromise = page.waitForEvent('download').catch(e => error = e); await page.close(); @@ -177,6 +181,8 @@ it('page.frame should respect url', async function({page, server}) { }); it('should have sane user agent', async ({page, isChromium, isFirefox}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + const userAgent = await page.evaluate(() => navigator.userAgent); const [ part1, diff --git a/tests/page-click-react.spec.ts b/tests/page-click-react.spec.ts index d41c75ce5e..c966b72f0c 100644 --- a/tests/page-click-react.spec.ts +++ b/tests/page-click-react.spec.ts @@ -22,7 +22,7 @@ declare const e; declare const MyButton; it('should report that selector does not match anymore', async ({page, server}) => { - it.fail(); + it.fixme(); await page.goto(server.PREFIX + '/react.html'); await page.evaluate(() => { diff --git a/test/page-close.spec.ts b/tests/page-close.spec.ts similarity index 88% rename from test/page-close.spec.ts rename to tests/page-close.spec.ts index fb25bb9805..d6a15309aa 100644 --- a/test/page-close.spec.ts +++ b/tests/page-close.spec.ts @@ -15,10 +15,9 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; -it('should close page with active dialog', async ({context}) => { - const page = await context.newPage(); +it('should close page with active dialog', async ({page}) => { await page.setContent(``); page.click('button'); await page.waitForEvent('dialog'); diff --git a/test/page-drag.spec.ts b/tests/page-drag.spec.ts similarity index 89% rename from test/page-drag.spec.ts rename to tests/page-drag.spec.ts index 5bd1566e1a..d8393d73e3 100644 --- a/test/page-drag.spec.ts +++ b/tests/page-drag.spec.ts @@ -13,13 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ElementHandle } from '..'; -import { it, expect, describe } from './fixtures'; -import { attachFrame } from './utils'; -describe('Drag and drop', (test, {browserName}) => { - test.fixme(browserName === 'chromium'); -}, () => { +import type { ElementHandle } from '../index'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame } from '../test/utils'; + +it.describe('Drag and drop', () => { + it.beforeEach(async ({ browserName }) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + it.fixme(browserName === 'chromium'); + }); + it('should work', async ({page, server}) => { await page.goto(server.PREFIX + '/drag-n-drop.html'); await page.hover('#source'); @@ -69,9 +73,11 @@ describe('Drag and drop', (test, {browserName}) => { ]); }); - describe('iframe', (test, {}) => { - test.fixme('implement dragging with iframes'); - }, () => { + it.describe('iframe', () => { + it.beforeEach(async () => { + it.fixme('implement dragging with iframes'); + }); + it('should drag into an iframe', async ({server, page, isFirefox}) => { await page.goto(server.PREFIX + '/drag-n-drop.html'); const frame = await attachFrame(page, 'oopif',server.PREFIX + '/drag-n-drop.html'); @@ -119,11 +125,11 @@ describe('Drag and drop', (test, {browserName}) => { }); }); - it('should respect the drop effect', (test, {browserName, platform}) => { - test.fixme(browserName === 'chromium', 'Chromium doesn\'t let users set dropEffect on our fake data transfer'); - test.fixme(browserName === 'webkit' && platform !== 'linux', 'WebKit doesn\'t handle the drop effect correctly outside of linux.'); - test.fixme(browserName === 'firefox'); - }, async ({page}) => { + it('should respect the drop effect', async ({page, browserName, platform}) => { + it.fixme(browserName === 'chromium', 'Chromium doesn\'t let users set dropEffect on our fake data transfer'); + it.fixme(browserName === 'webkit' && platform !== 'linux', 'WebKit doesn\'t handle the drop effect correctly outside of linux.'); + it.fixme(browserName === 'firefox'); + expect(await testIfDropped('copy', 'copy')).toBe(true); expect(await testIfDropped('copy', 'move')).toBe(false); expect(await testIfDropped('all', 'link')).toBe(true); diff --git a/test/page-emulate-media.spec.ts b/tests/page-emulate-media.spec.ts similarity index 94% rename from test/page-emulate-media.spec.ts rename to tests/page-emulate-media.spec.ts index df6ed0d2fe..6d7015f07f 100644 --- a/test/page-emulate-media.spec.ts +++ b/tests/page-emulate-media.spec.ts @@ -15,8 +15,13 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; +import { attachFrame } from '../test/utils'; + +it.beforeEach(async () => { + it.skip(!!process.env.PW_ANDROID_TESTS); +}); it('should emulate type', async ({page}) => { expect(await page.evaluate(() => matchMedia('screen').matches)).toBe(true); @@ -81,7 +86,7 @@ it('should work during navigation', async ({page, server}) => { expect(await page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches)).toBe(true); }); -it('should work in popup', async ({browser, server}) => { +browserTest('should work in popup', async ({browser, server}) => { { const context = await browser.newContext({ colorScheme: 'dark' }); const page = await context.newPage(); @@ -107,7 +112,7 @@ it('should work in popup', async ({browser, server}) => { } }); -it('should work in cross-process iframe', async ({browser, server}) => { +browserTest('should work in cross-process iframe', async ({browser, server}) => { const page = await browser.newPage({ colorScheme: 'dark' }); await page.goto(server.EMPTY_PAGE); await attachFrame(page, 'frame1', server.CROSS_PROCESS_PREFIX + '/empty.html'); diff --git a/test/page-expose-function.spec.ts b/tests/page-expose-function.spec.ts similarity index 95% rename from test/page-expose-function.spec.ts rename to tests/page-expose-function.spec.ts index 1b570c5500..669b680cfa 100644 --- a/test/page-expose-function.spec.ts +++ b/tests/page-expose-function.spec.ts @@ -15,9 +15,9 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; -import type { ElementHandle } from '..'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame } from '../test/utils'; +import type { ElementHandle } from '../index'; it('exposeBinding should work', async ({page}) => { let bindingSource; @@ -223,6 +223,8 @@ it('exposeBindingHandle should throw for multiple arguments', async ({page}) => }); it('should not result in unhandled rejection', async ({page}) => { + it.fixme(!!process.env.PW_ANDROID_TESTS); + const closedPromise = page.waitForEvent('close'); await page.exposeFunction('foo', async () => { await page.close(); @@ -236,10 +238,11 @@ it('should not result in unhandled rejection', async ({page}) => { expect(await page.evaluate('1 + 1').catch(e => e)).toBeInstanceOf(Error); }); -it('should work with internal bindings', (test, { mode, browserName }) => { - test.skip(mode !== 'default'); - test.skip(browserName !== 'chromium'); -}, async ({page, toImpl, server}) => { +it('should work with internal bindings', async ({page, toImpl, server, mode, browserName}) => { + it.skip(mode !== 'default'); + it.skip(browserName !== 'chromium'); + it.skip(!!process.env.PW_ANDROID_TESTS); + const implPage: import('../src/server/page').Page = toImpl(page); let foo; await implPage.exposeBinding('foo', false, ({}, arg) => { diff --git a/test/page-focus.spec.ts b/tests/page-focus.spec.ts similarity index 89% rename from test/page-focus.spec.ts rename to tests/page-focus.spec.ts index 992e07036f..5c66400ca0 100644 --- a/test/page-focus.spec.ts +++ b/tests/page-focus.spec.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; + +it('should work', async function({page, browserName}) { + it.skip(browserName === 'firefox'); -it('should work', (test, { browserName }) => { - test.skip(browserName === 'firefox'); -}, async function({page}) { await page.setContent(`
`); expect(await page.evaluate(() => document.activeElement.nodeName)).toBe('BODY'); await page.focus('#d1'); @@ -78,10 +78,10 @@ it('should traverse focus in all directions', async function({page}) { expect(await page.evaluate(() => (document.activeElement as HTMLInputElement).value)).toBe('1'); }); -it('should traverse only form elements', (test, { browserName, platform }) => { - test.skip(platform !== 'darwin' || browserName !== 'webkit', +it('should traverse only form elements', async function({page, browserName, platform}) { + it.skip(platform !== 'darwin' || browserName !== 'webkit', 'Chromium and WebKit both have settings for tab traversing all links, but it is only on by default in WebKit.'); -}, async function({page}) { + await page.setContent(` @@ -108,10 +108,10 @@ it('should traverse only form elements', (test, { browserName, platform }) => { expect(await page.evaluate(() => document.activeElement.id)).toBe('input-1'); }); -it('clicking checkbox should activate it', (test, { browserName, headful, platform }) => { - test.fixme(browserName === 'webkit' && !headful); - test.fixme(browserName === 'firefox' && !headful && platform === 'darwin'); -}, async ({ page }) => { +it('clicking checkbox should activate it', async ({ page, browserName, headful, platform }) => { + it.fixme(browserName === 'webkit' && !headful); + it.fixme(browserName === 'firefox' && !headful && platform === 'darwin'); + await page.setContent(``); await page.click('input'); const nodeName = await page.evaluate(() => document.activeElement.nodeName); diff --git a/test/page-goto.spec.ts b/tests/page-goto.spec.ts similarity index 94% rename from test/page-goto.spec.ts rename to tests/page-goto.spec.ts index 3bb32ef8c5..0695e63bef 100644 --- a/test/page-goto.spec.ts +++ b/tests/page-goto.spec.ts @@ -17,8 +17,9 @@ import path from 'path'; import url from 'url'; -import { expect, it } from './fixtures'; -import { expectedSSLError } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { slowTest } from './config/browserTest'; +import { expectedSSLError } from '../test/utils'; it('should work', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); @@ -26,13 +27,17 @@ it('should work', async ({page, server}) => { }); it('should work with file URL', async ({page}) => { - const fileurl = url.pathToFileURL(path.join(__dirname, 'assets', 'frames', 'two-frames.html')).href; + it.skip(!!process.env.PW_ANDROID_TESTS, 'No files on Android'); + + const fileurl = url.pathToFileURL(path.join(__dirname, '..', 'test', 'assets', 'frames', 'two-frames.html')).href; await page.goto(fileurl); expect(page.url().toLowerCase()).toBe(fileurl.toLowerCase()); expect(page.frames().length).toBe(3); }); it('should use http for no protocol', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE.substring('http://'.length)); expect(page.url()).toBe(server.EMPTY_PAGE); }); @@ -233,6 +238,8 @@ it('should fail when exceeding maximum navigation timeout', async ({page, server }); it('should fail when exceeding default maximum navigation timeout', async ({page, server, playwright}) => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'No context per test'); + // Hang for request to the empty.html server.setRoute('/empty.html', (req, res) => { }); let error = null; @@ -245,6 +252,8 @@ it('should fail when exceeding default maximum navigation timeout', async ({page }); it('should fail when exceeding browser context navigation timeout', async ({page, server, playwright}) => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'No context per test'); + // Hang for request to the empty.html server.setRoute('/empty.html', (req, res) => { }); let error = null; @@ -256,6 +265,8 @@ it('should fail when exceeding browser context navigation timeout', async ({page }); it('should fail when exceeding default maximum timeout', async ({page, server, playwright}) => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'No context per test'); + // Hang for request to the empty.html server.setRoute('/empty.html', (req, res) => { }); let error = null; @@ -268,6 +279,8 @@ it('should fail when exceeding default maximum timeout', async ({page, server, p }); it('should fail when exceeding browser context timeout', async ({page, server, playwright}) => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'No context per test'); + // Hang for request to the empty.html server.setRoute('/empty.html', (req, res) => { }); let error = null; @@ -360,9 +373,9 @@ it('should not leak listeners during bad navigation', async ({page, server}) => expect(warning).toBe(null); }); -it('should not leak listeners during navigation of 20 pages', (test, parameters) => { - test.slow('We open 20 pages here'); -}, async ({page, context, server}) => { +// We open 20 pages here! +slowTest('should not leak listeners during navigation of 20 pages', async ({contextFactory, server}) => { + const context = await contextFactory(); let warning = null; const warningHandler = w => warning = w; process.on('warning', warningHandler); @@ -373,7 +386,7 @@ it('should not leak listeners during navigation of 20 pages', (test, parameters) expect(warning).toBe(null); }); -it('should not leak listeners during 20 waitForNavigation', async ({page, context, server}) => { +it('should not leak listeners during 20 waitForNavigation', async ({page, server}) => { let warning = null; const warningHandler = w => warning = w; process.on('warning', warningHandler); @@ -482,10 +495,10 @@ it('should work with lazy loading iframes', async ({page, server}) => { expect(page.frames().length).toBe(2); }); -it('should report raw buffer for main resource', (test, { browserName, platform }) => { - test.fail(browserName === 'chromium', 'Chromium sends main resource as text'); - test.fail(browserName === 'webkit' && platform === 'win32', 'Same here'); -}, async ({page, server, playwright}) => { +it('should report raw buffer for main resource', async ({page, server, browserName, platform}) => { + it.fail(browserName === 'chromium', 'Chromium sends main resource as text'); + it.fail(browserName === 'webkit' && platform === 'win32', 'Same here'); + server.setRoute('/empty.html', (req, res) => { res.statusCode = 200; res.end(Buffer.from('Ü (lowercase ü)', 'utf-8')); diff --git a/test/page-history.spec.ts b/tests/page-history.spec.ts similarity index 94% rename from test/page-history.spec.ts rename to tests/page-history.spec.ts index b10a9419e1..4fd72dfa77 100644 --- a/test/page-history.spec.ts +++ b/tests/page-history.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; import url from 'url'; it('page.goBack should work', async ({page, server}) => { @@ -52,9 +52,10 @@ it('page.goBack should work with HistoryAPI', async ({page, server}) => { expect(page.url()).toBe(server.PREFIX + '/first.html'); }); -it('page.goBack should work for file urls', (test, { browserName, platform }) => { - test.fail(browserName === 'webkit' && platform === 'darwin'); -}, async ({page, server, asset}) => { +it('page.goBack should work for file urls', async ({page, server, asset, browserName, platform}) => { + it.fail(browserName === 'webkit' && platform === 'darwin'); + it.skip(!!process.env.PW_ANDROID_TESTS, 'No files on Android'); + // WebKit embedder fails to go back/forward to the file url. const url1 = url.pathToFileURL(asset('empty.html')).href; const url2 = server.EMPTY_PAGE; diff --git a/test/page-in-context.spec.ts b/tests/page-in-context.spec.ts similarity index 85% rename from test/page-in-context.spec.ts rename to tests/page-in-context.spec.ts index db1b32e436..5e1109fb50 100644 --- a/test/page-in-context.spec.ts +++ b/tests/page-in-context.spec.ts @@ -15,21 +15,25 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/browserTest'; +import { attachFrame } from '../test/utils'; -it('should not be visible in context.pages', async ({page, context}) => { +it('should not be visible in context.pages', async ({contextFactory}) => { + const context = await contextFactory(); + const page = await context.newPage(); expect(context.pages()).toContain(page); await page.close(); expect(context.pages()).not.toContain(page); }); - -it('page.context should return the correct instance', async function({page, context}) { +it('page.context should return the correct instance', async function({contextFactory}) { + const context = await contextFactory(); + const page = await context.newPage(); expect(page.context()).toBe(context); }); -it('frame.focus should work multiple times', async ({ context }) => { +it('frame.focus should work multiple times', async ({ contextFactory }) => { + const context = await contextFactory(); const page1 = await context.newPage(); const page2 = await context.newPage(); for (const page of [page1, page2]) { @@ -75,9 +79,9 @@ it('should click the button with deviceScaleFactor set', async ({browser, server await context.close(); }); -it('should click the button with offset with page scale', (test, { browserName }) => { - test.skip(browserName === 'firefox'); -}, async ({browser, server, isWebKit, isChromium, headful}) => { +it('should click the button with offset with page scale', async ({browser, server, isWebKit, isChromium, headful, browserName}) => { + it.skip(browserName === 'firefox'); + const context = await browser.newContext({ viewport: { width: 400, height: 400 }, isMobile: true }); const page = await context.newPage(); await page.goto(server.PREFIX + '/input/button.html'); diff --git a/test/page-keyboard.spec.ts b/tests/page-keyboard.spec.ts similarity index 96% rename from test/page-keyboard.spec.ts rename to tests/page-keyboard.spec.ts index 1ff68a6e6d..670eee498f 100644 --- a/test/page-keyboard.spec.ts +++ b/tests/page-keyboard.spec.ts @@ -15,8 +15,12 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame } from '../test/utils'; + +it.beforeEach(async () => { + it.skip(!!process.env.PW_ANDROID_TESTS); +}); it('should type into a textarea', async ({page}) => { await page.evaluate(() => { @@ -83,9 +87,9 @@ it('insertText should only emit input event', async ({page, server}) => { expect(await events.jsonValue()).toEqual(['input']); }); -it('should report shiftKey', (test, { browserName, platform }) => { - test.fail(browserName === 'firefox' && platform === 'darwin'); -}, async ({page, server}) => { +it('should report shiftKey', async ({page, server, browserName, platform}) => { + it.fail(browserName === 'firefox' && platform === 'darwin'); + await page.goto(server.PREFIX + '/input/keyboard.html'); const keyboard = page.keyboard; const codeForKey = {'Shift': 16, 'Alt': 18, 'Control': 17}; @@ -342,11 +346,11 @@ it('should be able to prevent selectAll', async ({page, server, isMac}) => { expect(await page.$eval('textarea', textarea => textarea.value)).toBe('some tex'); }); -it('should support MacOS shortcuts', (test, { platform, browserName }) => { - test.skip(platform !== 'darwin'); +it('should support MacOS shortcuts', async ({page, server, platform, browserName}) => { + it.skip(platform !== 'darwin'); // @see https://github.com/microsoft/playwright/issues/5721 - test.fixme(browserName === 'firefox' && platform === 'darwin'); -}, async ({page, server}) => { + it.fixme(browserName === 'firefox' && platform === 'darwin'); + await page.goto(server.PREFIX + '/input/textarea.html'); const textarea = await page.$('textarea'); await textarea.type('some text'); @@ -385,10 +389,9 @@ it('should work after a cross origin navigation', async ({page, server}) => { expect(await lastEvent.evaluate(l => l.key)).toBe('a'); }); -// event.keyIdentifier has been removed from all browsers except WebKit -it('should expose keyIdentifier in webkit', (test, { browserName }) => { - test.skip(browserName !== 'webkit'); -}, async ({page}) => { +it('should expose keyIdentifier in webkit', async ({page, browserName}) => { + it.skip(browserName !== 'webkit', 'event.keyIdentifier has been removed from all browsers except WebKit'); + const lastEvent = await captureLastKeydown(page); const keyMap = { 'ArrowUp': 'Up', diff --git a/test/page-mouse.spec.ts b/tests/page-mouse.spec.ts similarity index 95% rename from test/page-mouse.spec.ts rename to tests/page-mouse.spec.ts index 485e416c0a..89d7ef6b0f 100644 --- a/test/page-mouse.spec.ts +++ b/tests/page-mouse.spec.ts @@ -15,7 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; function dimensions() { const rect = document.querySelector('textarea').getBoundingClientRect(); @@ -143,6 +144,8 @@ it('should set modifier keys on click', async ({page, server, isFirefox, isMac}) }); it('should tween mouse movement', async ({page, isWebKit}) => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'Bad rounding'); + // The test becomes flaky on WebKit without next line. if (isWebKit) await page.evaluate(() => new Promise(requestAnimationFrame)); @@ -163,9 +166,9 @@ it('should tween mouse movement', async ({page, isWebKit}) => { ]); }); -it('should work with mobile viewports and cross process navigations', (test, { browserName }) => { - test.skip(browserName === 'firefox'); -}, async ({browser, server}) => { +browserTest('should work with mobile viewports and cross process navigations', async ({browser, server, browserName}) => { + browserTest.skip(browserName === 'firefox'); + // @see https://crbug.com/929806 const context = await browser.newContext({ viewport: {width: 360, height: 640}, isMobile: true }); const page = await context.newPage(); diff --git a/test/page-navigation.spec.ts b/tests/page-navigation.spec.ts similarity index 96% rename from test/page-navigation.spec.ts rename to tests/page-navigation.spec.ts index 4f6218e3a9..f66eb4d554 100644 --- a/test/page-navigation.spec.ts +++ b/tests/page-navigation.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { it } from './fixtures'; +import { test as it } from './config/pageTest'; it('should work with _blank target', async ({page, server}) => { server.setRoute('/empty.html', (req, res) => { diff --git a/test/page-network-idle.spec.ts b/tests/page-network-idle.spec.ts similarity index 97% rename from test/page-network-idle.spec.ts rename to tests/page-network-idle.spec.ts index dfc629110e..3293fdeaff 100644 --- a/test/page-network-idle.spec.ts +++ b/tests/page-network-idle.spec.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import type { Frame } from '..'; +import { test as it, expect } from './config/pageTest'; +import type { Frame } from '../index'; import { TestServer } from '../utils/testserver'; it('should navigate to empty page with networkidle', async ({page, server}) => { @@ -139,6 +139,8 @@ it('should wait for networkidle from the child frame', async ({page, server}) => }); it('should wait for networkidle from the popup', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS, 'Too slow'); + await page.goto(server.EMPTY_PAGE); await page.setContent(` diff --git a/test/page-network-request.spec.ts b/tests/page-network-request.spec.ts similarity index 91% rename from test/page-network-request.spec.ts rename to tests/page-network-request.spec.ts index 6e24d4732d..8a7afdb798 100644 --- a/test/page-network-request.spec.ts +++ b/tests/page-network-request.spec.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; -import { attachFrame } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { attachFrame } from '../test/utils'; it('should work for main frame navigation request', async ({page, server}) => { const requests = []; @@ -81,9 +81,9 @@ it('should return headers', async ({page, server, isChromium, isFirefox, isWebKi expect(response.request().headers()['user-agent']).toContain('WebKit'); }); -it('should get the same headers as the server', (test, { browserName, platform }) => { - test.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language'); -}, async ({ page, server }) => { +it('should get the same headers as the server', async ({ page, server, browserName, platform }) => { + it.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language'); + let serverRequest; server.setRoute('/empty.html', (request, response) => { serverRequest = request; @@ -93,9 +93,9 @@ it('should get the same headers as the server', (test, { browserName, platform } expect(response.request().headers()).toEqual(serverRequest.headers); }); -it('should get the same headers as the server CORP', (test, { browserName, platform }) => { - test.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language'); -}, async ({page, server}) => { +it('should get the same headers as the server CORP', async ({page, server, browserName, platform}) => { + it.fail(browserName === 'webkit' && platform === 'win32', 'Curl does not show accept-encoding and accept-language'); + await page.goto(server.PREFIX + '/empty.html'); let serverRequest; server.setRoute('/something', (request, response) => { @@ -114,6 +114,8 @@ it('should get the same headers as the server CORP', (test, { browserName, platf }); it('should return postData', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); server.setRoute('/post', (req, res) => res.end()); let request = null; @@ -124,6 +126,8 @@ it('should return postData', async ({page, server}) => { }); it('should work with binary post data', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); server.setRoute('/post', (req, res) => res.end()); let request = null; @@ -139,6 +143,8 @@ it('should work with binary post data', async ({page, server}) => { }); it('should work with binary post data and interception', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); server.setRoute('/post', (req, res) => res.end()); let request = null; @@ -155,6 +161,8 @@ it('should work with binary post data and interception', async ({page, server}) }); it('should override post data content type', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); let request = null; server.setRoute('/post', (req, res) => { @@ -177,11 +185,15 @@ it('should override post data content type', async ({page, server}) => { }); it('should be |undefined| when there is no post data', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + const response = await page.goto(server.EMPTY_PAGE); expect(response.request().postData()).toBe(null); }); it('should parse the json post data', async ({ page, server }) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); server.setRoute('/post', (req, res) => res.end()); let request = null; @@ -192,6 +204,8 @@ it('should parse the json post data', async ({ page, server }) => { }); it('should parse the data if content-type is application/x-www-form-urlencoded', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.EMPTY_PAGE); server.setRoute('/post', (req, res) => res.end()); let request = null; diff --git a/test/page-network-response.spec.ts b/tests/page-network-response.spec.ts similarity index 94% rename from test/page-network-response.spec.ts rename to tests/page-network-response.spec.ts index 60b04e6dd7..728e341680 100644 --- a/test/page-network-response.spec.ts +++ b/tests/page-network-response.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; import fs from 'fs'; import path from 'path'; @@ -97,7 +97,7 @@ it('should return json', async ({page, server}) => { it('should return body', async ({page, server}) => { const response = await page.goto(server.PREFIX + '/pptr.png'); - const imageBuffer = fs.readFileSync(path.join(__dirname, 'assets', 'pptr.png')); + const imageBuffer = fs.readFileSync(path.join(__dirname, '..', 'test', 'assets', 'pptr.png')); const responseBuffer = await response.body(); expect(responseBuffer.equals(imageBuffer)).toBe(true); }); @@ -105,7 +105,7 @@ it('should return body', async ({page, server}) => { it('should return body with compression', async ({page, server}) => { server.enableGzip('/pptr.png'); const response = await page.goto(server.PREFIX + '/pptr.png'); - const imageBuffer = fs.readFileSync(path.join(__dirname, 'assets', 'pptr.png')); + const imageBuffer = fs.readFileSync(path.join(__dirname, '..', 'test', 'assets', 'pptr.png')); const responseBuffer = await response.body(); expect(responseBuffer.equals(imageBuffer)).toBe(true); }); diff --git a/test/page-request-continue.spec.ts b/tests/page-request-continue.spec.ts similarity index 97% rename from test/page-request-continue.spec.ts rename to tests/page-request-continue.spec.ts index c98bc6316d..d331355a6e 100644 --- a/test/page-request-continue.spec.ts +++ b/tests/page-request-continue.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { it, expect, describe } from './fixtures'; +import { test as it, expect } from './config/pageTest'; it('should work', async ({page, server}) => { await page.route('**/*', route => route.continue()); @@ -96,7 +96,11 @@ it('should amend method on main request', async ({page, server}) => { expect((await request).method).toBe('POST'); }); -describe('', () => { +it.describe('', () => { + it.beforeEach(async () => { + it.skip(!!process.env.PW_ANDROID_TESTS); + }); + it('should amend post data', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); await page.route('**/*', route => { diff --git a/test/page-request-fulfill.spec.ts b/tests/page-request-fulfill.spec.ts similarity index 81% rename from test/page-request-fulfill.spec.ts rename to tests/page-request-fulfill.spec.ts index 61d4c49072..e6a21e906d 100644 --- a/test/page-request-fulfill.spec.ts +++ b/tests/page-request-fulfill.spec.ts @@ -15,7 +15,8 @@ * limitations under the License. */ -import { it, expect } from './fixtures'; +import { test as it, expect } from './config/pageTest'; +import { test as browserTest } from './config/browserTest'; import fs from 'fs'; import path from 'path'; @@ -50,11 +51,12 @@ it('should work with status code 422', async ({page, server}) => { expect(await page.evaluate(() => document.body.textContent)).toBe('Yo, page!'); }); -it('should allow mocking binary responses', (test, { browserName, headful }) => { - test.skip(browserName === 'firefox' && headful, '// Firefox headful produces a different image.'); -}, async ({page, server}) => { +it('should allow mocking binary responses', async ({page, server, browserName, headful}) => { + it.skip(browserName === 'firefox' && headful, 'Firefox headful produces a different image.'); + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.route('**/*', route => { - const imageBuffer = fs.readFileSync(path.join(__dirname, 'assets', 'pptr.png')); + const imageBuffer = fs.readFileSync(path.join(__dirname, '..', 'test', 'assets', 'pptr.png')); route.fulfill({ contentType: 'image/png', body: imageBuffer @@ -70,9 +72,10 @@ it('should allow mocking binary responses', (test, { browserName, headful }) => expect(await img.screenshot()).toMatchSnapshot('mock-binary-response.png'); }); -it('should allow mocking svg with charset', (test, { browserName, headful }) => { - test.skip(browserName === 'firefox' && headful, '// Firefox headful produces a different image.'); -}, async ({page, server}) => { +it('should allow mocking svg with charset', async ({page, server, browserName, headful}) => { + it.skip(browserName === 'firefox' && headful, 'Firefox headful produces a different image.'); + it.skip(!!process.env.PW_ANDROID_TESTS); + // Firefox headful produces a different image. await page.route('**/*', route => { route.fulfill({ @@ -91,7 +94,9 @@ it('should allow mocking svg with charset', (test, { browserName, headful }) => }); it('should work with file path', async ({page, server}) => { - await page.route('**/*', route => route.fulfill({ contentType: 'shouldBeIgnored', path: path.join(__dirname, 'assets', 'pptr.png') })); + it.skip(!!process.env.PW_ANDROID_TESTS); + + await page.route('**/*', route => route.fulfill({ contentType: 'shouldBeIgnored', path: path.join(__dirname, '..', 'test', 'assets', 'pptr.png') })); await page.evaluate(PREFIX => { const img = document.createElement('img'); img.src = PREFIX + '/does-not-exist.png'; @@ -157,6 +162,8 @@ it('should not modify the headers sent to the server', async ({page, server}) => }); it('should include the origin header', async ({page, server}) => { + it.skip(!!process.env.PW_ANDROID_TESTS); + await page.goto(server.PREFIX + '/empty.html'); let interceptedRequest; await page.route(server.CROSS_PROCESS_PREFIX + '/something', (route, request) => { @@ -178,9 +185,11 @@ it('should include the origin header', async ({page, server}) => { expect(interceptedRequest.headers()['origin']).toEqual(server.PREFIX); }); -it('should support Set-Cookie header', (test, { browserName }) => { - test.fixme(browserName === 'webkit'); -}, async ({context, page, server}) => { +browserTest('should support Set-Cookie header', async ({contextFactory, server, browserName}) => { + browserTest.fixme(browserName === 'webkit'); + + const context = await contextFactory(); + const page = await context.newPage(); await page.route('https://example.com/', (route, request) => { route.fulfill({ headers: { @@ -203,9 +212,11 @@ it('should support Set-Cookie header', (test, { browserName }) => { }]); }); -it('should ignore secure Set-Cookie header for insecure requests', (test, { browserName }) => { - test.fixme(browserName === 'webkit'); -}, async ({context, page, server}) => { +browserTest('should ignore secure Set-Cookie header for insecure requests', async ({contextFactory, server, browserName}) => { + browserTest.fixme(browserName === 'webkit'); + + const context = await contextFactory(); + const page = await context.newPage(); await page.route('http://example.com/', (route, request) => { route.fulfill({ headers: { @@ -219,9 +230,12 @@ it('should ignore secure Set-Cookie header for insecure requests', (test, { brow expect(await context.cookies()).toEqual([]); }); -it('should use Set-Cookie header in future requests', (test, { browserName }) => { - test.fixme(browserName === 'webkit'); -}, async ({context, page, server}) => { +browserTest('should use Set-Cookie header in future requests', async ({contextFactory, server, browserName}) => { + browserTest.fixme(browserName === 'webkit'); + + const context = await contextFactory(); + const page = await context.newPage(); + await page.route(server.EMPTY_PAGE, (route, request) => { route.fulfill({ headers: { diff --git a/tests/page-route.spec.ts b/tests/page-route.spec.ts index fe609bab1f..c6a686b7a5 100644 --- a/tests/page-route.spec.ts +++ b/tests/page-route.spec.ts @@ -535,7 +535,7 @@ it('should support cors with GET', async ({page, server}) => { }); it('should support cors with POST', async ({page, server, isChromium, browserChannel}) => { - it.fail(isChromium && !browserChannel, 'https://github.com/microsoft/playwright/issues/6016'); + it.fail(isChromium && !browserChannel && !process.env.PW_ANDROID_TESTS, 'https://github.com/microsoft/playwright/issues/6016'); await page.goto(server.EMPTY_PAGE); await page.route('**/cars', async route => { @@ -559,7 +559,7 @@ it('should support cors with POST', async ({page, server, isChromium, browserCha }); it('should support cors with credentials', async ({page, server, isChromium, browserChannel}) => { - it.fail(isChromium && !browserChannel, 'https://github.com/microsoft/playwright/issues/6016'); + it.fail(isChromium && !browserChannel && !process.env.PW_ANDROID_TESTS, 'https://github.com/microsoft/playwright/issues/6016'); await page.goto(server.EMPTY_PAGE); await page.route('**/cars', async route => { @@ -619,7 +619,7 @@ it('should reject cors with disallowed credentials', async ({page, server}) => { }); it('should support cors for different methods', async ({page, server, isChromium, browserChannel}) => { - it.fail(isChromium && !browserChannel, 'https://github.com/microsoft/playwright/issues/6016'); + it.fail(isChromium && !browserChannel && !process.env.PW_ANDROID_TESTS, 'https://github.com/microsoft/playwright/issues/6016'); await page.goto(server.EMPTY_PAGE); await page.route('**/cars', async (route, request) => { diff --git a/test/page-screenshot.spec.ts b/tests/page-screenshot.spec.ts similarity index 83% rename from test/page-screenshot.spec.ts rename to tests/page-screenshot.spec.ts index e0af838cf8..78e1730d7a 100644 --- a/test/page-screenshot.spec.ts +++ b/tests/page-screenshot.spec.ts @@ -15,17 +15,19 @@ * limitations under the License. */ -import { it, expect, describe } from './fixtures'; -import { verifyViewport } from './utils'; +import { test as it, expect } from './config/pageTest'; +import { test as browserTest, slowTest as slowBrowserTest } from './config/browserTest'; +import { verifyViewport } from '../test/utils'; import path from 'path'; import fs from 'fs'; import { PNG } from 'pngjs'; -// Firefox headful produces a different image. +it.describe('page screenshot', () => { + it.beforeEach(async ({ browserName, headful }) => { + it.skip(browserName === 'firefox' && headful, 'Firefox headful produces a different image.'); + it.skip(!!process.env.PW_ANDROID_TESTS, 'Different viewport'); + }); -describe('page screenshot', (suite, { browserName, headful }) => { - suite.skip(browserName === 'firefox' && headful); -}, () => { it('should work', async ({page, server}) => { await page.setViewportSize({width: 500, height: 500}); await page.goto(server.PREFIX + '/grid.html'); @@ -126,25 +128,9 @@ describe('page screenshot', (suite, { browserName, headful }) => { await verifyViewport(page, 500, 500); }); - it('should run in parallel in multiple pages', async ({server, context}) => { - const N = 5; - const pages = await Promise.all(Array(N).fill(0).map(async () => { - const page = await context.newPage(); - await page.goto(server.PREFIX + '/grid.html'); - return page; - })); - const promises = []; - for (let i = 0; i < N; ++i) - promises.push(pages[i].screenshot({ clip: { x: 50 * (i % 2), y: 0, width: 50, height: 50 } })); - const screenshots = await Promise.all(promises); - for (let i = 0; i < N; ++i) - expect(screenshots[i]).toMatchSnapshot(`grid-cell-${i % 2}.png`); - await Promise.all(pages.map(page => page.close())); - }); + it('should allow transparency', async ({page, browserName}) => { + it.fail(browserName === 'firefox'); - it('should allow transparency', (test, { browserName }) => { - test.fail(browserName === 'firefox'); - }, async ({page}) => { await page.setViewportSize({ width: 50, height: 150 }); await page.setContent(`