本文整理汇总了TypeScript中protractor.ElementFinder.element方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ElementFinder.element方法的具体用法?TypeScript ElementFinder.element怎么用?TypeScript ElementFinder.element使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.ElementFinder
的用法示例。
在下文中一共展示了ElementFinder.element方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
showHideBtn = element(by.binding('toggleBtnText'));
ng2Heroes = element(by.css('.ng2-heroes'));
ng2HeroesHeader = ng2Heroes.element(by.css('h1'));
ng2HeroesExtra = ng2Heroes.element(by.css('.extra'));
ng2HeroesAddBtn = ng2Heroes.element(by.buttonText('Add Hero'));
ng1Heroes = element.all(by.css('.ng1-hero'));
});
示例2: it
it('should select value and close dropdown', async () => {
select.element(by.css('.ng-select-container')).click();
select.all(by.css('.ng-option')).first().click();
expect(select.getAttribute('class')).not.toMatch('ng-select-opened');
const text = await element(by.id('ngModel')).getText();
expect(text).toEqual('1');
});
示例3: it
it('adds and removes element', () => {
addInactiveHero();
let li = host.element(by.css('li'));
expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX);
removeHero();
expect(li.isPresent()).toBe(false);
});
示例4: fromDetail
// Get hero id and name from the given detail element.
static async fromDetail(detail: ElementFinder): Promise<Hero> {
// Get hero id from the first <div>
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
let _name = await detail.element(by.css('h2')).getText();
return {
id: +_id.substr(_id.indexOf(' ') + 1),
name: _name.substr(0, _name.lastIndexOf(' '))
};
}
示例5: clickDeleteRow
public clickDeleteRow() {
return this.row.element(by.className('clientsetting-row-delete')).click();
}
示例6: getConfigSetName
public getConfigSetName() {
return this.row.element(by.className('configset-name')).getText();
}