Basics of end-to-end testing with protractor and javascript.
- Required tools
-
Chrome browser
-
Node.js - latest stable version
-
Clone the repository with Git or
Download ZIP
and extract contents. -
Inside the repository folder (where
package.json
file is located) use npm to install all required dependencies:npm install
-
Install protractor (use
-g
switch to install it globally)npm install -g protractor
-
Update selenium webdriver
webdriver-manager update
-
Install gulp task runner
npm install -g gulp
- Check if everything was set up correctly
-
Use gulp to start the application
gulp webserver
Head to
localhost:8888
and check if the webpage loads correctly. There might be some errors from the server, but we can ignore them for now. -
Open another terminal window and try running the tests
protractor tests\config.js
Seeing a lot of failed tests? Good, we're going to fix them during the workshop :)
Warning: if you experience problems on Windows with NodeJS being unable to locate modules, head over here.