rebel-l / experiment-protractor

just a prototype for protractor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

experiment-protractor

License: MIT

This is just a prototype for protractor.

Requirements

You need NodeJS installed with NPM and Yarn.

Optional you can also install the headless browser PhantomJS but this isn't a common case as you normally want to test with real browsers.

Setup

To get this project run just switch to the project folder an execute

yarn install

Afterwards get the webdriver installed with

npm install -g webdriver-manager

Update the wedriver for new drivers like geckodriver

webdriver-manager update

You can run the webdriver by executing

webdriver-manager start

You can check if the webdriver is running on http://localhost:4444/wd/hub.

Angular Tutorial Test

Ensure that the webdriver is running! The tests can be simple executed by running

./node_modules/.bin/protractor tests/tutorial/conf.js

PhantomJS Test

To run these tests you need to run the PhantomJS webdriver instead of the webdriver coming with protractor. You can achieve that (if you have installed PhantomJS) by executing

phantomjs --webdriver=9515

Then as before just execute protractor

./node_modules/.bin/protractor tests/phantomjs/conf.js 

Using Protractor Without Angular

Protractor is looking for AngularJS by default. You can turn off that behaviour by adding the following line in your spec file before you start requesting any url

browser.ignoreSynchronization = true;

Trouble Shooting

Webdriver Error

It can happen that the tests throws an exception when running with webdriver. Ensure that you have executed

webdriver-manager update

before you start the webdriver. Most problems I had so far were solved by that.

About

just a prototype for protractor

License:MIT License


Languages

Language:JavaScript 100.0%