gitmyhub

wpt

HTML ★ 6.0k updated 5h ago

Test suites for Web platform specs — including WHATWG, W3C, and others

WPT is the shared test suite all major browsers use to verify they behave the same way on web features, if you find a browser inconsistency you can add a single test and every browser team will see it.

HTMLJavaScriptsetup: moderatecomplexity 3/5

Web-platform-tests, often called WPT, is a shared collection of tests for web browsers. The goal is to check whether browsers like Chrome, Firefox, and Safari all behave the same way when running the same web features. When browsers disagree on how something should work, websites break in unpredictable ways depending on which browser a visitor uses. This project exists so browser makers can run a common test suite and catch those disagreements before shipping new versions.

The tests cover a wide range of web standards, including HTML, JavaScript behavior in the browser, and the structure of web pages. They are written by contributors from browser teams, standards bodies, and independent developers. Anyone can add a test, and the project explicitly welcomes small contributions, such as a single test that reproduces a bug you noticed.

You can see the results of these tests run across multiple browsers at wpt.fyi, which keeps an ongoing archive of how each browser performs. A live version of the test suite is also publicly available at wpt.live, so you can run tests against any browser just by visiting the site.

For developers who want to run the tests locally, the project includes a command-line tool called wpt that handles starting a local server, running tests against a specific browser, and validating that test files follow the project's conventions. The documentation site at web-platform-tests.org explains how to get set up.

Contributing follows standard open-source practice: fork the repository, create a branch, make changes, run the linter, and open a pull request. There is also a real-time chat channel and a mailing list for questions and discussion.

Where it fits