本文整理汇总了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();
}
});
});
示例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'
})
示例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)
}
}
示例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();
}
});
});