javascript - E2E testing on multiple/parallel browsers in Protractor? -
using protractor how setup/add parallel browsers testing.
example: test suites on not chrome
, firefox
? there simple way of test mobile? ios8 safari or mobile chrome?
question:
how write exports.config object support chrome , firefox
in parallel suite testing?
exports.config = { multicapabilities: [ { 'browsername': 'chrome', 'chromeoptions': { args: ['--test-type'] } } ]} suites: { homepagefooter: 'protractor/homepage/footer.spec.js' },
using protractor how setup/add parallel browsers testing.
you need list browsers in multicapabilities
:
multicapabilities: [{ 'browsername': 'firefox' }, { 'browsername': 'chrome' }]
also there simple way of test mobile? ios8 safari or mobile chrome?
one option use appium
framework, here relevant documentation sections:
another option use browserstack
(or sauce labs
) as selenium server. there huge variety of browsers/platforms choose from, including different mobile devices.
here sample config 1 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.com/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 } };
Comments
Post a Comment