admin管理员组文章数量:1314033
Using Protractor how do I setup/add a parallel browsers for testing.
example: Test suites on not only chrome
, but also firefox
? Also is there a simple way of test for mobile? say ios8 safari or mobile chrome?
Question:
How do I write the exports.config object to support chrome and firefox
in parallel suite testing?
exports.config = {
multiCapabilities: [
{
'browserName': 'chrome',
'chromeOptions': {
args: ['--test-type']
}
}
]}
suites: {
homePageFooter: 'protractor/homePage/footer.spec.js'
},
Using Protractor how do I setup/add a parallel browsers for testing.
example: Test suites on not only chrome
, but also firefox
? Also is there a simple way of test for mobile? say ios8 safari or mobile chrome?
Question:
How do I write the exports.config object to support chrome and firefox
in parallel suite testing?
exports.config = {
multiCapabilities: [
{
'browserName': 'chrome',
'chromeOptions': {
args: ['--test-type']
}
}
]}
suites: {
homePageFooter: 'protractor/homePage/footer.spec.js'
},
Share
Improve this question
edited Jun 24, 2016 at 15:20
alecxe
474k127 gold badges1.1k silver badges1.2k bronze badges
asked Dec 2, 2014 at 0:16
John AbrahamJohn Abraham
18.8k36 gold badges132 silver badges240 bronze badges
3
-
Correct me if I'm wrong, you know how to configure multiple browsers, but you are asking specifically about making it work with
suites
? Thanks. – alecxe Commented Dec 2, 2014 at 0:19 - For now I have a few suite of tests that I want to run in chrome and firefox in parallel. Nothing special. Therefore, I dont know how to configure multiple browser. – John Abraham Commented Dec 2, 2014 at 0:23
-
Okay, thanks for the info. Just one note: I haven't personally used
suites
(onlyspecs
) - I'm not sure ifsuites
would work insidemultiCapabilities
. The reason I'm worried about it is that, for example, once I had problems withexclude
inmultiCapabilities
and it turned out that it was not supported - filed an issue which was later fixed. This is just FYI. – alecxe Commented Dec 2, 2014 at 0:34
1 Answer
Reset to default 9Using Protractor how do I setup/add a parallel browsers for testing.
You need to list your browsers in multiCapabilities
:
multiCapabilities: [{
'browserName': 'firefox'
}, {
'browserName': 'chrome'
}]
Also is there a simple way of test for mobile? say ios8 safari or mobile chrome?
One option would be to use Appium
framework, here are the relevant documentation sections:
- Setting Up Protractor with Appium - Android/Chrome
- Setting Up Protractor with Appium - iOS/Safari
Another option would be to use Browserstack
(or Sauce Labs
) as your selenium server. There is a huge variety of browsers/platforms to choose from, including different mobile devices.
Here is a sample config from one of our internal projects:
'use strict';
var browserstackUser = 'user';
var browserstackKey = 'key';
exports.config = {
multiCapabilities: [
{
'browserstack.user': browserstackUser,
'browserstack.key': browserstackKey,
'browserstack.local': 'true',
'browserstack.debug': 'true',
'browserName': 'Chrome',
'os': 'Windows',
'os_version': '8',
specs: [
'*.spec.js'
],
exclude: [
'footer.disabledCookies.spec.js',
'footer.disabledFlash.spec.js'
]
},
{
'browserstack.user': browserstackUser,
'browserstack.key': browserstackKey,
'browserstack.local': 'true',
'browserstack.debug': 'true',
'browserName': 'Internet Explorer',
'browser_version': '9.0',
'os': 'Windows',
'os_version': '7',
'resolution': '1024x768',
specs: [
'*.spec.js'
],
exclude: [
'footer.disabledCookies.spec.js',
'footer.disabledFlash.spec.js'
]
}
],
maxSessions: 2,
// Browserstack's selenium server address
seleniumAddress: 'http://hub.browserstack./wd/hub',
framework: 'jasmine',
allScriptsTimeout: 300000,
baseUrl: 'http://localhost:9001',
onPrepare: function () {
require('jasmine-reporters');
var capsPromise = browser.getCapabilities();
capsPromise.then(function (caps) {
var browserName = caps.caps_.browserName.toUpperCase();
var browserVersion = caps.caps_.version;
var prePendStr = browserName + "-" + browserVersion + "-";
jasmine.getEnv().addReporter(new
jasmine.JUnitXmlReporter("test-results", true, true, prePendStr));
});
},
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
includeStackTrace: true,
defaultTimeoutInterval: 3600000
}
};
本文标签: javascriptE2E testing on multipleparallel browsers in ProtractorStack Overflow
版权声明:本文标题:javascript - E2E testing on multipleparallel browsers in Protractor? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741959178a2407168.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论