![[Protractor] Getting Started With Protractor [Protractor] Getting Started With Protractor](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700)
Protractor is an end-to-end testing library for AngularJS.
Install:
npm install -g protractor
This will install two command line tools, protractor
and webdriver-manager
.
Set up:
webdriver-manager update
webdriver-manager start
Protractor Config file:
exports.config = {
specs: [
'./e2etest/**/*.spec.js'
],
seleniumAddress: 'http://localhost:4444/wd/hub'
};
index.spec.js:
describe('angularjs homepage todo list', function() {
it('should add a todo', function() {
browser.get('https://angularjs.org');
expect(browser.getTitle()).toBe('AngularJS — Superheroic JavaScript MVW Framework');
});
});
RUN:
protractor conf.js