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