0

My config.js looks like this

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['test1.js', 'test2.js'],
  framework: 'jasmine2'
};

As you can see I have 2 test files, what I want to do is to use a single variable across all the specs.

How can I achieve it ?

Stevik
  • 1,092
  • 2
  • 16
  • 37
  • possible duplicate of [Protractor set global variables](http://stackoverflow.com/questions/31203398/protractor-set-global-variables) – Michael Radionov Jul 31 '15 at 07:51

1 Answers1

1
exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',
    framework: 'jasmine2',

    specs: [
        'spec1.js',
        'specs2.js'
    ],
    params: {
        screenWidth: 1920,
        screenHeight: 1080
    }
}

in order to access variable you should do smth like this in your specs:

browser.params.screenWidth
Sergey Teplyakov
  • 603
  • 8
  • 18