久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何讀取參數的值,存在于規格中量角器的 con

How to read parameter#39;s value, present in conf.js file of protractor in specs(如何讀取參數的值,存在于規格中量角器的 conf.js 文件中)
本文介紹了如何讀取參數的值,存在于規格中量角器的 conf.js 文件中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

例如: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 中傳遞的參數值采取必要的操作.有沒有辦法可以做到這一點.

I need to read the parameter's value present in the conf.js file, so that I can read them in specs.js file to take necessary actions based on the parameter;'s value passed in the conf.js. Is there a way in which this can be possible.

推薦答案

是的,您可以使用 browser.getProcessedConfig 訪問所有配置值.檢查 這里了解更多詳情

Yes, you can access all the config values using browser.getProcessedConfig.Check here for more details

下面的例子

describe('test', function(){
    it('test', function(){
        browser.get('http://www.way2automation.com/angularjs-protractor/registeration/#/login');
        browser.getProcessedConfig().then(function(config){
            console.log(config.baseUrl) // Print Url
            console.log(config.specs) // Prints specs
            console.log(config.capabilities) // Prints capabilities
        })
        browser.sleep(10000)
    });
});

如果您希望使其可重復使用

In case you are looking to make it re-usable

 this.getConfParameterValue = function() {
     return browser.getProcessedConfig().then(function(config) {
           return config.directConnect;
     }) 
 }

這篇關于如何讀取參數的值,存在于規格中量角器的 conf.js 文件中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認為文檔“準備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發技術
What do jasmine runs and waitsFor actually do?(jasmine 運行和等待實際上是做什么的?)
How to provide mock files to change event of lt;input type=#39;file#39;gt; for unit testing(如何提供模擬文件來更改 lt;input type=filegt; 的事件用于單元測試)
How to unit test a chained method using Jasmine(如何使用 Jasmine 對鏈式方法進行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監視函數中的函數調用?)
主站蜘蛛池模板: 国产精品免费一区二区三区 | 96国产精品久久久久aⅴ四区 | 毛片视频网址 | 久久久久久久久久久蜜桃 | 热99视频| 亚洲精品中文字幕在线观看 | 在线播放中文字幕 | 国产黄色av网站 | 亚洲精品一区二区网址 | 久久久久久国产精品免费免费狐狸 | 亚洲视频国产视频 | 成人精品一区二区三区中文字幕 | 欧美日韩在线视频一区二区 | 国产视频三区 | 国产一区不卡 | 亚洲视频一区在线 | 在线看片网站 | 久久久精 | 蜜月aⅴ免费一区二区三区 99re在线视频 | 中文字幕精品一区二区三区在线 | 欧美精品片 | 男女下面一进一出网站 | 在线观看中文字幕dvd播放 | 特级a欧美做爰片毛片 | 成人免费毛片片v | 亚洲免费精品一区 | 国产精品久久久久久高潮 | 婷婷毛片 | 久久精品一区二区 | 欧美人妇做爰xxxⅹ性高电影 | 国产一区不卡 | 国产视频三区 | 天天曰天天曰 | 欧美性生活网 | 国产高清一区二区三区 | 久久久高清 | 婷婷福利视频导航 | 国产成人精品一区二区三区在线观看 | av一区在线观看 | 九九国产| 激情福利视频 |