mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Merge pull request #5301 from Alfresco/dev-gmandakini-add-editjson-dialog
Add editjson dialog
This commit is contained in:
@@ -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<void> {
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
async checkDialogIsNotDisplayed(): Promise<void> {
|
||||||
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
async clickCloseButton(): Promise<void> {
|
||||||
|
await BrowserActions.click(this.closeButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDialogContent(): Promise<string> {
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(this.dialogContent);
|
||||||
|
return this.dialogContent.getAttribute('value');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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';
|
||||||
@@ -38,8 +38,8 @@ export class FormFields {
|
|||||||
await BrowserActions.clearSendKeys(fieldElement, value);
|
await BrowserActions.clearSendKeys(fieldElement, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickField(locator, field): Promise<void> {
|
async clickField(locator, field, fieldtext?): Promise<void> {
|
||||||
const fieldElement = element(locator(field));
|
const fieldElement = fieldtext ? element(locator(field, fieldtext)) : element(locator(field));
|
||||||
await BrowserActions.click(fieldElement);
|
await BrowserActions.click(fieldElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ export class ViewerPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFileNameIsDisplayed(file): Promise<void> {
|
async checkFileNameIsDisplayed(file): Promise<void> {
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(this.fileName);
|
||||||
await expect(await BrowserActions.getText(this.fileName)).toEqual(file);
|
await expect(await BrowserActions.getText(this.fileName)).toEqual(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,5 @@
|
|||||||
export * from './actions/public-api';
|
export * from './actions/public-api';
|
||||||
export * from './pages/public-api';
|
export * from './pages/public-api';
|
||||||
export * from './models/public-api';
|
export * from './models/public-api';
|
||||||
|
export * from './dialog/public-api';
|
||||||
export * from './utils/public-api';
|
export * from './utils/public-api';
|
||||||
|
|||||||
Reference in New Issue
Block a user