* fix page load for phantomjs 2.5.0
* add unhandledPromptBehavior w3c capability
* add blacklist/whitelist filters
* fix sending keys to content editable elements
* fix file upload for phantomjs 2.5.0
* fix action chains with elements in iframes
* replace calls to execute_script with atoms
* add --remoteHost (@madhavajay)
* add w3c defaults for add cookie
* fix multiple file upload
* add w3c timeout defaults
* fix custom phantomjs headers
* add support for switch to parent frame (Chui Tey)
* add support for right click (Artur Signell)
* add zoomFactor capability
* fix reset log buffer after each post request
* fix registration with selenium grid
* fix memory leak in har log
* add limited support for loggingPrefs capability
* fix browser and har logs default to OFF
* various bug fixes
Issue #14553
The `certs`, `fixtures`, `node_modules`, and `www` directories, and
`testharness.js`, are moved into a new `lib` directory to reduce
clutter; the long-term plan is that all other subdirectories will
contain tests. (Right now, we still have `ghostdriver-tests` as an
exception.) Adjust `writing-tests.md`, `run-tests.py`, `testharness.js`,
and a couple of tests accordingly.
Also fix a bug in `run-tests.py` where ERROR conditions that happened
before the first test were not being reported accurately.
* test/basics/version: must be updated for version number bumps.
* test/basics/require: stack trace is now accurate
(issue #12864, commit 0e32928ae1)
* test/module/webpage/capture_content: this feature had to be backed out
(issue #13908, commit cab28ccbd4)
Originally pull request #12109.
Fixes issues #10947#11103#11984#13551 and probably more.
The test case is a composite of test cases provided by
Luke Street (#12109) and kramsee (#13551).
Thanks to the awkward semantics of JS 'this', callbacks registered for
page.includeJs() completion were not getting deregistered. This was
invisible under most conditions, but: if you loaded a page, included JS
into it, loaded another page using the same webpage object, and then
included the *same* JS file into the second page, the callback you
provided for the *first* call to includeJs would get called a second
time.
* Use QUrl::toEncoded() instead of QUrl::toString() to compute
WebPage.url, WebPage.frameUrl, the first argument to an
onNavigationRequested hook, the sole argument to an onUrlChanged hook,
and the 'url' property of the object passed to an onResourceError
hook. This makes them consistent with the data passed to the
onResourceRequested, onResourceReceived, and onResourceTimeout hooks,
and with the semantics of WebPage.open(), WebPage.openUrl(), and the
cookie jar. (Issue #12216.)
* Use m_currentFrame->baseUrl() instead of m_currentFrame->url() for
WebPage.frameUrl; this is a partial workaround for a bug in QtWebKit
which is the root cause of issue #11035. Noticed while attempting to
test the above changes.
* Take care not to mangle the encoding of the url passed to the
WebServer.listen callback function. Necessary in order to test the
above changes: not only should JS receive %-encoded URLs, the server's
encoding of non-ASCII characters in URLs should be preserved; to test
this thoroughly, a heinously non-Unicode-compatible encoding (Shift_JIS)
is deliberately used for the URLs in all the new tests.
Instead, run-tests.py asks the kernel to assign a random unused port
number for each, and then sets environment variables TEST_HTTP_BASE
and TEST_HTTPS_BASE to the base URLs of each server. In tests that
use testharness.js, these are exposed as global variables with the
same name; tests that don't use the harness will need to pick them out
of require('system').env if they need them. (Currently there are no
such tests.)
Part of issue #13478 (test suite overhaul).
This works with more //! directives at the top of a test, which
will normally be a no-harness test. It is now possible, for
instance, to test for an _unsuccessful_ exit, or for output
appearing on stderr rather than stdout. The tests for
phantom.exit and sys.stdin/out/err have been augmented
accordingly.
It is also now possible to adjust the backstop timeout on a
per-test basis, and therefore the existing timeouts have been
lowered to 5s (harness), 7s (backstop).
Part of issue #13478 (test suite overhaul).
This enables run-tests.py to parse it and produce structured,
pretty output. A couple of latent failures were exposed and
marked expected (having to do with control passing beyond
phantom.exit()).
TAP: http://testanything.org/tap-specification.html
Part of issue #13478 (test suite overhaul).
This covers fs-spec-*.js, require/require_spec.js, module_spec.js,
webkit-spec.js, and webserver-spec.js. Also, incorporate
set/690-ttf-crash/ as a regression test (it wasn't being run
automatically).
Part of issue #13478 (test suite overhaul).
The principal value of this test harness is its support for asynchronous
tests -- that is, tests where you have to wait for a callback to happen
before you can continue testing. This applies to every test in our
testsuite that uses WebPage.open(), and some others as well. With this
harness, the test suite is significantly faster and can be made race-free.
The API is not exactly the same as W3C testharness.js -- important
differences include: test execution is serialized within a file; "file is
test" mode has been removed, as we do not need it and it adds significant
complexity; several additional assertions have been added; the ability to
mark tests as expected to fail, or as to be skipped entirely, has been added.
New-style tests can opt out of testharness.js with a "no-harness"
directive at the top of the file; this is necessary for a small number
of tests (e.g. basics/exit.js) that test functionality the harness
reserves for its own use.
All existing new-style tests have been converted to testharness.js; some
groups of tests have been consolidated into fewer files. The naming
convention for tests in regression/ is clarified.
Part of issue #13478 (test suite overhaul).
* Eliminate the global variables.
* More thorough error detection in the HTTP(S) server.
* Test directive comments must start with //! and the parser is more robust.
* Handle child process stderr separately from stdout
(this will make it possible to test more things).
* Execute tests within each directory in alphabetical order. (#12439)
* Support and use multi-level wildcards in TESTS. This means we don't
have to touch run-tests.py every time we add a subdirectory to
module/ or standards/.
* Handle HTTP server errors during a test more gracefully. Errors caused by
the client disconnecting in the middle of a query-response transaction are
ignored. Other errors are reported and the test suite exits cleanly.
* Add HTTPS and POST support to test server.
* Add ability to run PhantomJS under a debugger on a test case.
* Use argparse for command line parsing.
* Accept -v as short for --verbose.
* Repeating -v means more verbosity; at -vvv, phantomjs command lines are
printed. (-vv is reserved for printing individual subtests, which will
happen later.)
* Fix bug where, with one or more -v, the pjs version number was printed
twice.
Part of issue #13478 (test suite overhaul).
The default is 'true'. When set 'false', file: and qrc: URLs are
treated as invalid (unknown scheme) rather than opening local files,
as requested in issue #12752.
In order to test this, I added a mechanism to test/run-tests.py
allowing individual tests to be annotated with command-line
options to pass to phantomjs or the script.