mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ACS-8611: cleanup Stencil suite (Protractor) (#10103)
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { FormFields } from '../form-fields';
|
||||
import { by, Locator } from 'protractor';
|
||||
|
||||
export class DocumentWidgetPage {
|
||||
|
||||
formFields: FormFields = new FormFields();
|
||||
fileLocator: Locator = by.css(`div [class*='upload-widget__content-text']`);
|
||||
|
||||
getFieldText(fieldId): Promise<string> {
|
||||
return this.formFields.getFieldText(fieldId, this.fileLocator);
|
||||
}
|
||||
|
||||
getFileName(fieldId): Promise<string> {
|
||||
return this.formFields.getFieldText(fieldId, this.fileLocator);
|
||||
}
|
||||
}
|
@@ -1,79 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { FormFields } from '../form-fields';
|
||||
import { by, element, $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||
import { materialLocators } from '../../public-api';
|
||||
|
||||
export class TypeaheadWidgetPage {
|
||||
|
||||
field = $('input[data-automation-id="adf-typeahed-search-input"]');
|
||||
firstResult = $('#adf-typeahed-widget-user-0');
|
||||
groupDropDownList = $(materialLocators.Autocomplete.panel.class);
|
||||
formFields = new FormFields();
|
||||
|
||||
getFieldLabel(fieldId: string): Promise<string> {
|
||||
return this.formFields.getFieldLabel(fieldId);
|
||||
}
|
||||
|
||||
getFieldValue(fieldId: string): Promise<string> {
|
||||
return this.formFields.getFieldValue(fieldId);
|
||||
}
|
||||
|
||||
getFieldText(fieldId: string): Promise<string> {
|
||||
return this.formFields.getFieldText(fieldId);
|
||||
}
|
||||
|
||||
insertValue(fieldId: string, value: string): Promise<void> {
|
||||
return this.formFields.setValueInInputById(fieldId, value);
|
||||
}
|
||||
|
||||
async checkDropDownListIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.groupDropDownList);
|
||||
}
|
||||
|
||||
async checkOptionIsListed(option: string): Promise<void> {
|
||||
const optionElement = element(by.cssContainingText('[id="adf-typeahed-label-name"]', option));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(optionElement);
|
||||
}
|
||||
|
||||
async getDropDownList(): Promise<string[]> {
|
||||
const option = $('[id="adf-typeahed-label-name"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(option);
|
||||
return element.all(option).map((elementFinder) => elementFinder.getText());
|
||||
}
|
||||
|
||||
async selectOptionFromDropDown(userName: string): Promise<void> {
|
||||
const option = element(by.cssContainingText('[id="adf-typeahed-label-name"]', userName));
|
||||
await BrowserActions.click(option);
|
||||
}
|
||||
|
||||
async checkTypeaheadFieldIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.field);
|
||||
}
|
||||
|
||||
async fillTypeaheadField(value: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.field);
|
||||
await BrowserActions.clearSendKeys(this.field, value, 10);
|
||||
}
|
||||
|
||||
async selectOptionFromDropdown(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.firstResult);
|
||||
await BrowserActions.click(this.firstResult);
|
||||
}
|
||||
}
|
@@ -33,14 +33,11 @@ import { AmountWidgetPage } from './amount-widget.page';
|
||||
import { ContainerWidgetPage } from './container-widget.page';
|
||||
import { PeopleWidgetPage } from './people-widget.page';
|
||||
import { TabPage } from './tab.page';
|
||||
import { DocumentWidgetPage } from './document-widget.page';
|
||||
import { GroupWidgetPage } from './group-widget.page';
|
||||
import { TypeaheadWidgetPage } from './typeahead-widget.page';
|
||||
import { AttachFolderWidgetPage } from './attach-folder-widget.page';
|
||||
import { JsonWidgetPage } from './json-widget.page';
|
||||
|
||||
export class Widget {
|
||||
|
||||
multilineTextWidget(): MultilineTextWidgetPage {
|
||||
return new MultilineTextWidgetPage();
|
||||
}
|
||||
@@ -85,10 +82,6 @@ export class Widget {
|
||||
return new TextWidgetPage();
|
||||
}
|
||||
|
||||
documentWidget(): DocumentWidgetPage {
|
||||
return new DocumentWidgetPage();
|
||||
}
|
||||
|
||||
checkboxWidget(): CheckboxWidgetPage {
|
||||
return new CheckboxWidgetPage();
|
||||
}
|
||||
@@ -121,10 +114,6 @@ export class Widget {
|
||||
return new GroupWidgetPage();
|
||||
}
|
||||
|
||||
typeahedWidget(): TypeaheadWidgetPage {
|
||||
return new TypeaheadWidgetPage();
|
||||
}
|
||||
|
||||
tab(): TabPage {
|
||||
return new TabPage();
|
||||
}
|
||||
|
Reference in New Issue
Block a user