Revision: 5366
Author: [email protected]
Date: Mon Apr 22 12:16:18 2013
Log: Edited wiki page CajaTesting through web user interface.
http://code.google.com/p/google-caja/source/detail?r=5366
Modified:
/wiki/CajaTesting.wiki
=======================================
--- /wiki/CajaTesting.wiki Tue Apr 9 18:32:19 2013
+++ /wiki/CajaTesting.wiki Mon Apr 22 12:16:18 2013
@@ -55,128 +55,151 @@
== `runtests` flags ==
{{{
--Dtest.debug=false
+-Dtest.browser= (default: "firefox")
}}}
- If `test.debug` is true, `runtests` will listen on port 9999
- and wait for a Java debugger to connect, before starting
- tests.
+ Chooses which browser to test.
+ `"firefox"` and `"chrome"` work for local browser testing.
+ `"firefox"`, `"chrome"`, and `"ie"` work for remote browser testing.
{{{
--Dtest.exclude=--none--
+-Dtest.browser.close= (default: "no")
}}}
- `runtests` will skip Java test classes that match this glob pattern.
+ Normally when a browser test fails, the test runner will try to
+ leave the browser open so that it can be examined later.
+ When this flag is truthy, the test runner will always close the
+ browser when done, whether it passes or fails.
{{{
--Dtest.filter=*Test
+-Dtest.chrome.binary= (default: system-dependent search)
}}}
- `runtests` will only run Java test classes that match
- the `test.filter` glob pattern.
+ Overrides the automatic search for the Chrome executable when
+ testing Chrome. This should be an absolute pathname.
+
+ On MacOS X, this should point at the
+ `"Contents/MacOS/Google Chrome"` executable inside the app bundle.
{{{
--Dtest.method.filter=*
+-Dtest.debug= (default: "no")
}}}
- `runtests` will only run Java test methods that match the
- `test.method.filter` pattern.
- (This is supposed to be a glob, but the pattern matching is
- a little buggy, and "x" is the same as "`*x*`".)
+ When truthy, listen on port 9999 and wait for a Java debugger
+ to connect before starting tests.
- Note: we don't really have a way to skip running a test method.
- Instead, methods that do not
- match `test.method.filter` will pass without running
- (which makes it a little tricky to tell the difference between
- tests that pass because they ran vs tests that pass because
- they were skipped.)
+{{{
+-Dtest.debug.browser= (default: "no")
+}}}
+
+ When truthy, start the test server and the browser, then
+ wait. This is the same as `ant brserve+`.
{{{
--Dtest.threads=2
+-Dtest.debug.server= (default: "no")
}}}
- `runtests` uses limited parallelism to finish faster.
- Use `"-Dtest.threads=1"` to disable parallel execution.
+ When truthy, start the test server, then wait. This is the
+ same as `ant brserve`.
- Setting `test.threads` to more than 2 will not speed up tests
- much, because most of the time is spent on browser tests,
- which always run sequentially.
+{{{
+-Dtest.exclude= (default: "--none--")
+}}}
+
+ Skip Java test classes that match this glob pattern.
{{{
--Dtestonly.{X}=...
+-Dtest.failureNotAnOption= (default: "no")
}}}
- Any property that starts with `"testonly."` will be passed
- through to the test runner, but with the `"testonly."` prefix
- removed. This is useful for properties that you want visible
- to tests but not visible to `ant`.
+ When truthy, the test report generator will ignore the
+ `@FailureIsAnOption` annotation on tests.
-== Browser test flags ==
+{{{
+-Dtest.filter= (default: "*Test")
+}}}
+
+ Only run Java test classes that match this glob pattern.
{{{
--Dcaja.test.browser=firefox
+-Dtest.filter.method= (default: "*")
}}}
- Chooses which browser to test.
- `"firefox"` and `"chrome"` work for local browser testing.
- `"firefox"`, `"chrome"`, and `"ie"` work for remote browser testing.
+ Only run Java test methods that match this glob pattern.
+
+ Note, we don't really have a way to skip running a test
+ method. Instead, non-matching methods will be recorded as
+ passing without being run, which makes it a little tricky to
+ tell the difference between tests that passed because they
+ ran vs tests that passed because they were skipped.
+
+{{{
+-Dtest.server.hostname= (default: automatic guess)
+}}}
+
+ When running a remote webdriver, the remote browser needs to
+ load resources from a local HTTP server started by the test
+ driver. The test driver will guess a hostname that the remote
+ browser can use to contact the local HTTP server, but the
+ guess can be wrong. Setting this will override the guessed
+ hostname.
{{{
--Dcaja.test.browserPath=...
+-Dtest.server.port= (default: "0" or "8000")
}}}
- `caja.test.browserPath` overrides the location of the Chrome
- binary when testing Chrome. This should be an absolute pathname.
+ Browser tests start a local HTTP server. This setting lets
+ you override the server's port. The value `0` means to use
+ any available port.
- On OS X, this should point at the
- `Contents/MacOS/Google Chrome` executable inside the app bundle.
+ When actually running tests, the default is `0`.
+ But when you do `"ant brserve"` the default is `8000`,
+ since a fixed port is more convenient for manual testing.
{{{
--Dcaja.test.closeBrowser=false
+-Dtest.threads= (default: "2")
}}}
- Normally when a browser test fails, the test runner will try to
- leave the browser open so that it can be examined later.
- When this flag is true, the test runner will always close the
- browser when done, whether it passes or fails.
+ `runtests` uses limited parallelism to finish faster.
+ Use `"-Dtest.threads=1"` to disable parallel execution.
+
+ Setting `test.threads` to more than 2 will probably not speed
+ up tests much, because most of the time is spent on browser
+ tests, which run sequentially.
{{{
--Dcaja.test.remote=...
+-Dtest.webdriver.url= (default: "")
}}}
- Setting `caja.test.remote` will run browser tests on a remote
+ When this is non-null, browser tests are run on a remote
webdriver instead of a local webdriver.
- The value should be a URL, such as `http://remotehost:4444/`
+
+ The value should be something like `http://remotehost:4444/`
or `http://remotehost:4444/wd/hub/`
{{{
--Dcaja.test.serverPort=0
+-Dtestonly.{X}=
}}}
- Browser tests start a test HTTP server on localhost.
- This setting lets you override the server's port.
- The value `0` means to use any available port.
- When actually running tests, the default is `0`.
- But when you do `"ant brserve"` the default is `8000`,
- since a fixed port is more convenient for manual testing.
+ Any property that starts with `"testonly."` will be passed
+ through to the test runner, but with the `"testonly."` prefix
+ removed. This is useful for properties that you want visible
+ to tests but not visible to `ant`.
{{{
--Dcaja.test.thishostname=...
+-Dwebdriver.{X}=
}}}
- When running a remote webdriver, the remote browser needs to
- load resources from a local HTTP server started by the test
- driver. The test driver will guess a hostname that the
- remote browser can use to contact the local server, but the
- guess can be wrong. Setting `caja.test.thishostname` will
- override the guessed hostname.
+ Any property starting with `"webdriver."` will be passed
+ through to the test runner unchanged.
{{{
--Dwebdriver.{X}=...
+-Dwebdriver.firefox.bin= (default: system-dependent search)
}}}
- Any property starting with `"webdriver."` will be passed
- through to the test runner unchanged.
+ Overrides the automatic search for the Firefox exectuable
+ when testing Firefox.
+
= Local browser testing =
@@ -195,7 +218,7 @@
== Chrome ==
{{{
-ant brtest -Dcaja.test.browser=chrome
+ant brtest -Dtest.browser=chrome
}}}
First, you need `chromedriver`, which is available
@@ -209,10 +232,10 @@
`chromedriver` looks for Chrome in standard system
locations. You can override that with
- `"-Dcaja.test.browserPath=..."`
+ `"-Dtest.chrome.binary=..."`
- On MacOS, `caja.test.browserPath` should point at the
- `Contents/MacOS/Google_Chrome` binary inside the app bundle.
+ On MacOS, `test.chrome.binary` should point at the
+ `"Contents/MacOS/Google Chrome"` binary inside the app bundle.
If you want more control over `chromedriver` settings, start
it manually and treat it like a remote browser, described below.
@@ -252,16 +275,16 @@
== running the tests ==
{{{
-ant brtest -Dcaja.test.browser=... -Dcaja.test.remote=http://...
+ant brtest -Dtest.browser=... -Dtest.webdriver.url=http://...
}}}
- `caja.test.browser` can be `"firefox"` (default), `"chrome"`,
+ `test.browser` can be `"firefox"` (default), `"chrome"`,
or `"ie"`.
- For remote Linux and MacOS, `caja.test.remote` should be
+ For remote Linux and MacOS, `test.webdriver.url` should be
something like `http://remote:4444/wd/hub`
- For remote Windows, `caja.test.remote` should be something
+ For remote Windows, `test.webdriver.url` should be something
like `http://remote:4444/`
You can verify the remote webdriver works by fetching the URL
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.