Skip to content

Commit eee1f6b

Browse files
committed
test/scripttest: [Basic Usage]
1 parent e2f75e8 commit eee1f6b

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

test/scripttest.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ Script tests written for the CSSWG //should// use test harness whenever possible
1818

1919
==== Basic Usage ====
2020

21-
The basic usage of the harness ([[http://w3c-test.org/resources/testharness.js|testharness.js]]) is described in the beginning of the file.
22-
21+
The basic usage of the test harness ([[http://w3c-test.org/resources/testharness.js|testharness.js]]) is described in the beginning of the file.
22+
23+
* To use the harness, import both scripts into the test document per the script tag below. Note that an expectation is that all tests must be run-able in place in the W3C's test repository. As such, an absolute path to the script file must be used and the script file will be in resources directory at the root of the repository.
24+
25+
<code html>
26+
<script src="/resources/testharness.js"></script>
27+
<script src="/resources/testharnessreport.js"></script>
28+
</code>
29+
* Each test can have one or more asserts. Note: some prefer a test is limited to a single assert but that is not mandatory.
30+
* Each test is atomic in the sense that a single test has a single result (pass/fail/timeout).
31+
* Within each test one may have a number of asserts.
32+
* A test fails at the first failing assert, and the remainder of the test is (typically) not run.
33+
* If the file containing the tests is a HTML file with an element of id "log", this will be populated with a table containing the test results after all the tests have run.
2334
==== Bug Reporting ====
2435

2536
The discussion forum for the test harness is the W3C's cross-WG [[http://lists.w3.org/Archives/Public/public-test-infra/|public-test-infra]] mail list. This list is also used to report testharness.js bugs or bugs can also be directly added to the W3C's Bugzilla: [[https://www.w3.org/Bugs/Public/describecomponents.cgi?product=Testing|Product = Testing; Component = testharness.js]] (James Graham is the "default assignee").

0 commit comments

Comments
 (0)