run_web_tests.py runs web tests with content shell through protocol mode. See
web_tests.md for details. run_wpt_tests.py instead can run web
platform tests with Chrome, Chrome Android and WebView. This document explains how
to use run_wpt_tests.py in these scenarios.
[TOC]
run_wpt_tests.py can run with different browsers. To specify which browser to
run tests with, you should use --product or -p. Supported parameters are chrome,
chrome_android (or clank), and android_webview (or webview). The default
value is chrome if not specified.
The CLI is mostly kept the same between run_web_tests.py and run_wpt_tests.py. To see a complete list of arguments supported in run_wpt_tests.py, run:
third_party/blink/tools/run_wpt_tests.py --help- Linux
It is possible to run tests for Chrome on other platforms, but test expectations and baselines are only actively maintained for Linux due to resource constraint.
Before you can run the web platform tests, you need to build the chrome_wpt_tests
target to get chrome, chromedriver and all of the other needed binaries.
autoninja -C out/Default chrome_wpt_testsOnce you have chrome and chromedriver built, running tests is very much similar
to how you run tests with run_web_tests.py. For example, to run tests in external/wpt/html/dom,
you should run:
third_party/blink/tools/run_wpt_tests.py --release -p chrome third_party/blink/web_tests/external/wpt/html/domNote: consider using -v to get browser logs. It can be provided multiple times to
increase verbosity.
The
ChromeTestExpectations file contains the list of all known Chrome
specific test failures, and it inherits or overrides test expectations from the default TestExpectations file.
A special tag Chrome is introduced to specify chrome specific failures. See the
Web Test Expectations documentation for more
on this.
Chrome specific baselines reside at third_party/blink/web_tests/platform/linux-chrome, and
falls back to third_party/blink/web_tests/platform/linux. To update baselines for chrome,
you should trigger linux-wpt-fyi-rel and run rebaseline tool after the results are ready.
Webdriver tests are one type (wdspec) of web platform tests. Due to this you can run webdriver tests the same way as other web platform tests, e.g.
third_party/blink/tools/run_wpt_tests.py --release -p chrome external/wpt/webdriver/tests/classic/find_element/find.pyThe webdriver_wpt_tests step of linux-blink-rel runs wdspec tests and can provide results for rebaselining.
To be updated.
To be updated.
Passing the --no-headless flag to run_wpt_tests.py will pause execution
after running each test headfully.
You can interact with the paused test page afterwards, including with DevTools:
Closing the tab or window will unpause the testharness and run the next test.
To interactively debug WPTs, prefix the run_wpt_tests.py command with
debug_renderer to attach a debugger to a desired renderer.
For other use cases, see these debugging tips.
Please file bugs and feature requests against
Blink>Infra with the wptrunner
label.
