mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3188] Add methods for ADW+APS1 e2e (#6816)
* Add isRemoveFileOptionDisplayed method * Add checkStartProcessFormIsDisplayed method * delete unused class * add setUserTaskName to e2e-displayValue-process * delete unused class * update isRemoveFileOptionDisplayed method * Create separate PO for start-form component * Export new PO * tslint fix * convert selectors to TestElement * improve test-element isDisplayed method * rename method * Remove methods
This commit is contained in:
@@ -19,3 +19,4 @@ export * from './widgets/public-api';
|
||||
|
||||
export * from './form-fields';
|
||||
export * from './form.page';
|
||||
export * from './start-form.page';
|
||||
|
22
lib/testing/src/lib/core/pages/form/start-form.page.ts
Normal file
22
lib/testing/src/lib/core/pages/form/start-form.page.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* @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 { TestElement } from '../../test-element';
|
||||
|
||||
export class StartFormPage {
|
||||
startProcessForm = TestElement.byCss('.adf-start-form-container');
|
||||
}
|
@@ -18,6 +18,7 @@
|
||||
import { FormFields } from '../form-fields';
|
||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||
import { Locator, element, by, browser } from 'protractor';
|
||||
import { TestElement } from '../../../test-element';
|
||||
|
||||
export class AttachFileWidgetPage {
|
||||
|
||||
@@ -30,7 +31,7 @@ export class AttachFileWidgetPage {
|
||||
attachedFileOptions = element(by.css('.mat-menu-panel .mat-menu-content'));
|
||||
viewFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="show-file"]`));
|
||||
downloadFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="download-file"]`));
|
||||
removeFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="remove"]`));
|
||||
removeFileOptionButton = TestElement.byCss(`.mat-menu-panel .mat-menu-content button[id$="remove"]`);
|
||||
|
||||
async attachFile(fieldId, fileLocation): Promise<void> {
|
||||
const widget = await this.formFields.getWidget(fieldId);
|
||||
@@ -88,14 +89,14 @@ export class AttachFileWidgetPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.viewFileOptionButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.downloadFileOptionButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.removeFileOptionButton);
|
||||
await this.removeFileOptionButton.waitVisible();
|
||||
}
|
||||
|
||||
async checkAttachFileOptionsCompletedForm(): Promise <void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.viewFileOptionButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.downloadFileOptionButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.removeFileOptionButton);
|
||||
await this.removeFileOptionButton.waitNotVisible();
|
||||
}
|
||||
|
||||
async viewAttachedFile(): Promise<void> {
|
||||
@@ -107,7 +108,7 @@ export class AttachFileWidgetPage {
|
||||
}
|
||||
|
||||
async removeAttachedFile(): Promise<void> {
|
||||
await BrowserActions.click(this.removeFileOptionButton);
|
||||
await this.removeFileOptionButton.click();
|
||||
}
|
||||
|
||||
async viewFileEnabled(): Promise<boolean> {
|
||||
|
@@ -143,7 +143,12 @@ export class TestElement {
|
||||
* Test whether this element is currently displayed.
|
||||
*/
|
||||
async isDisplayed(): Promise<boolean> {
|
||||
return this.elementFinder.isDisplayed();
|
||||
try {
|
||||
await this.elementFinder.isDisplayed();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user