These are quick instructions for how to get the web-platform-tests up and running. For more detailed instructions see the README of the repository at https://github.com/web-platform-tests/wpt/blob/master/README.md.
- Clone the web-platform-tests repository
git clone git@github.com:web-platform-tests/wpt.git web-platform-tests
-
Install dependencies. At least python 2.7+ (NOT python 3.x), but best to check at https://github.com/web-platform-tests/wpt/blob/master/README.md
-
Launch web server to view tests
./wpt serve
- Open a browser and navigate to
localhost:8000
This has been done with Google Chrome. It will work with all other browsers but some of the devtools instructions might need modifying.
- In the web-platform-tests folder, open the 2 files in
./fetch/content-length/
content-length.html.headers
contains the header information for the HTTP request which sets theContent-Length
property to 373content-length.html
contains more than 373 characters. When truncated to 373 characters only the wordPASS
appears in the body and the test passes.- Navigate to http://localhost:8000/fetch/content-length/content-length.html
- Should see a passing test
- Open devtools (F12 or Ctrl-Shift-I or Cmd-Shift-I)
- Open
Network
tab - Refresh the page
- On
Network
tab confirm that the body returned only containsPASS
and that there is a header ofContent-Length: 373
- Edit the
content-length.html.headers
file so that it is nowContent-Length: 380
- Refresh the page
- The test is now failing
- The network tab can be used to show that with 380 characters returned the body is now
PASS but FA
which is why the test fails.
The site https://wpt.fyi/results/?label=master&label=stable maintains the results when run against all versions of the 4 main browsers (Chrome, Edge, Firefox and Safari).
Navigate to fetch > content-length
to see them all passing for the above example.
The async clipboard API allows you to interact with the user's clipboard. The spec is here https://www.w3.org/TR/clipboard-apis/#async-clipboard-api. Specifically the navigator.clipboard
object should have 4 methods (read, readText, write, writeText) as defined here https://www.w3.org/TR/clipboard-apis/#clipboard-interface.
- Launch the web-platform-tests if not already running
- Navigate to http://localhost:8000/clipboard-apis/async-navigator-clipboard-basics.https.html
- As of Chrome 75 most of these are failing. Most fixed in Chrome 76. Can check this via https://wpt.fyi/results/clipboard-apis/async-navigator-clipboard-basics.https.html?label=master&product=chrome-75.0.3770.100%5Bstable%5D&product=chrome-76.0.3809.36%2Bbeta%5Bbeta%5D
- Open devtools in Chrome to see which methods the
navigator.clipboard
has available - Repeat in Firefox devtools