angularjs – 是否需要`webdriver-manager start`?

前端之家收集整理的这篇文章主要介绍了angularjs – 是否需要`webdriver-manager start`?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在钻研AngularJS的量角器测试世界.

所有教程都建议我在webdriver-manager更新之后和执行测试之前执行以下命令:

webdriver-manager开始

根据webdriver-manager man的说法,start命令将“启动selenium服务器”.确实,一旦我运行上述命令,我就可以在http://127.0.0.1:4444/wd/hub看到一些东西

我的问题是:上面有必要吗?

我目前在没有上述命令的情况下运行测试.

我所做的就是:

webdriver-manager更新
PHP -S localhost:8000 -t dist /
量角器./test/protractor.config.js

我的测试按预期运行,即使我已经排除了webdriver-manager的启动.

有人可以解释为什么webdriver-manager启动是必要的吗?

:编辑:

我的量角器/ fooTests.js:

exports.config = {
    directConnect: true,capabilities: {
        'browserName': 'chrome'
    },specs: ['protractor/fooTests.js'],jasmineNodeOpts: {
        showColors: true,defaultTimeoutInterval: 30000
    }
};

我的量角器/ fooTests.js:

describe('test for the bar code',function() {
    it('should login',function() {
        browser.get('http://localhost:8000');

        element(by.model('password')).sendKeys('123456');
        element(by.css('[type="submit"]')).click();
    });
    it('should inspect element ',function() {
        expect(element(by.id('foo-script')).isPresent()).toBe(true);
        console.log('Login Success');
    });
});
量角器正在向Selenium发送命令,Selenium正在使用其驱动程序与浏览器进行通信.
webdriver-manager start

正在启动Selenium.

有3个基本选项:

> directConnect.这使得量角器直接与selenium驱动程序通信,而不使用Selenium服务器.但是,此选项的功能有限:

directConnect: true – Your test script communicates directly Chrome Driver or Firefox Driver,bypassing any Selenium Server. If this is true,settings for seleniumAddress and seleniumServerJar will be ignored. If you attempt to use a browser other than Chrome or Firefox an error will be thrown.

>连接到已运行的selenium服务器(本地或远程),由seleniumAddress指定.可以使用webdriver-manager启动脚本启动服务器.
>从测试脚本启动服务器.

您可以浏览文档https://github.com/angular/protractor/blob/master/docs/server-setup.md中的所有选项

猜你在找的Angularjs相关文章