例:conf.js如何讀取參數的值,存在於規範量角器conf.js文件
exports.config = {
directConnect: false,
// multiCapabilities: [{
// browserName: 'firefox'
// }, {
// browserName: 'chrome'
// }, {
// browserName: 'internet explorer'
// }],
specs: ['Specs/spec.js'],
seleniumAddress: 'http://localhost:4444/wd/hub',
}
規格:
it('should be able to select the required organization', function() {
Select_Organization.selectOrganization();
//console.log(browser.seleniumAddress);
//This is where I need to read the config paramater values, but above is printing undefined.
expect(browser.getTitle()).toEqual('p3 by NextGen - CSR & Development Capital Management Platform');
});
我需要閱讀存在的參數的值conf.js文件,以便我可以在specs.js文件中讀取它們以根據參數;在conf.js中傳遞的值進行必要的操作。有沒有辦法可以做到這一點。
你想讀什麼價值? ..你的conf.js不包含任何定義的值 – AdityaReddy
我想讀取參數的值,例如seleniumAddress的值,它是http:// localhost:4444/wd/hub –
是的,明白了....請檢查下面的ans – AdityaReddy