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