[Protractor] Getting Started With Protractor

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

 

posted @ 2015-11-15 05:19  Zhentiw  阅读(243)  评论(0编辑  收藏  举报