Can I access parameters in my protractor configuration file?

后端 未结 3 502
暖寄归人
暖寄归人 2020-12-17 08:29

I start my protractor tests by running the following:

protractor protractor.conf.js --params.baseUrl=http://www.google.com --suite all

I w

3条回答
  •  北海茫月
    2020-12-17 09:08

    I am not completely sure if protractor globals are set at the beforeLaunch() stage, but they are definitely available at onPrepare() step.

    Access the params object through the global browser object:

    console.log(browser.params.baseUrl);
    

    Update: Using Jasmine 2.6+, protractor 4.x, browser.params was empty, but the following worked in onPrepare() step:

    console.log(browser.baseUrl);
    

提交回复
热议问题