Skip to content

Instantly share code, notes, and snippets.

@felippenardi
Last active August 29, 2015 14:22
Show Gist options
  • Save felippenardi/75001c47baaac64893f6 to your computer and use it in GitHub Desktop.
Save felippenardi/75001c47baaac64893f6 to your computer and use it in GitHub Desktop.
Running Protractor tests

Running Protractor tests

Initiating the web driver runner

$ npm install -g protractor # installs Protractor
$ webdriver-manager update # downloads Selenium and Chrome
$ webdriver-manager start # start Selenium server

Creating a confinguration file

Create a new text file and name it conf.js. Use the address outputted on previous step and add the name of the spec file.

// conf.js content
exports.config = {
  seleniumAddress:
  'http://localhost:4444/wd/hub',
  specs: ['spec.js']
}

Running Protractor

Our conf.js will tell Protractor which server to run the specs against, and where our specs are. To run it, you just need to point protractor to this configuration file:

$ protractor conf.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment