From 1260e779ad4ce5adc7118e647dcb44cf5675a1ec Mon Sep 17 00:00:00 2001 From: gmandakini Date: Mon, 2 Dec 2019 10:15:11 +0000 Subject: [PATCH] added edit-json-dialog definition to be used in process workspace. --- .../src/lib/core/dialog/edit-json-dialog.ts | 45 +++++++++++++++++++ lib/testing/src/lib/core/dialog/public-api.ts | 18 ++++++++ 2 files changed, 63 insertions(+) create mode 100644 lib/testing/src/lib/core/dialog/edit-json-dialog.ts create mode 100644 lib/testing/src/lib/core/dialog/public-api.ts diff --git a/lib/testing/src/lib/core/dialog/edit-json-dialog.ts b/lib/testing/src/lib/core/dialog/edit-json-dialog.ts new file mode 100644 index 0000000000..9a2c072fed --- /dev/null +++ b/lib/testing/src/lib/core/dialog/edit-json-dialog.ts @@ -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 { by, element, ElementFinder } from 'protractor'; +import { BrowserActions } from '../../core/utils/browser-actions'; +import { BrowserVisibility } from '../../core/utils/browser-visibility'; + +export class EditJsonDialog { + + dialog: ElementFinder = element(by.css(`.adf-edit-json-dialog`)); + closeButton: ElementFinder = element(by.cssContainingText(`button span`, 'Close')); + dialogContent: ElementFinder = this.dialog.element(by.css(`mat-dialog-content textarea`)); + + async checkDialogIsDisplayed(): Promise { + await BrowserVisibility.waitUntilElementIsVisible(this.dialog); + } + + async checkDialogIsNotDisplayed(): Promise { + await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog); + } + + async clickCloseButton(): Promise { + await BrowserActions.click(this.closeButton); + } + + async getDialogContent(): Promise { + await BrowserVisibility.waitUntilElementIsVisible(this.dialogContent); + return this.dialogContent.getAttribute('value'); + } + +} diff --git a/lib/testing/src/lib/core/dialog/public-api.ts b/lib/testing/src/lib/core/dialog/public-api.ts new file mode 100644 index 0000000000..d1cfaaad50 --- /dev/null +++ b/lib/testing/src/lib/core/dialog/public-api.ts @@ -0,0 +1,18 @@ +/*! + * @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. + */ + +export * from './edit-json-dialog';