本文整理汇总了TypeScript中protractor.by.addLocator方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.addLocator方法的具体用法?TypeScript by.addLocator怎么用?TypeScript by.addLocator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.by
的用法示例。
在下文中一共展示了by.addLocator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
/// <reference path="../../built/index.d.ts" />
import {by, By} from 'protractor';
by.addLocator(0, () => {});
by.addLocator(() => {}, () => {});
by.addLocator('', () => {}, () => {});
by.addLocator('', '', '');
by.binding(0);
by.binding(true);
by.binding(() => {});
by.binding();
by.binding('', '');
by.exactBinding(0);
by.exactBinding(true);
by.exactBinding(() => {});
by.exactBinding();
by.exactBinding('', '');
by.model(0);
by.model(true);
by.model(() => {});
by.model();
by.model('', '');
by.buttonText(0);
by.buttonText(true);
by.buttonText(() => {});
by.buttonText();
by.buttonText('', '');
by.partialButtonText(0);
by.partialButtonText(true);
by.partialButtonText(() => {});
by.partialButtonText();
by.partialButtonText('', '');
示例2: deleteFirstListItem
import { browser, by, element, ElementFinder } from 'protractor';
import { Element } from '@angular/compiler';
by.addLocator(
'formControlName',
(value: string, opt_parentElement: HTMLElement, opt_rootSelector: HTMLElement) => {
const using = opt_parentElement || document;
return using.querySelectorAll(`[formControlName="${value}"]`);
}
);
export class AppPage {
navigateToHeroes() {
return browser.get('/heroes?e2e');
}
navigateToVillains() {
return browser.get('/villains?e2e');
}
async deleteFirstListItem() {
const firstDeleteButton = this.getFirstDeleteButton();
await firstDeleteButton.click();
}
getToolbarLinks() {
return element.all(by.css('mat-toolbar a[routerlinkactive]'));
}
getActiveLink() {
示例3:
browser.navigate();
browser.setLocation('url');
browser.getLocationAbsUrl();
browser.debugger();
browser.enterRepl();
browser.enterRepl(100);
browser.pause();
browser.pause(100);
browser.actions();
browser.wait('condition');
browser.wait('condition', 100);
browser.wait('condition', 100, 'message');
browser.getCurrentUrl();
browser.getTitle();
browser.takeScreenshot();
by.addLocator('name', () => {});
by.addLocator('name', 'script');
by.binding('bindingDescriptor');
by.exactBinding('bindingDescriptor');
by.model('model');
by.buttonText('searchText');
by.partialButtonText('searchText');
by.repeater('repeatDescriptor');
by.exactRepeater('repeatDescriptor');
by.cssContainingText('cssSelector', 'searchText');
by.options('optionsDescriptor');
by.deepCss('selector');
by.className('className');
by.css('css');
by.id('id');
by.linkText('linkText');