本文整理匯總了TypeScript中protractor.browser.isElementPresent方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.isElementPresent方法的具體用法?TypeScript browser.isElementPresent怎麽用?TypeScript browser.isElementPresent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor.browser
的用法示例。
在下文中一共展示了browser.isElementPresent方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('Deselect bubble by click on "X", or on the bubble(TC30)', async () => {
await mapChart.clickOnBubble('green');
await mapChart.clickXiconOnBubble('USA');
expect(await browser.isElementPresent(mapChart.selectedCountryLabel)).toBeFalsy();
await mapChart.clickOnBubble('green');
expect(await mapChart.selectedCountriesLabels.getText()).toMatch('United States');
expect(await mapChart.selectedBubbles.get(0).getAttribute('style')).toContain('opacity: 1;');
await mapChart.deselectBubble('green');
expect(await browser.isElementPresent(mapChart.selectedCountryLabel)).toBeFalsy();
});
示例2: it
it('should load node children asynchronously', async () => {
page.navigateTo();
page.getAsyncChildrenNodeFolding().click();
const firstAsyncChild = page.getFirstAsyncChild();
expect(await browser.isElementPresent(firstAsyncChild)).toBe(true);
expect(await firstAsyncChild.getText()).toEqual('Input Mono');
expect(await page.getLastAsyncChild().getText()).toEqual('Source Code Pro');
});
示例3:
return modal.isPresent().then(isPresent => {
if (isPresent) {
console.error('Modal dialog is showed, need to click confirm button');
return browser.isElementPresent(confirmButton)
.then(isPresent => {
if (isPresent) {
console.error('clicking on confirm button');
return confirmButton.click();
}
}, error => {
console.log('error');
console.log(error);
});
}
});
示例4:
browser.wait(() => {
return browser.isElementPresent(connect);
}, Constants.longWait);
示例5: waitForElement
export function waitForElement(selector: string) {
return browser.isElementPresent(by.css(selector) as ProtractorBy);
}
示例6: waitForElement
export async function waitForElement(selector: string) {
return await browser.isElementPresent(by.css(selector));
}
示例7: expectOverlayInFullscreen
/** Expects the overlay container to be in fullscreen mode. */
async function expectOverlayInFullscreen() {
expect(await browser.isElementPresent(by.css('#fullscreen-pane > .cdk-overlay-container')))
.toBe(true, 'Expected the overlay container to be in fullscreen mode.');
}
示例8: expectOverlayInBody
/** Expects the overlay container to be inside of the body element. */
async function expectOverlayInBody() {
expect(await browser.isElementPresent(by.css('body > .cdk-overlay-container')))
.toBe(true, 'Expected the overlay container to be inside of the body.');
}
示例9: waitForDialog
function waitForDialog() {
return browser.isElementPresent(by.css('md-dialog-container') as ProtractorBy);
}