OLD | NEW |
(Empty) | |
| 1 Description |
| 2 =========== |
| 3 |
| 4 This is the test suites from a number of W3C Working Groups, including the HTML |
| 5 Working Group, the Web Apps Working Group, the Device APIs Working Group, and |
| 6 the Web Apps Security Working Group. |
| 7 |
| 8 Running the Tests |
| 9 ================= |
| 10 |
| 11 The tests are designed to be run from your local computer. The test environment |
| 12 requires Python 2.7+ (but not Python 3.x). |
| 13 |
| 14 To get the tests running, you need to set up the test domains in your |
| 15 [`hosts` file](http://en.wikipedia.org/wiki/Hosts_%28file%29%23Location_in_the_f
ile_system). The following entries are required: |
| 16 |
| 17 ``` |
| 18 127.0.0.1 web-platform.test |
| 19 127.0.0.1 www.web-platform.test |
| 20 127.0.0.1 www1.web-platform.test |
| 21 127.0.0.1 www2.web-platform.test |
| 22 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test |
| 23 127.0.0.1 xn--lve-6lad.web-platform.test |
| 24 ``` |
| 25 |
| 26 Because web-platform-tests uses git submodules, you must ensure that |
| 27 these are up to date. In the root of your checkout, run: |
| 28 |
| 29 ``` |
| 30 git submodule update --init --recursive |
| 31 ``` |
| 32 |
| 33 The test environment can then be started using |
| 34 |
| 35 ``` |
| 36 python serve.py |
| 37 ``` |
| 38 |
| 39 This will start HTTP servers on two ports and a websockets server on |
| 40 one port. By default one web server starts on port 8000 and the other |
| 41 ports are randomly-chosen free ports. Tests must be loaded from the |
| 42 *first* HTTP server in the output. To change the ports, edit the |
| 43 `config.json` file, for example, replacing the part that reads: |
| 44 |
| 45 ``` |
| 46 "http": [8000, "auto"] |
| 47 ``` |
| 48 |
| 49 to some port of your choice e.g. |
| 50 |
| 51 ``` |
| 52 "http":[1234, "auto"] |
| 53 ``` |
| 54 |
| 55 Test Runner |
| 56 =========== |
| 57 |
| 58 There is a test runner that is designed to provide a |
| 59 convenient way to run the web-platform tests in-browser. It will run |
| 60 testharness.js tests automatically but requires manual work for |
| 61 reftests and manual tests. |
| 62 |
| 63 In order to use the runner, it is first necessary to generate a test |
| 64 manifest. This must be called `MANIFEST.json` and placed in the |
| 65 web-platform-tests root. |
| 66 |
| 67 You must do this step to use the test runner, even if you are not |
| 68 creating a new test suite. |
| 69 |
| 70 To generate this file, from a command prompt at the root |
| 71 directory of the repo, run: |
| 72 |
| 73 ``` |
| 74 python tools/scripts/manifest.py |
| 75 ``` |
| 76 This `tools/scripts/manifest.py` needs python `html5lib` package. |
| 77 If you have not installed it yet, run: |
| 78 ``` |
| 79 pip install html5lib |
| 80 ``` |
| 81 |
| 82 On Mac OS X, python is installed with Xcode, but pip is not. Try |
| 83 ``` |
| 84 sudo easy_install pip |
| 85 ``` |
| 86 if pip is not already on your system. |
| 87 |
| 88 |
| 89 Running the tests requires that the test environment be activated as |
| 90 described above. The runner can be found at `/tools/runner/index.html` |
| 91 on the local server i.e. |
| 92 |
| 93 ``` |
| 94 http://web-platform.test:8000/tools/runner/index.html |
| 95 ``` |
| 96 |
| 97 in the default configuration. |
| 98 |
| 99 Publication |
| 100 =========== |
| 101 |
| 102 The master branch is automatically synced to http://w3c-test.org/. |
| 103 |
| 104 Pull requests that have been checked are automatically mirrored to |
| 105 http://w3c-test.org/submissions/. |
| 106 |
| 107 Finding Things |
| 108 ============== |
| 109 |
| 110 Each top-level directory represents a W3C specification: the name |
| 111 matches the shortname used after the canonical address of the said |
| 112 specification under http://www.w3.org/TR/ . |
| 113 |
| 114 For some of the specifications, the tree under the top-level directory |
| 115 represents the sections of the respective documents, using the section |
| 116 IDs for directory names, with a maximum of three levels deep. |
| 117 |
| 118 So if you're looking for tests in HTML for "The History interface", |
| 119 they will be under `html/browsers/history/the-history-interface/`. |
| 120 |
| 121 Various resources that tests depend on are in `common`, `images`, and |
| 122 `fonts`. |
| 123 |
| 124 |
| 125 If you're looking at a section of the specification and can't figure |
| 126 out where the directory is for it in the tree, just run: |
| 127 |
| 128 ``` |
| 129 node tools/scripts/id2path.js your-id |
| 130 ``` |
| 131 |
| 132 Branches |
| 133 ======== |
| 134 |
| 135 In the vast majority of cases the **only** branch that you should need |
| 136 to care about is `master`. |
| 137 |
| 138 There is another branch called `CR`. This is a strict subset of |
| 139 `master` that is limited to features that are found in the Candidate |
| 140 Recommendation version of the relevant specifications. |
| 141 |
| 142 If you see other branches in the repository, you can generally safely |
| 143 ignore them. Please note that branches prefixed with `temp/` are |
| 144 temporary branches and **can** get deleted at some point. So don't |
| 145 base any work off them unless you want to see your work destroyed. |
| 146 |
| 147 Contributing |
| 148 ============ |
| 149 |
| 150 Save the Web, Write Some Tests! |
| 151 |
| 152 Absolutely everyone is welcome (and even encouraged) to contribute to |
| 153 test development, so long as you fulfill the contribution requirements |
| 154 detailed in the [Contributing Guidelines][contributing]. No test is |
| 155 too small or too simple, especially if it corresponds to something for |
| 156 which you've noted an interoperability bug in a browser. |
| 157 |
| 158 The way to contribute is just as usual: |
| 159 |
| 160 * fork this repository (and make sure you're still relatively in sync |
| 161 with it if you forked a while ago); |
| 162 * create a branch for your changes: |
| 163 `git checkout -b your-name/topic`; |
| 164 * make your changes; |
| 165 * push that to your repo; |
| 166 * and send in a pull request based on the above. |
| 167 |
| 168 Please make your pull requests either to `master` or to a feature |
| 169 branch (but not to `CR`). |
| 170 |
| 171 We can sometimes take a little while to go through pull requests |
| 172 because we have to go through all the tests and ensure that they match |
| 173 the specification correctly. But we look at all of them, and take |
| 174 everything that we can. |
| 175 |
| 176 If you wish to contribute actively, you're very welcome to join the |
| 177 public-test-infra@w3.org mailing list (low traffic) by |
| 178 [signing up to our mailing list](mailto:public-test-infra-request@w3.org?subject
=subscribe). |
| 179 |
| 180 Join us on irc #testing ([irc.w3.org][ircw3org], port 6665). The channel |
| 181 is [archived][ircarchive]. |
| 182 |
| 183 [contributing]: https://github.com/w3c/web-platform-tests/blob/master/CONTRIBUTI
NG.md |
| 184 [ircw3org]: https://www.w3.org/wiki/IRC |
| 185 [ircarchive]: http://krijnhoetmer.nl/irc-logs/testing/ |
| 186 |
| 187 Documentation |
| 188 ------------- |
| 189 |
| 190 * [How to write and review tests](http://testthewebforward.org/docs/) |
| 191 * [Documentation for the wptserve server](http://wptserve.readthedocs.org/en/lat
est/) |
OLD | NEW |