【发布时间】:2016-05-20 15:56:38
【问题描述】:
目前,在this answer 的帮助下,我正在使用具有多种功能的不同 Firefox 配置文件设置。我的每个 Firefox 配置文件都设置了一个客户端证书,该证书将其与其他配置文件区分开来。
有没有一种方法可以创建一个不同的配置文件可以相互交互的测试?
我知道您可以使用browser.forkNewDriverInstance 在测试中按顺序生成新的浏览器。 我想将它与我在多功能中设置的浏览器结合起来,使用自定义 Firefox 配置文件按顺序运行测试,而不是并行运行。
所以我的 protractor.conf.js 看起来像这样:
...
getMultiCapabilities: function () {
return q.all([
newFirefoxProfile('test/firefox-profile-1'),
newFirefoxProfile('test/firefox-profile-2')
]);
},
...
在 test.spec.js 文件中:
describe('my account', function () {
var browser2 = browser.forkNewDriverInstance();
//rather than fork new instance, I want a different capability instance
it('should have grant new authority', function () {
//browser 1 gives new authority to browser 2
//browser2.get('#/my-account/details');
//browser2 verify new authority
});
}
【问题讨论】:
标签: angularjs protractor