本文整理匯總了TypeScript中protractor.ElementFinder類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ElementFinder類的具體用法?TypeScript ElementFinder怎麽用?TypeScript ElementFinder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ElementFinder類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: describe
describe('different timings', () => {
let host: ElementFinder;
beforeEach(() => {
host = element(by.css('app-hero-list-timings'));
});
it('adds and removes element', () => {
addInactiveHero();
let li = host.element(by.css('li'));
expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX);
expect(li.getCssValue('opacity')).toMatch('1');
removeHero();
expect(li.isPresent()).toBe(false);
});
});
示例2: describe
describe('opening and closing', () => {
let sidenav: ElementFinder;
beforeEach(() => {
browser.get('/sidenav');
sidenav = element(by.tagName('md-sidenav'));
});
it('should be closed', () => {
expect(sidenav.isDisplayed()).toBeFalsy();
});
it('should open', () => {
element(by.buttonText('Open sidenav')).click();
expect(sidenav.isDisplayed()).toBeTruthy();
});
it('should close again', () => {
element(by.buttonText('Open sidenav')).click();
element(by.buttonText('Open sidenav')).click();
expect(sidenav.isDisplayed()).toBeFalsy();
});
});
示例3: getOffsetWidth
function getOffsetWidth(el: ElementFinder): promise.Promise<number> {
return browser.executeScript(
'return arguments[0].offsetWidth',
el.getWebElement()
);
}
示例4: it
it('should fill the memory with past results', () => {
first.sendKeys('1');
second.sendKeys('1');
goButton.click();
first.sendKeys('10');
second.sendKeys('20');
goButton.click();
let memory = element.all(by.repeater('result in memory').
column('result.value'));
memory.then((arr) => {
expect(arr.length).toEqual(2);
expect(arr[0].getText()).toEqual('30'); // 10 + 20 = 30
expect(arr[1].getText()).toEqual('2'); // 1 + 1 = 2
},
// TODO: remove optional error fn
() => {});
});
示例5:
.then(() => {
return elm.click();
});
示例6: getTimeElement
getTimeElement(time: Number) {
console.error(`[data-value=${time}]`);
return this.dtp.element(by.css(`[data-value="${time}"]`));
}
示例7: it
it('should delete a Clicker', () => {
removeButton.click();
element.all(by.className('clickerList')).count()
.then((count) => expect(count).toEqual(0));
});
示例8:
'test clicker one'.split('').forEach((c) => clickerField.sendKeys(c));
示例9: fillForm
private fillForm(email, password) {
this.searchElements();
this.email.sendKeys(email);
this.password.sendKeys(password);
}
示例10: it
it('should populate the form control values in the DOM', () => {
expect(firstInput.getAttribute('value')).toEqual('Nancy');
expect(lastInput.getAttribute('value')).toEqual('Drew');
});