Pluto: An end to end testing framework.
"Don't forget your e2e tests"
Pluto is an e2e testing framework that uses Selenium to execute test cases. It includes interfaces for tests that can be written for specific cases, a set of asserts, and types that define specs and tests.
Install Pluto as a global npm package (or locally to your project by omitting
$ npm install -g @creately/pluto
Note: When installing the package globally, your $NODE_PATH environment variable should be set to the global package directory.
Linux / Mac
If it isn't set already, add the following to
$ export NODE_PATH=$(npm root --quiet -g)
Add an environment variable named
NODE_PATH and set it to
%USERPROFILE%\Application Data\npm\node_modules (Windows XP) or
%AppData%\npm\node_modules (Windows 7/8/10), or whichever path NPM uses to install modules in your environment.
See Loading from the global folders for more configuration information.
Set up Chrome and Firefox webdrivers for Selenium
Webdrivers should be downloaded and installed for the browser versions available in the environment. Webdrivers and installation instructions can be found on the Official Selenium Docs.
An action will be a class with a single method named
execute which performs one specific action. The framework executes the action instance's
execute method when the action is run.
A Selenium WebDriver instance will be loaded into the
context object which is passed as the second argument to the
execute method, having been initialised with the arguments provided to Pluto (if any) when running the package.
See the Action Interface for more information.
Using Selenium in actions
You may install TypeScript definitions for Selenium Webdriver in your project to write actions using Selenium.
$ npm install @types/selenium-webdriver
// go-to.action.ts;/*** Navigates to the specified URL.*/
Tests & Specs
*.test.ts respectively. They should contain a series of specs for that particular test.
A single spec is defined by a title, an
assert to be run, and an array of
outs. Any output expected from an action should be assigned to meaningful keys in the
outs array, so that that they may be used in future actions or asserts. This way, specs can be chained to form a test, as they will be run sequentially.
See the Spec Type for more information.
// simple.test.ts;;;pluto.registerActionsGoTo;pluto.addTest'simple test',;
pluto in the directory containing test files or pass the relative or absolute path to the directory or file with the
--path argument. Below is a list of other arguments that can be passed. By default, tests run on Chrome in headless mode using the Chromium webdriver, with the default window size set by Selenium.
||The path to look for test files in|
||Show browser instead of running in headless mode|
||Keep browser open after tests are complete|
||Show devtools on open|
||Use Firefox instead of Chrome|
||Maximise browser window on open|