This package has been deprecated
The cybernaut package is not developed any further. Please use one of the new @cybernaut packages.
Reliable, automated web UI testing in BDD-style.
WYSIWYM—the above human-readable test output corresponds to what is programmed:
;test'This is an example test',;
To get started, put a test file (e.g. test.e2e.js) into a directory:
mkdir -p tests && vi tests/test.e2e.js
and run it on Chrome with Docker:
docker run -it --rm \-v "$(pwd)"/tests:/opt/cybernaut-tests \-v /dev/shm:/dev/shm \clebert/cybernaut-chrome:latest
For further information, please consult the documentation.
Cybernaut is built on top of selenium-webdriver and lets you control a browser with just a few lines of code.
Your test code will look simple, concise and easy to read and is automatically output line by line in a human-readable form (WYSIWYM).
It provides a
Promise-based API and allows the use of
await to write your code without nesting and with the possibility of using control-flow primitives such as
Additionally, there are pre-built Docker containers to run your tests effortlessly in any environment such as Travis CI.
Writing reliable tests will be easy
Let's say we want to write a test which checks the text of a headline element.
A test written with, for example, selenium-webdriver consists of three test steps. Each of these test steps can go wrong:
// Fails if the headline element does not yet exist.const headline = await driver;// Fails if the headline element is stale.const text = await headline;// Fails if the actual text does not equal the expected text.assert;
Cybernaut allows all these test steps to be implemented in a single test step. This single test step is executed in an atomic way. This means that if one part of this test step fails, the entire test step fails and can then be repeated as a whole by the integrated test runner:
// Can not fail because it is just a definition of an element.const headline = ;// Can fail but only after several attempts.await t;
By this mechanism, a high reliability and thus stability of your tests can be ensured.
Built by (c) Clemens Akens. Released under the MIT license.