zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[Protractor] Getting Started With Protractor

with Started Getting
2023-09-14 08:59:20 时间

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