The Wayback Machine - https://web.archive.org/web/20170421143717/https://www.npmjs.com/package/tractor
node package manager

tractor

tractor

A UI around Gherkin & Protractor to help write E2E tests for Angular applications without needing to know JavaScript

npm version Coveralls

Install:

To install the cli, run the following:

npm install -g tractor

That will install the global binary, which will allow you to run the tractor command from anywhere.

From there, you should navigate to the root directory of your Angular app and run:

tractor init

That sets up the test directory structure, installs some dependencies, and sets up Selenium. The initialisation can be configured with a tractor.conf.js file (described in the Config section).

Once everything has been initialised, you need to start the tractor application from the root directory of your app with:

tractor start

The app should then be available running at http://localhost:4000. The port can be configured in the tractor.conf.js file.

Config:

If you want to change the port that tractor runs at, or the file where it stores the generated files, you need to add a tractor.conf.js file in the root of your app directory, which should look something like the following:

module.exports = {
    directory: './path/to/test/directory', // defaults to root/tractor 
    port: number,                          // defaults to 4000 
    environments: Array<string>,           // a list of URLs for the environments to run the tests in 
    tags: Array<string>,                   // a list of tags for Cucumber 
    beforeProtractor: Function,            // a function to run before protractor runs 
    afterProtractor: Function              // a function to run after protractor runs 
};