Protractor is a wrapper for our test runner that will manage of all the WebDriver details. Actions such as starting, stopping, and configuring the desired capabilities will be taken care of by Protractor. It offers us a more simple and direct way of using WebDriver, one where we need less boilerplate code. On top of that, Protractor wraps the API of WebDriver to make it slightly easier to use.
In the beginning, Protractor was designed to be used to test AngularJS applications using the Jasmine test runner. Currently, we can use Mocha and test applications written with other frameworks.
Let's change our project to use Protractor. We can now remove the selenium-webdriver
module from our package.json
file. Do the same thing with its respective folder under node_modules/
. Remove chromedriver
and the Selenium Server JAR files. Also remove test/index.js
. Now we can install Protractor:
$ me@~/mycafe> npm install --save-dev protractor