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