本文整理匯總了TypeScript中protractor/globals.by.model方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript by.model方法的具體用法?TypeScript by.model怎麽用?TypeScript by.model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor/globals.by
的用法示例。
在下文中一共展示了by.model方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
return this.isOpen().then(isOpen => {
this.open(); // you have to in order to get to the dropdown
let year = rxSelect.initialize(this.element(by.model('currentYear'))).selectedOption.getText();
// if datepicker was closed before starting, put it back
if (!isOpen) {
this.close();
}
return year;
});
示例2: month
set month(value: AccessorPromiseString) {
this.open();
let dropdownExpectedValue = moment(`2000-${value}`, 'YYYY-MM').format('MMM');
if (dropdownExpectedValue === 'Invalid date') {
throw new Error(
`Unexpected month value for month number "${value}". Months are not zero-indexed!`
);
}
let slowClick = false;
rxSelect.initialize(this.element(by.model('currentMonth'))).select(dropdownExpectedValue, slowClick);
}
示例3: it
it('should greet the named user', () => {
element(by.model('yourName')).sendKeys('Julie');
let greeting = element(by.binding('yourName'));
expect(greeting.getText()).toEqual('Hello Julie!');
});
示例4: year
set year(value: AccessorPromiseString) {
this.open();
let slowClick = false;
rxSelect.initialize(this.element(by.model('currentYear'))).select(value, slowClick);
}