| OLD | NEW |
| (Empty) |
| 1 The Web Platform Tests Project [](http://irc.w
3.org/?channels=testing) | |
| 2 ============================== | |
| 3 | |
| 4 The Web Platform Tests Project is a W3C-coordinated attempt to build a | |
| 5 cross-browser testsuite for the Web-platform stack. However, for mainly | |
| 6 historic reasons, the CSS WG testsuite is in a separate repository, | |
| 7 [csswg-test](https://github.com/w3c/csswg-test). Writing tests in a way | |
| 8 that allows them to be run in all browsers gives browser projects | |
| 9 confidence that they are shipping software that is compatible with other | |
| 10 implementations, and that later implementations will be compatible with | |
| 11 their implementations. This in turn gives Web authors/developers | |
| 12 confidence that they can actually rely on the Web platform to deliver on | |
| 13 the promise of working across browsers and devices without needing extra | |
| 14 layers of abstraction to paper over the gaps left by specification | |
| 15 editors and implementors. | |
| 16 | |
| 17 Running the Tests | |
| 18 ================= | |
| 19 | |
| 20 The tests are designed to be run from your local computer. The test | |
| 21 environment requires Python 2.7+ (but not Python 3.x). You will also | |
| 22 need a copy of OpenSSL. Users on Windows should read the | |
| 23 [Windows Notes](#windows-notes) section below. | |
| 24 | |
| 25 To get the tests running, you need to set up the test domains in your | |
| 26 [`hosts` file](http://en.wikipedia.org/wiki/Hosts_%28file%29%23Location_in_the_f
ile_system). The | |
| 27 following entries are required: | |
| 28 | |
| 29 ``` | |
| 30 127.0.0.1 web-platform.test | |
| 31 127.0.0.1 www.web-platform.test | |
| 32 127.0.0.1 www1.web-platform.test | |
| 33 127.0.0.1 www2.web-platform.test | |
| 34 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test | |
| 35 127.0.0.1 xn--lve-6lad.web-platform.test | |
| 36 0.0.0.0 nonexistent-origin.web-platform.test | |
| 37 ``` | |
| 38 | |
| 39 Because web-platform-tests uses git submodules, you must ensure that | |
| 40 these are up to date. In the root of your checkout, run: | |
| 41 | |
| 42 ``` | |
| 43 git submodule update --init --recursive | |
| 44 ``` | |
| 45 | |
| 46 The test environment can then be started using | |
| 47 | |
| 48 ``` | |
| 49 ./serve | |
| 50 ``` | |
| 51 | |
| 52 This will start HTTP servers on two ports and a websockets server on | |
| 53 one port. By default one web server starts on port 8000 and the other | |
| 54 ports are randomly-chosen free ports. Tests must be loaded from the | |
| 55 *first* HTTP server in the output. To change the ports, edit the | |
| 56 `config.json` file, for example, replacing the part that reads: | |
| 57 | |
| 58 ``` | |
| 59 "http": [8000, "auto"] | |
| 60 ``` | |
| 61 | |
| 62 to some port of your choice e.g. | |
| 63 | |
| 64 ``` | |
| 65 "http":[1234, "auto"] | |
| 66 ``` | |
| 67 | |
| 68 If you installed OpenSSL in such a way that running `openssl` at a | |
| 69 command line doesn't work, you also need to adjust the path to the | |
| 70 OpenSSL binary. This can be done by adding a section to `config.json` | |
| 71 like: | |
| 72 | |
| 73 ``` | |
| 74 "ssl": {"openssl": {"binary": "/path/to/openssl"}} | |
| 75 ``` | |
| 76 | |
| 77 <span id="windows-notes">Windows Notes</span> | |
| 78 ============================================= | |
| 79 | |
| 80 Running wptserve with SSL enabled on Windows typically requires | |
| 81 installing an OpenSSL distribution. | |
| 82 [Shining Light](http://slproweb.com/products/Win32OpenSSL.html) | |
| 83 provide a convenient installer that is known to work, but requires a | |
| 84 little extra setup. | |
| 85 | |
| 86 After installation ensure that the path to OpenSSL is on your `%Path%` | |
| 87 environment variable. | |
| 88 | |
| 89 Then set the path to the default OpenSSL configuration file (usually | |
| 90 something like `C:\OpenSSL-Win32\bin\openssl.cfg` in the server | |
| 91 configuration. To do this copy `config.default.json` in the | |
| 92 web-platform-tests root to `config.json`. Then edit the JSON so that | |
| 93 the key `ssl/openssl/base_conf_path` has a value that is the path to | |
| 94 the OpenSSL config file. | |
| 95 | |
| 96 | |
| 97 Test Runner | |
| 98 =========== | |
| 99 | |
| 100 There is a test runner that is designed to provide a | |
| 101 convenient way to run the web-platform tests in-browser. It will run | |
| 102 testharness.js tests automatically but requires manual work for | |
| 103 reftests and manual tests. | |
| 104 | |
| 105 The runner can be found at `/tools/runner/index.html` on the local | |
| 106 server i.e. | |
| 107 | |
| 108 ``` | |
| 109 http://web-platform.test:8000/tools/runner/index.html | |
| 110 ``` | |
| 111 | |
| 112 in the default configuration. The first time you use this it has to | |
| 113 generate a manifest of all tests. This may take some time, so please | |
| 114 be patient. | |
| 115 | |
| 116 Publication | |
| 117 =========== | |
| 118 | |
| 119 The master branch is automatically synced to http://w3c-test.org/. | |
| 120 | |
| 121 Pull requests that have been checked are automatically mirrored to | |
| 122 http://w3c-test.org/submissions/. | |
| 123 | |
| 124 Finding Things | |
| 125 ============== | |
| 126 | |
| 127 Each top-level directory represents a W3C specification: the name | |
| 128 matches the shortname used after the canonical address of the said | |
| 129 specification under http://www.w3.org/TR/ . | |
| 130 | |
| 131 For some of the specifications, the tree under the top-level directory | |
| 132 represents the sections of the respective documents, using the section | |
| 133 IDs for directory names, with a maximum of three levels deep. | |
| 134 | |
| 135 So if you're looking for tests in HTML for "The History interface", | |
| 136 they will be under `html/browsers/history/the-history-interface/`. | |
| 137 | |
| 138 Various resources that tests depend on are in `common`, `images`, and | |
| 139 `fonts`. | |
| 140 | |
| 141 Branches | |
| 142 ======== | |
| 143 | |
| 144 In the vast majority of cases the **only** upstream branch that you | |
| 145 should need to care about is `master`. If you see other branches in | |
| 146 the repository, you can generally safely ignore them. | |
| 147 | |
| 148 Contributing | |
| 149 ============ | |
| 150 | |
| 151 Save the Web, Write Some Tests! | |
| 152 | |
| 153 Absolutely everyone is welcome (and even encouraged) to contribute to | |
| 154 test development, so long as you fulfill the contribution requirements | |
| 155 detailed in the [Contributing Guidelines][contributing]. No test is | |
| 156 too small or too simple, especially if it corresponds to something for | |
| 157 which you've noted an interoperability bug in a browser. | |
| 158 | |
| 159 The way to contribute is just as usual: | |
| 160 | |
| 161 * Fork this repository (and make sure you're still relatively in sync | |
| 162 with it if you forked a while ago). | |
| 163 * Create a branch for your changes: | |
| 164 `git checkout -b topic`. | |
| 165 * Make your changes. | |
| 166 * Run the lint script described below. | |
| 167 * Commit locally and push that to your repo. | |
| 168 * Send in a pull request based on the above. | |
| 169 | |
| 170 Lint tool | |
| 171 --------- | |
| 172 | |
| 173 We have a lint tool for catching common mistakes in test files. You | |
| 174 can run it manually by starting the `lint` executable from the root of | |
| 175 your local web-platform-tests working directory like this: | |
| 176 | |
| 177 ``` | |
| 178 ./lint | |
| 179 ``` | |
| 180 | |
| 181 The lint tool is also run automatically for every submitted pull | |
| 182 request, and reviewers will not merge branches with tests that have | |
| 183 lint errors, so you must fix any errors the lint tool reports. For | |
| 184 details on doing that, see the [lint-tool documentation][lint-tool]. | |
| 185 | |
| 186 But in the unusual case of error reports for things essential to a | |
| 187 certain test or that for other exceptional reasons shouldn't prevent | |
| 188 a merge of a test, update and commit the `lint.whitelist` file in the | |
| 189 web-platform-tests root directory to suppress the error reports. For | |
| 190 details on doing that, see the [lint-tool documentation][lint-tool]. | |
| 191 | |
| 192 [lint-tool]: https://github.com/w3c/web-platform-tests/blob/master/docs/lint-too
l.md | |
| 193 | |
| 194 Adding command-line scripts ("tools" subdirs) | |
| 195 --------------------------------------------- | |
| 196 | |
| 197 Sometimes you may want to add a script to the repository that's meant | |
| 198 to be used from the command line, not from a browser (e.g., a script | |
| 199 for generating test files). If you want to ensure (e.g., for security | |
| 200 reasons) that such scripts won't be handled by the HTTP server, but | |
| 201 will instead only be usable from the command line, then place them in | |
| 202 either: | |
| 203 | |
| 204 * the `tools` subdir at the root of the repository, or | |
| 205 | |
| 206 * the `tools` subdir at the root of any top-level directory in the | |
| 207 repository which contains the tests the script is meant to be used | |
| 208 with | |
| 209 | |
| 210 Any files in those `tools` directories won't be handled by the HTTP | |
| 211 server; instead the server will return a 404 if a user navigates to | |
| 212 the URL for a file within them. | |
| 213 | |
| 214 If you want to add a script for use with a particular set of tests but | |
| 215 there isn't yet any `tools` subdir at the root of a top-level | |
| 216 directory in the repository containing those tests, you can create a | |
| 217 `tools` subdir at the root of that top-level directory and place your | |
| 218 scripts there. | |
| 219 | |
| 220 For example, if you wanted to add a script for use with tests in the | |
| 221 `notifications` directory, create the `notifications/tools` subdir and | |
| 222 put your script there. | |
| 223 | |
| 224 Test Review | |
| 225 =========== | |
| 226 | |
| 227 We can sometimes take a little while to go through pull requests | |
| 228 because we have to go through all the tests and ensure that they match | |
| 229 the specification correctly. But we look at all of them, and take | |
| 230 everything that we can. | |
| 231 | |
| 232 Getting Involved | |
| 233 ================ | |
| 234 | |
| 235 If you wish to contribute actively, you're very welcome to join the | |
| 236 public-test-infra@w3.org mailing list (low traffic) by | |
| 237 [signing up to our mailing list](mailto:public-test-infra-request@w3.org?subject
=subscribe). | |
| 238 The mailing list is [archived][mailarchive]. | |
| 239 | |
| 240 Join us on irc #testing ([irc.w3.org][ircw3org], port 6665). The channel | |
| 241 is [archived][ircarchive]. | |
| 242 | |
| 243 [contributing]: https://github.com/w3c/web-platform-tests/blob/master/CONTRIBUTI
NG.md | |
| 244 [ircw3org]: https://www.w3.org/wiki/IRC | |
| 245 [ircarchive]: http://krijnhoetmer.nl/irc-logs/testing/ | |
| 246 [mailarchive]: http://lists.w3.org/Archives/Public/public-test-infra/ | |
| 247 | |
| 248 Documentation | |
| 249 ============= | |
| 250 | |
| 251 * [How to write and review tests](http://testthewebforward.org/docs/) | |
| 252 * [Documentation for the wptserve server](http://wptserve.readthedocs.org/en/lat
est/) | |
| OLD | NEW |