當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript browser.getCapabilities方法代碼示例

本文整理匯總了TypeScript中protractor.browser.getCapabilities方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.getCapabilities方法的具體用法?TypeScript browser.getCapabilities怎麽用?TypeScript browser.getCapabilities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在protractor.browser的用法示例。


在下文中一共展示了browser.getCapabilities方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: afterEach

 afterEach(function (done) {
     browser.getCapabilities()
         .then(function (capabilities) {
             if (capabilities.get('browserName') !== 'firefox') {
                 browser.manage().logs().get('browser').then(done, done.fail);
                 browser.waitForAngular();
             } else {
                 done();
             }
         });
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:11,代碼來源:e2e-help.ts

示例2: beforeEach

  beforeEach(async () => {
    browser.waitForAngularEnabled(false)

    videoWatchPage = new VideoWatchPage()
    pageUploadPage = new VideoUploadPage()
    loginPage = new LoginPage()

    const caps = await browser.getCapabilities()
    isMobileDevice = caps.get('realMobile') === 'true' || caps.get('realMobile') === true
    isSafari = caps.get('browserName') && caps.get('browserName').toLowerCase() === 'safari'
  })
開發者ID:jiang263,項目名稱:PeerTube,代碼行數:11,代碼來源:videos.e2e-spec.ts

示例3: afterEach

    /**
     * An example 'after' hook that will be run after every scenario.
     */
    @after()
    private async afterEach(scenario: HookScenarioResult) {
        let success = scenario.result.status === Status.PASSED ? 'successfully' : 'unsuccessfully';
        console.log(`The scenario '${scenario.pickle.name}' has completed ${success}`);

        // Taking a screenshot of the browser if the scenario has failed.
        if (scenario.result.status === Status.FAILED) {
            let screenshot = await browser.takeScreenshot();
            let browserName = (await browser.getCapabilities()).get('browserName');
            let filename = browserName + ' FAIL - ' + scenario.pickle.name + '.png';

            Utils.writeScreenshot(screenshot, filename) 
        }
    }
開發者ID:akotsar,項目名稱:cucumber-protractor-test-seed,代碼行數:17,代碼來源:hooks.ts

示例4: before

            before(() => {
                // https://git.io/vKHN1
                browser.getCapabilities().then(capabilities => {
                    browserName = capabilities.get('browserName');
                    if (browserName !== 'chrome') {
                        let chkOnDismiss = $('input[ng-model="ondismiss.should"]');
                        let txtMessage = $('input[ng-model="message"]');

                        txtMessage.clear();
                        txtMessage.sendKeys(msgText);

                        chkOnDismiss.getAttribute('checked').then(isChecked => {
                            if (!isChecked) {
                                chkOnDismiss.click();
                            }
                        });

                        element(by.buttonText('Add to Custom Stack')).click();
                    }
                });
            });
開發者ID:Droogans,項目名稱:encore-ui,代碼行數:21,代碼來源:rxNotify.midway.ts


注:本文中的protractor.browser.getCapabilities方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。