mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1772]Add CardSelectItemPage PO (#5555)
* Add CardSelectItemPage PO * no message
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { element, by, ElementFinder, Locator } from 'protractor';
|
||||||
|
import { BrowserVisibility } from '../../utils/public-api';
|
||||||
|
import { DropdownPage } from '../../../material/pages/dropdown.page';
|
||||||
|
|
||||||
|
export class CardSelectItemPage {
|
||||||
|
|
||||||
|
rootElement: ElementFinder;
|
||||||
|
labelLocator: Locator = by.css('div[data-automation-id*="card-select-label"]');
|
||||||
|
dropdown: DropdownPage;
|
||||||
|
|
||||||
|
constructor(label: string = 'fileSource') {
|
||||||
|
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-selectitem`));
|
||||||
|
this.dropdown = new DropdownPage(this.rootElement.element(by.css('mat-select')));
|
||||||
|
}
|
||||||
|
|
||||||
|
async checkLabelIsPresent(): Promise<void> {
|
||||||
|
const labelElement: ElementFinder = this.rootElement.element(this.labelLocator);
|
||||||
|
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getSelectedOptionText(): Promise<string> {
|
||||||
|
return this.dropdown.getSelectedOptionText();
|
||||||
|
}
|
||||||
|
|
||||||
|
async selectDropdownOption(option: string): Promise<void> {
|
||||||
|
await this.dropdown.selectDropdownOption(option);
|
||||||
|
}
|
||||||
|
}
|
@@ -18,3 +18,4 @@
|
|||||||
export * from './card-view-text-item.page';
|
export * from './card-view-text-item.page';
|
||||||
export * from './card-view-boolean-item.page';
|
export * from './card-view-boolean-item.page';
|
||||||
export * from './card-view-date-item.page';
|
export * from './card-view-date-item.page';
|
||||||
|
export * from './card-view-select-item.page';
|
||||||
|
Reference in New Issue
Block a user