本文整理汇总了TypeScript中protractor.ExpectedConditions.presenceOf方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ExpectedConditions.presenceOf方法的具体用法?TypeScript ExpectedConditions.presenceOf怎么用?TypeScript ExpectedConditions.presenceOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.ExpectedConditions
的用法示例。
在下文中一共展示了ExpectedConditions.presenceOf方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should display different size when set presize', async () => {
let size;
const testButton = element(by.id('test-button'));
const presizeList = element(by.id('presize-list')).all(by.tagName('jigsaw-button'));
presizeList.get(0).click();
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('.jigsaw-button-clicked')))));
size = await testButton.getSize();
expect(size.width).toBe(80);
expect(size.height).toBe(20);
presizeList.get(1).click();
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('.jigsaw-button-clicked')))));
size = await testButton.getSize();
expect(size.width).toBe(80);
expect(size.height).toBe(28);
presizeList.get(2).click();
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('.jigsaw-button-clicked')))));
size = await testButton.getSize();
expect(size.width).toBe(80);
expect(size.height).toBe(36);
});
示例2: it
it('should change steps correctly when stepper button is clicked', async () => {
const previousButton = element.all(by.buttonText('Back'));
const nextButton = element.all(by.buttonText('Next'));
expect(await element(by.css('mat-step-header[aria-selected="true"]')).getText())
.toBe('1\nFill out your name');
screenshot('start');
nextButton.get(0).click();
expect(await element(by.css('mat-step-header[aria-selected="true"]')).getText())
.toBe('2\nFill out your address');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('click next');
previousButton.get(0).click();
expect(await element(by.css('mat-step-header[aria-selected="true"]')).getText())
.toBe('1\nFill out your name');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('click back');
});
示例3: reportGame
reportGame(result: Array<Array<string>>) {
element(by.css('.app-action button')).click();
browser.wait(ExpectedConditions.presenceOf(element(by.partialButtonText('Report'))), 5 * oneSecond);
for (let i = 0; i < result.length; i++) {
for (let j = 0; j < result[i].length; j++) {
element(by.css(`input[name="name${i}.${j}"]`)).sendKeys(result[i][j]);
browser.sleep(shortSleep);
}
}
element(by.partialButtonText('Report')).click();
browser.wait(ExpectedConditions.not(ExpectedConditions.presenceOf(
element(by.tagName('app-game')))), 5 * oneSecond);
}
示例4: it
it('should prevent click handlers from executing when disabled', async () => {
await element(by.id('test-button')).click();
expect(await element(by.id('click-counter')).getText()).toEqual('1');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
await element(by.id('disable-toggle')).click();
await element(by.id('test-button')).click();
expect(await element(by.id('click-counter')).getText()).toEqual('1');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
});
示例5: it
it('should change tabs when the label is clicked', () => {
tabLabels.get(1).click();
expect(getLabelActiveStates(tabLabels)).toEqual([false, true, false]);
expect(getBodyActiveStates(tabBodies)).toEqual([false, true, false]);
browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
.then(() => screenshot('click1'));
tabLabels.get(0).click();
expect(getLabelActiveStates(tabLabels)).toEqual([true, false, false]);
expect(getBodyActiveStates(tabBodies)).toEqual([true, false, false]);
browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
.then(() => screenshot('click0'));
});
示例6: retrieveTextFromElement
// Retrieve text from an element
static retrieveTextFromElement(elm: ElementFinder) {
browser.wait(ExpectedConditions.presenceOf(elm), Constants.longWait);
browser.wait(ExpectedConditions.visibilityOf(elm), Constants.longWait);
return browser.wait(() => {
return elm.getText();
});
}
示例7: beforeAll
beforeAll(() => {
browser.get('');
// Don't run any specs until we see a <div> on the page.
browser.wait(
ExpectedConditions.presenceOf(element(by.css('div.ts1'))),
timeoutMs);
}, timeoutMs);
示例8: navigatePastWelcome
// Navigate to Editor base page and move past welcome splash
static navigatePastWelcome() {
browser.get(browser.baseUrl);
let elm = element(by.id('welcome_start'));
browser.wait(ExpectedConditions.presenceOf(elm), Constants.longWait);
browser.wait(ExpectedConditions.visibilityOf(elm), Constants.longWait);
this.click(elm);
browser.wait(ExpectedConditions.invisibilityOf(element(by.css('.welcome'))), Constants.longWait);
};
示例9: it
it('should be disabled when disable the radio group', async () => {
element(by.id('toggle-disable')).click();
element(by.id('water')).click();
expect(element(by.id('water')).getAttribute('class')).toContain('mat-radio-disabled');
await browser.wait(ExpectedConditions.presenceOf(element(by.css('.mat-radio-disabled'))));
expect(element(by.css('input[id=water-input]')).getAttribute('disabled')).toBeTruthy();
element(by.id('leaf')).click();
expect(element(by.id('leaf')).getAttribute('class')).toContain('mat-radio-disabled');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
expect(element(by.css('input[id=leaf-input]')).getAttribute('disabled')).toBeTruthy();
});
示例10: elementsPresent
// Custom ExpectedCondition to be used to ensure that ArrayFinder count is non-zero
static elementsPresent(elementArrayFinder, minCount) {
let hasCount = (() => {
return elementArrayFinder.count()
.then((count) => {
return count >= minCount;
});
});
return ExpectedConditions.and(ExpectedConditions.presenceOf(elementArrayFinder), hasCount);
};