本文整理匯總了TypeScript中protractor/globals.protractor.promise類的典型用法代碼示例。如果您正苦於以下問題:TypeScript protractor.promise類的具體用法?TypeScript protractor.promise怎麽用?TypeScript protractor.promise使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了protractor.promise類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getFormData
getFormData() {
let mainPanel = element.all(by.css('.metron-slider-pane-edit')).last();
return protractor.promise.all([
mainPanel.element(by.css('.form-title')).getText(),
mainPanel.element(by.css('input[name="sensorTopic"]')).getAttribute('value'),
mainPanel.element(by.css('select[formcontrolname="parserClassName"]')).getAttribute('value'),
mainPanel.element(by.css('input[formcontrolname="grokStatement"]')).getAttribute('value'),
mainPanel.all(by.css('div[name="fieldSchema"] table tr')).getText(),
mainPanel.all(by.css('div[name="threatTriage"] table tr')).getText(),
mainPanel.element(by.css('input[formcontrolname="index"]')).getAttribute('value'),
mainPanel.element(by.css('metron-config-number-spinner[name="batchSize"] input')).getAttribute('value'),
mainPanel.all(by.css('metron-config-advanced-form input')).getAttribute('value')
]).then(args => {
return {
title: args[0],
parserName: args[1],
parserType: args[2],
grokStatement: args[3],
fieldSchemaSummary: args[4],
threatTriageSummary: args[5],
indexName: args[6],
batchSize: args[7],
advancedConfig: args[8]
}
});
}
示例2:
return queueForClick.then(() => {
let promiseArray = [];
parserNames.map(name => {
promiseArray.push(this.waitForElement(this.getIconButton(name, waitOnClassName)));
});
return protractor.promise.all(promiseArray).then(args => {
return args;
});
});
示例3: element
return element(by.css('span[data-action=\"'+ dropDownLinkName +'\"]')).click().then(() => {
let promiseArray = [];
parserNames.map(name => {
promiseArray.push(this.waitForElement(this.getIconButton(name, waitOnClassName)));
});
return protractor.promise.all(promiseArray).then(args => {
return this.toggleSelectAll().then(() => {
return args;
})
});
});
示例4: _selectLastDayOfCurrentMonth
/**
* @private
* @deprecated Now that datepickers return strings, this complicated logic is not needed.
* @description
* Will select the last day of the current month seen on the picker calendar.
* Does not accept arguments. Set the calendar month yourself with
* {@link rxDatePicker#month} and {@link rxDatePicker#year} first, so that logic
* picks the correct date.
*/
private _selectLastDayOfCurrentMonth(): Promise<void> {
this.open();
return protractor.promise.all([
(this.month as Promise<string>),
(this.year as Promise<string>),
]).then(results => {
let month = results[0];
let year = results[1];
let formattedDate = `${year}-${month}`;
let lastOfMonth = moment(formattedDate, 'YYYY-MM').endOf('month');
return this._selectVisibleDate(lastOfMonth.format('YYYY-MM-DD'));
});
};
示例5: getDropdownActionState
getDropdownActionState() {
return protractor.promise.all([
element.all(by.css('.dropdown.open .dropdown-menu span:not(.disabled)')).count(),
element.all(by.css('.dropdown.open .dropdown-menu span.disabled')).count(),
element.all(by.css('.dropdown-menu')).isDisplayed()
]).then(args => {
return {
enabled: args[0],
disabled: args[1],
displayed: args[2][0],
}
});
}