Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACA-3188] Add methods for ADW+APS1 e2e #6816

Merged
merged 13 commits into from Apr 9, 2021
Binary file modified lib/cli/resources/e2e-Application.zip
Binary file not shown.
1 change: 1 addition & 0 deletions lib/testing/src/lib/core/pages/form/public-api.ts
Expand Up @@ -19,3 +19,4 @@ export * from './widgets/public-api';

export * from './form-fields';
export * from './form.page';
export * from './start-form.page';
22 changes: 22 additions & 0 deletions lib/testing/src/lib/core/pages/form/start-form.page.ts
@@ -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');
}
Expand Up @@ -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 {

Expand All @@ -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);
Expand Down Expand Up @@ -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> {
Expand All @@ -107,7 +108,7 @@ export class AttachFileWidgetPage {
}

async removeAttachedFile(): Promise<void> {
await BrowserActions.click(this.removeFileOptionButton);
await this.removeFileOptionButton.click();
}

async viewFileEnabled(): Promise<boolean> {
Expand Down
7 changes: 6 additions & 1 deletion lib/testing/src/lib/core/test-element.ts
Expand Up @@ -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;
}
}

/**
Expand Down