diff --git a/lib/cli/resources/e2e-Application.zip b/lib/cli/resources/e2e-Application.zip index 09ca3eaa03..a36b5ab130 100644 Binary files a/lib/cli/resources/e2e-Application.zip and b/lib/cli/resources/e2e-Application.zip differ diff --git a/lib/testing/src/lib/core/pages/form/public-api.ts b/lib/testing/src/lib/core/pages/form/public-api.ts index f054db74bd..3fcaa43a95 100644 --- a/lib/testing/src/lib/core/pages/form/public-api.ts +++ b/lib/testing/src/lib/core/pages/form/public-api.ts @@ -19,3 +19,4 @@ export * from './widgets/public-api'; export * from './form-fields'; export * from './form.page'; +export * from './start-form.page'; diff --git a/lib/testing/src/lib/core/pages/form/start-form.page.ts b/lib/testing/src/lib/core/pages/form/start-form.page.ts new file mode 100644 index 0000000000..ccf0fbc049 --- /dev/null +++ b/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'); +} diff --git a/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts index d7c87adc91..05330d1a01 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts @@ -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 { 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 { 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 { @@ -107,7 +108,7 @@ export class AttachFileWidgetPage { } async removeAttachedFile(): Promise { - await BrowserActions.click(this.removeFileOptionButton); + await this.removeFileOptionButton.click(); } async viewFileEnabled(): Promise { diff --git a/lib/testing/src/lib/core/test-element.ts b/lib/testing/src/lib/core/test-element.ts index ad32052f79..33167101fa 100644 --- a/lib/testing/src/lib/core/test-element.ts +++ b/lib/testing/src/lib/core/test-element.ts @@ -143,7 +143,12 @@ export class TestElement { * Test whether this element is currently displayed. */ async isDisplayed(): Promise { - return this.elementFinder.isDisplayed(); + try { + await this.elementFinder.isDisplayed(); + return true; + } catch { + return false; + } } /**