本文整理匯總了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();
}