Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: migrate more page tests to folio (#6062)

Dmitry Gozmanf21f47889efb
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"
+ - 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-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"
+ 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:
- BROWSER: ${{ matrix.browser }}
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
+ - 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-new.json"
- - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json
+ FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json"
+ - run: npm run folio -- chromium --reporter=dot,json
shell: bash
env:
- BROWSER: "chromium"
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
+ - 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-new.json"
- - run: npx folio test/ --workers=1 --forbid-only --global-timeout=5400000 --retries=3 --reporter=dot,json
+ FOLIO_JSON_OUTPUT_NAME: "test-results/report-old.json"
+ - run: npm run folio -- chromium --reporter=dot,json
shell: bash
env:
- BROWSER: "chromium"
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<AndroidTestArgs> {
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<AndroidTestArgs> {
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<PageTestArgs> {
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<PageTestArgs> {
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<BrowserTestArgs & ServerTestArgs>();
+export const slowTest = newTestType<BrowserTestArgs & ServerTestArgs>();
export const proxyTest = newTestType<BrowserTestArgs & ServerTestArgs>();
// 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<Browser>;
browserOptions: LaunchOptions;
- headful: boolean;
createUserDataDir: () => Promise<string>;
launchPersistent: (options?: Parameters<BrowserType<Browser>['launchPersistentContext']>[1]) => Promise<{ context: BrowserContext, page: Page }>;
startRemoteServer: (options?: RemoteServerOptions) => Promise<RemoteServer>;
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('<div style="position:absolute; top: 10.3px; left: 20.4px;width:50.3px;height:20.2px;border:1px solid black;"></div>');
+ 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(`<button disabled>Click me</button>`);
+ 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('<div style="position:absolute; top: 10.3px; left: 20.4px;width:50.3px;height:20.2px;border:1px solid black;"></div>');
- 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(`<div style='height: 10000px; background: red'></div>`);
@@ -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(`<div style="width:600px;height:600px;"></div>`);
@@ -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(`<button disabled>Click me</button>`);
- 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(`<button id="foo" onfocus="window.gotFocus=true">foo</button>`);
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<string>();
+
+ // 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:<PORT>/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(`
<div contenteditable="true">
Edit this image: <img src="fakeimage.png" alt="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(`
<div contenteditable="true" role='textbox'>
Edit this image: <img src="fakeimage.png" alt="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(`
<div contenteditable="plaintext-only" role='textbox'>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>`);
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(`<a id="anchor" href="${server.EMPTY_PAGE}">empty.html</a>`);
@@ -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(`<a href="${server.PREFIX + '/frames/one-frame.html'}">click me</a>`);
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(`<button onclick="setTimeout(() => alert(1))">alert</button>`);
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(`<div id=d1 tabIndex=0></div>`);
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(`
<input id="input-1">
<button id="button">buttton</button>
@@ -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(`<input type=checkbox></input>`);
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(`
<button id=box1 onclick="window.open('./popup/popup.html')">Button1</button>
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(`
<style>
@@ -178,41 +164,6 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png');
});
- it('should work with a mobile viewport', (test, { browserName }) => {
- test.skip(browserName === 'firefox');
- test.fixme(browserName === 'chromium');
- }, async ({browser, server}) => {
- const context = await browser.newContext({ viewport: { width: 320, height: 480 }, isMobile: true });
- const page = await context.newPage();
- await page.goto(server.PREFIX + '/overflow.html');
- const screenshot = await page.screenshot();
- expect(screenshot).toMatchSnapshot('screenshot-mobile.png');
- await context.close();
- });
-
- it('should work with a mobile viewport and clip', (test, { browserName }) => {
- test.skip(browserName === 'firefox');
- test.skip(process.env.CRPATH); // Does not work in stable Chrome.
- }, async ({browser, server}) => {
- const context = await browser.newContext({viewport: { width: 320, height: 480 }, isMobile: true});
- const page = await context.newPage();
- await page.goto(server.PREFIX + '/overflow.html');
- const screenshot = await page.screenshot({ clip: { x: 10, y: 10, width: 100, height: 150 } });
- expect(screenshot).toMatchSnapshot('screenshot-mobile-clip.png');
- await context.close();
- });
-
- it('should work with a mobile viewport and fullPage', (test, { browserName }) => {
- test.skip(browserName === 'firefox');
- }, async ({browser, server}) => {
- const context = await browser.newContext({viewport: { width: 320, height: 480 }, isMobile: true});
- const page = await context.newPage();
- await page.goto(server.PREFIX + '/overflow-large.html');
- const screenshot = await page.screenshot({ fullPage: true });
- expect(screenshot).toMatchSnapshot('screenshot-mobile-fullpage.png');
- await context.close();
- });
-
it('should work for canvas', async ({page, server}) => {
await page.setViewportSize({width: 500, height: 500});
await page.goto(server.PREFIX + '/screenshots/canvas.html');
@@ -220,9 +171,9 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect(screenshot).toMatchSnapshot('screenshot-canvas.png', { threshold: 0.4 });
});
- it('should work for webgl', (test, { browserName }) => {
- test.fixme(browserName === 'firefox' || browserName === 'webkit');
- }, async ({page, server}) => {
+ it('should work for webgl', async ({page, server, browserName}) => {
+ it.fixme(browserName === 'firefox' || browserName === 'webkit');
+
await page.setViewportSize({width: 640, height: 480});
await page.goto(server.PREFIX + '/screenshots/webgl.html');
const screenshot = await page.screenshot();
@@ -249,22 +200,13 @@ describe('page screenshot', (suite, { browserName, headful }) => {
}
});
- it('should work with device scale factor', async ({browser, server}) => {
- const context = await browser.newContext({ viewport: { width: 320, height: 480 }, deviceScaleFactor: 2 });
- const page = await context.newPage();
- await page.goto(server.PREFIX + '/grid.html');
- const screenshot = await page.screenshot();
- expect(screenshot).toMatchSnapshot('screenshot-device-scale-factor.png');
- await context.close();
- });
-
it('should work with iframe in shadow', async ({page, server}) => {
await page.setViewportSize({width: 500, height: 500});
await page.goto(server.PREFIX + '/grid-iframe-in-shadow.html');
expect(await page.screenshot()).toMatchSnapshot('screenshot-iframe.png');
});
- it('path option should work', async ({page, server, testInfo}) => {
+ it('path option should work', async ({page, server}, testInfo) => {
await page.setViewportSize({width: 500, height: 500});
await page.goto(server.PREFIX + '/grid.html');
const outputPath = testInfo.outputPath('screenshot.png');
@@ -272,7 +214,7 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect(await fs.promises.readFile(outputPath)).toMatchSnapshot('screenshot-sanity.png');
});
- it('path option should create subdirectories', async ({page, server, testInfo}) => {
+ it('path option should create subdirectories', async ({page, server}, testInfo) => {
await page.setViewportSize({width: 500, height: 500});
await page.goto(server.PREFIX + '/grid.html');
const outputPath = testInfo.outputPath(path.join('these', 'are', 'directories', 'screenshot.png'));
@@ -280,7 +222,7 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect(await fs.promises.readFile(outputPath)).toMatchSnapshot('screenshot-sanity.png');
});
- it('path option should detect jpeg', async ({page, server, testInfo}) => {
+ it('path option should detect jpeg', async ({page, server}, testInfo) => {
await page.setViewportSize({ width: 100, height: 100 });
await page.goto(server.EMPTY_PAGE);
const outputPath = testInfo.outputPath('screenshot.jpg');
@@ -304,16 +246,101 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect(error.message).toContain('options.quality is unsupported for the png');
});
- it('should prefer type over extension', async ({page, testInfo}) => {
+ it('should prefer type over extension', async ({page}, testInfo) => {
const outputPath = testInfo.outputPath('file.png');
const buffer = await page.screenshot({ path: outputPath, type: 'jpeg' });
expect([buffer[0], buffer[1], buffer[2]]).toEqual([0xFF, 0xD8, 0xFF]);
});
- it('should work with large size', (test, {browserName, headful, platform}) => {
- test.slow('Large screenshot is slow');
- test.fixme(browserName === 'chromium' && headful === true && platform === 'linux', 'Chromium has gpu problems on linux with large screnshots');
- }, async ({ page }) => {
+ 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());
+ });
+ await page.screenshot();
+ expect(resizeTriggered).toBeFalsy();
+ });
+});
+
+browserTest.describe('page screenshot', () => {
+ browserTest.beforeEach(async ({ browserName, headful }) => {
+ browserTest.skip(browserName === 'firefox' && headful, 'Firefox headful produces a different image.');
+ browserTest.skip(!!process.env.PW_ANDROID_TESTS, 'Different viewport');
+ });
+
+ browserTest('should run in parallel in multiple pages', async ({server, contextFactory}) => {
+ const context = await contextFactory();
+ 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()));
+ });
+
+ browserTest('should work with a mobile viewport', async ({browser, server, browserName}) => {
+ browserTest.skip(browserName === 'firefox');
+ browserTest.fixme(browserName === 'chromium');
+
+ const context = await browser.newContext({ viewport: { width: 320, height: 480 }, isMobile: true });
+ const page = await context.newPage();
+ await page.goto(server.PREFIX + '/overflow.html');
+ const screenshot = await page.screenshot();
+ expect(screenshot).toMatchSnapshot('screenshot-mobile.png');
+ await context.close();
+ });
+
+ browserTest('should work with a mobile viewport and clip', async ({browser, server, browserName}) => {
+ browserTest.skip(browserName === 'firefox');
+ browserTest.skip(process.env.CRPATH); // Does not work in stable Chrome.
+
+ const context = await browser.newContext({viewport: { width: 320, height: 480 }, isMobile: true});
+ const page = await context.newPage();
+ await page.goto(server.PREFIX + '/overflow.html');
+ const screenshot = await page.screenshot({ clip: { x: 10, y: 10, width: 100, height: 150 } });
+ expect(screenshot).toMatchSnapshot('screenshot-mobile-clip.png');
+ await context.close();
+ });
+
+ browserTest('should work with a mobile viewport and fullPage', 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 + '/overflow-large.html');
+ const screenshot = await page.screenshot({ fullPage: true });
+ expect(screenshot).toMatchSnapshot('screenshot-mobile-fullpage.png');
+ await context.close();
+ });
+
+
+ browserTest('should work with device scale factor', async ({browser, server}) => {
+ const context = await browser.newContext({ viewport: { width: 320, height: 480 }, deviceScaleFactor: 2 });
+ const page = await context.newPage();
+ await page.goto(server.PREFIX + '/grid.html');
+ const screenshot = await page.screenshot();
+ expect(screenshot).toMatchSnapshot('screenshot-device-scale-factor.png');
+ await context.close();
+ });
+
+ // Large screenshot is slow.
+ slowBrowserTest('should work with large size', async ({ browserName, headful, platform, contextFactory }) => {
+ slowBrowserTest.fixme(browserName === 'chromium' && headful === true && platform === 'linux', 'Chromium has gpu problems on linux with large screnshots');
+
+ const context = await contextFactory();
+ const page = await context.newPage();
+
await page.setViewportSize({ width: 1280, height: 800 });
await page.evaluate(() => {
document.body.style.margin = '0';
@@ -341,17 +368,4 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect(pixel(0, 8339).r).toBeLessThan(128);
expect(pixel(0, 8339).b).toBeGreaterThan(128);
});
-
- 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());
- });
- await page.screenshot();
- expect(resizeTriggered).toBeFalsy();
- });
});
diff --git a/tests/page-set-input-files.spec.ts b/tests/page-set-input-files.spec.ts
index fd1a6fe1a7..9665f392fc 100644
--- a/tests/page-set-input-files.spec.ts
+++ b/tests/page-set-input-files.spec.ts
@@ -229,6 +229,8 @@ it('should accept single file', async ({page, server}) => {
});
it('should detect mime type', async ({page, server}) => {
+ it.fixme(!!process.env.PW_ANDROID_TESTS);
+
let files;
server.setRoute('/upload', async (req, res) => {
const form = new formidable.IncomingForm();
diff --git a/test/queryselector.spec.ts b/tests/queryselector.spec.ts
similarity index 98%
rename from test/queryselector.spec.ts
rename to tests/queryselector.spec.ts
index a5fb19035c..9622945c46 100644
--- a/test/queryselector.spec.ts
+++ b/tests/queryselector.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 throw for non-string selector', async ({page}) => {
const error = await page.$(null).catch(e => e);
diff --git a/test/selectors-css.spec.ts b/tests/selectors-css.spec.ts
similarity index 99%
rename from test/selectors-css.spec.ts
rename to tests/selectors-css.spec.ts
index a597524187..d9106130b9 100644
--- a/test/selectors-css.spec.ts
+++ b/tests/selectors-css.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 work with large DOM', async ({page, server}) => {
await page.evaluate(() => {
diff --git a/test/selectors-misc.spec.ts b/tests/selectors-misc.spec.ts
similarity index 96%
rename from test/selectors-misc.spec.ts
rename to tests/selectors-misc.spec.ts
index f59930f96b..dddd0a00ce 100644
--- a/test/selectors-misc.spec.ts
+++ b/tests/selectors-misc.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 work for open shadow roots', async ({page, server}) => {
await page.goto(server.PREFIX + '/deep-shadow.html');
@@ -27,9 +27,10 @@ it('should work for open shadow roots', async ({page, server}) => {
expect(await page.$$(`data-testid:light=foo`)).toEqual([]);
});
-it('should click on links in shadow dom', (test, { browserName, browserChannel }) => {
- test.fixme(browserName === 'chromium' && !!browserChannel, 'Enable when crrev.com/864024 get to the stable channel');
-}, async ({page, server}) => {
+it('should click on links in shadow dom', async ({page, server, browserName, browserChannel}) => {
+ it.fixme(browserName === 'chromium' && !!browserChannel, 'Enable when crrev.com/864024 get to the stable channel');
+ it.fixme(!!process.env.PW_ANDROID_TESTS);
+
await page.goto(server.PREFIX + '/shadow-dom-link.html');
expect(await page.evaluate(() => (window as any).clickCount)).toBe(0);
await page.click('#inner-link');
diff --git a/test/selectors-register.spec.ts b/tests/selectors-register.spec.ts
similarity index 92%
rename from test/selectors-register.spec.ts
rename to tests/selectors-register.spec.ts
index 7a781be96b..1549295b5c 100644
--- a/test/selectors-register.spec.ts
+++ b/tests/selectors-register.spec.ts
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-import { it, expect } from './fixtures';
-
+import { test as it, expect } from './config/browserTest';
import path from 'path';
it('should work', async ({playwright, browser}) => {
@@ -53,13 +52,15 @@ it('should work', async ({playwright, browser}) => {
await context.close();
});
-it('should work with path', async ({playwright, page}) => {
- await playwright.selectors.register('foo', { path: path.join(__dirname, 'assets/sectionselectorengine.js') });
+it('should work with path', async ({playwright, browser}) => {
+ const page = await browser.newPage();
+ await playwright.selectors.register('foo', { path: path.join(__dirname, '../test/assets/sectionselectorengine.js') });
await page.setContent('<section></section>');
expect(await page.$eval('foo=whatever', e => e.nodeName)).toBe('SECTION');
});
-it('should work in main and isolated world', async ({playwright, page}) => {
+it('should work in main and isolated world', async ({playwright, browser}) => {
+ const page = await browser.newPage();
const createDummySelector = () => ({
query(root, selector) {
return window['__answer'];
@@ -90,7 +91,8 @@ it('should work in main and isolated world', async ({playwright, page}) => {
expect(await page.$eval('main=ignored >> css=section', e => e.nodeName)).toBe('SECTION');
});
-it('should handle errors', async ({playwright, page}) => {
+it('should handle errors', async ({playwright, browser}) => {
+ const page = await browser.newPage();
let error = await page.$('neverregister=ignored').catch(e => e);
expect(error.message).toContain('Unknown engine "neverregister" while parsing selector neverregister=ignored');
@@ -117,7 +119,8 @@ it('should handle errors', async ({playwright, page}) => {
expect(error.message).toBe('"css" is a predefined selector engine');
});
-it('should not rely on engines working from the root', async ({ playwright, page }) => {
+it('should not rely on engines working from the root', async ({ playwright, browser }) => {
+ const page = await browser.newPage();
const createValueEngine = () => ({
query(root, selector) {
return root && root.value.includes(selector) ? root : undefined;
diff --git a/test/selectors-text.spec.ts b/tests/selectors-text.spec.ts
similarity index 99%
rename from test/selectors-text.spec.ts
rename to tests/selectors-text.spec.ts
index fe9a282375..7d774f909e 100644
--- a/test/selectors-text.spec.ts
+++ b/tests/selectors-text.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 work', async ({page}) => {
await page.setContent(`<div>yo</div><div>ya</div><div>\nye </div>`);
diff --git a/test/slowmo.spec.ts b/tests/slowmo.spec.ts
similarity index 98%
rename from test/slowmo.spec.ts
rename to tests/slowmo.spec.ts
index 406eb43896..bc4e07602c 100644
--- a/test/slowmo.spec.ts
+++ b/tests/slowmo.spec.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import { it, expect, describe } from './fixtures';
-import { attachFrame } from './utils';
+import { test as it, expect } from './config/pageTest';
+import { attachFrame } from '../test/utils';
async function checkSlowMo(toImpl, page, task) {
let didSlowMo = false;
@@ -44,9 +44,12 @@ async function checkPageSlowMo(toImpl, page, task) {
`);
await checkSlowMo(toImpl, page, task);
}
-describe('slowMo', (suite, { mode }) => {
- suite.skip(mode !== 'default');
-}, () => {
+
+it.describe('slowMo', () => {
+ it.beforeEach(async ({ mode }) => {
+ it.skip(mode !== 'default');
+ });
+
it('Page SlowMo $$eval', async ({page, toImpl}) => {
await checkPageSlowMo(toImpl, page, () => page.$$eval('button', () => void 0));
});
diff --git a/test/workers.spec.ts b/tests/workers.spec.ts
similarity index 94%
rename from test/workers.spec.ts
rename to tests/workers.spec.ts
index f8fc6fb654..516fddf793 100644
--- a/test/workers.spec.ts
+++ b/tests/workers.spec.ts
@@ -15,9 +15,10 @@
* limitations under the License.
*/
-import { it, expect } from './fixtures';
-import { attachFrame } from './utils';
-import type { ConsoleMessage } from '..';
+import { test as it, expect } from './config/pageTest';
+import { test as browserTest } from './config/browserTest';
+import { attachFrame } from '../test/utils';
+import type { ConsoleMessage } from '../index';
it('Page.workers', async function({page, server}) {
await Promise.all([
@@ -122,9 +123,9 @@ it('should clear upon cross-process navigation', async function({server, page})
expect(page.workers().length).toBe(0);
});
-it('should attribute network activity for worker inside iframe to the iframe', (test, {browserName}) => {
- test.fixme(browserName === 'firefox' || browserName === 'chromium');
-}, async function({page, server}) {
+it('should attribute network activity for worker inside iframe to the iframe', async function({page, server, browserName}) {
+ it.fixme(browserName === 'firefox' || browserName === 'chromium');
+
await page.goto(server.PREFIX + '/empty.html');
const [worker, frame] = await Promise.all([
page.waitForEvent('worker'),
@@ -171,7 +172,7 @@ it('should report network activity on worker creation', async function({page, se
expect(response.ok()).toBe(true);
});
-it('should format number using context locale', async ({browser, server}) => {
+browserTest('should format number using context locale', async ({browser, server}) => {
const context = await browser.newContext({ locale: 'ru-RU' });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
diff --git a/types/types.d.ts b/types/types.d.ts
index 6009fe909c..f8bb26cfd9 100644
--- a/types/types.d.ts
+++ b/types/types.d.ts
@@ -7180,12 +7180,12 @@ type ElectronType = typeof import('electron');
* const electronApp = await electron.launch({ args: ['main.js'] });
*
* // Evaluation expression in the Electron context.
- * const appPath = await electronApp.evaluate(async (electron) => {
- * // This runs in the main Electron process, |electron| parameter
- * // here is always the result of the require('electron') in the main
- * // app script.
- * return electron.getAppPath();
+ * const appPath = await electronApp.evaluate(async ({ app }) => {
+ * // This runs in the main Electron process, parameter here is always
+ * // the result of the require('electron') in the main app script.
+ * return app.getAppPath();
* });
+ * console.log(appPath);
*
* // Get the first window that the app opens, wait if necessary.
* const window = await electronApp.firstWindow();
@@ -7197,6 +7197,8 @@ type ElectronType = typeof import('electron');
* window.on('console', console.log);
* // Click button.
* await window.click('text=Click me');
+ * // Exit app.
+ * await electronApp.close();
* })();
* ```
*
@@ -9091,12 +9093,12 @@ export interface Download {
* const electronApp = await electron.launch({ args: ['main.js'] });
*
* // Evaluation expression in the Electron context.
- * const appPath = await electronApp.evaluate(async (electron) => {
- * // This runs in the main Electron process, |electron| parameter
- * // here is always the result of the require('electron') in the main
- * // app script.
- * return electron.getAppPath();
+ * const appPath = await electronApp.evaluate(async ({ app }) => {
+ * // This runs in the main Electron process, parameter here is always
+ * // the result of the require('electron') in the main app script.
+ * return app.getAppPath();
* });
+ * console.log(appPath);
*
* // Get the first window that the app opens, wait if necessary.
* const window = await electronApp.firstWindow();
@@ -9108,6 +9110,8 @@ export interface Download {
* window.on('console', console.log);
* // Click button.
* await window.click('text=Click me');
+ * // Exit app.
+ * await electronApp.close();
* })();
* ```
*