本文整理汇总了TypeScript中protractor.by.repeater方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.repeater方法的具体用法?TypeScript by.repeater怎么用?TypeScript by.repeater使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.by
的用法示例。
在下文中一共展示了by.repeater方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should wait on async function in conditional', async function() : Promise<any> {
browser.get('http://www.angularjs.org');
let todoList = element.all(by.repeater('todo in todoList.todos'));
if ((await todoList.count()) > 1) {
expect((await todoList.get(1).getText())).toEqual('build an angular app');
}
});
示例2: it
it('should be possible to control phone order via the drop-down menu', function() {
let queryField = element(by.model('$ctrl.query'));
let orderSelect = element(by.model('$ctrl.orderProp'));
let nameOption = orderSelect.element(by.css('option[value="name"]'));
let phoneNameColumn = element.all(by.repeater('phone in $ctrl.phones').column('phone.name'));
function getNames() {
return phoneNameColumn.map(function(elem: ElementFinder) {
return elem.getText();
});
}
queryField.sendKeys('tablet'); // Let's narrow the dataset to make the assertions shorter
expect(getNames()).toEqual([
'Motorola XOOM\u2122 with Wi-Fi',
'MOTOROLA XOOM\u2122'
]);
nameOption.click();
expect(getNames()).toEqual([
'MOTOROLA XOOM\u2122',
'Motorola XOOM\u2122 with Wi-Fi'
]);
});
示例3: constructor
constructor()
{
this.firstTextBox=element(by.model("first"));
this.secondTextBox = element(by.model("second"));
this.goButton = element(by.id("gobutton"));
this.result = element(by.repeater("result in memory")).element(by.css("td:nth-child(3)"));
}
示例4: it
it('should render phone specific links', function() {
let phoneList = element.all(by.repeater('phone in $ctrl.phones'));
let query = element(by.model('$ctrl.query'));
query.sendKeys('nexus');
waitForCount(phoneList, 1);
let nexusPhone = phoneList.first();
let detailLink = nexusPhone.all(by.css('a')).first()
detailLink.click();
expect(browser.getLocationAbsUrl()).toBe('/phones/nexus-s');
});
示例5: 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
() => {});
});
示例6:
export const meetingPanels = () => element.all(by.repeater("meeting in value"));
示例7: pageSizes
get pageSizes(): ElementArrayFinder {
return this.all(by.repeater('i in pageTracking.itemSizeList'));
}
示例8:
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('', '');
by.repeater(0);
by.repeater(true);
by.repeater(() => {});
by.repeater();
by.repeater('', '');
by.exactRepeater(0);
by.exactRepeater(true);
by.exactRepeater(() => {});
by.exactRepeater();
by.exactRepeater('', '');
by.cssContainingText(0);
by.cssContainingText(true);
by.cssContainingText(() => {});
by.cssContainingText();
by.cssContainingText('', 0);
by.cssContainingText(0, 0);
示例9: getDataForColumn
getDataForColumn(column: string) {
return element.all(by.repeater('ticket in').column(column))
.map(cell => cell.getText()).then(_.uniq).then(_.sortBy);
}