1

Protractor config:

module.exports = {
    baseUrl: 'https://example.com/#/',

    params: require('./params/params.js'),

    capabilities: {
        'browserName': 'chrome',
        'chromeOptions': {
            'args': ['incognito', '--disable-cache', '--disable-extensions'],
            prefs: {
                intl: {
                    accept_languages: "fr-CA"
                }
            }
        },
        prefs: {
            'config.http.use-cache': false
        },
        shardTestFiles: true,
        maxInstances: 2
    },
}

I have some specs that test the French site and the English site. Right now I have to manually change the accept_languages property when I switch between tests.

Is there any way to define what language the test will use from each individual spec file?

I know it's possible to access baseUrl via browser.baseUrl but I'm not sure how to access the capabilities object.

luker02
  • 387
  • 2
  • 5
  • 13

1 Answers1

1

I did this once before (sorry, the details are lost to time) and these two posts helped me make it happen.

How can I use command line arguments in Angularjs Protractor?

Is there any way to pass multiple browser via protractor cli

Basically, you can define and pass in quite a bit of info to the browser object.

Community
  • 1
  • 1
MBielski
  • 6,628
  • 3
  • 32
  • 43