本文整理汇总了TypeScript中protractor.by.model方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.model方法的具体用法?TypeScript by.model怎么用?TypeScript by.model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.by
的用法示例。
在下文中一共展示了by.model方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should add numbers', () => {
element(by.model('first')).sendKeys('4');
element(by.model('second')).sendKeys('5');
element(by.id('gobutton')).click();
expect(element(by.binding('latest')).getText()).toEqual('9');
});
示例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: login
export function login() {
browser.get(env.baseUrl);
browser.waitForAngular();
element(by.model("vm.user.username")).sendKeys(USER.USERNAME)
element(by.model("vm.user.password")).sendKeys(USER.PASSWORD);
element(by.css(".loginButton")).click();
browser.waitForAngular();
}
示例4: 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)"));
}
示例5: it
it('can change the role of a member', () => {
projectSettingsPage.membersTab.listFilter.sendKeys('dude');
browser.wait(ExpectedConditions.visibilityOf(projectSettingsPage.membersTab.list.first()
.element(by.model('user.role'))));
Utils.clickDropdownByValue(projectSettingsPage.membersTab.list.first().element(by.model('user.role')), 'Manager');
expect<any>(projectSettingsPage.membersTab.list.first().element(by.model('user.role'))
.element(by.css('option:checked')).getText()).toEqual('Manager');
projectSettingsPage.membersTab.listFilter.clear();
});
示例6: constructor
constructor() {
this.first_operand = element(by.model('first'));
this.second_operand = element(by.model('second'));
this.operator = (optor:string) => {
return element(by.cssContainingText('option',optor));
}
this.go_button = element(by.id('gobutton'));
this.result = element(by.binding('latest'));
}
示例7: it
it('when valid should not show validation error', () => {
// whne
const input = element(by.model('ctrl.user.email'));
input.clear();
input.sendKeys('c.c@gmail.com');
// then
const errorMsg = input.element(by.xpath('following-sibling::span'));
expect(errorMsg.getAttribute('class')).toBe('ng-hide');
});
示例8: it
it("should be navigated to HomePage when login with valid account", async function(){
let username_ele = browser.element(by.model("Auth.user.name"))
let password = browser.element(by.model("Auth.user.password"))
let userDes = browser.element(by.model("model[options.key]"))
let login_btn = browser.element(by.xpath("//button[contains(text(),'Login')]"))
let home_title= browser.element(by.xpath("//h1[text()='Home']"))
await browser.waitForAngularEnabled(true)
await browser.get("http://www.way2automation.com/angularjs-protractor/registeration/#/login")
await browser.manage().window().maximize()
await username_ele.sendKeys("angular")
await password.sendKeys("password")
await userDes.sendKeys("ABC")
await login_btn.click()
await expect(home_title.isDisplayed()).toBe(true)
await browser.sleep(5000)
})