[ADF-5318] E2E Content Change type (#6799)

* [ADF-5318] E2E Content Change type

* Update metadata-content-type.e2e.ts
This commit is contained in:
Dharan
2021-03-22 14:55:50 +05:30
committed by GitHub
parent 76de2c06f5
commit 8f8819c395
6 changed files with 243 additions and 3 deletions

View File

@@ -16,7 +16,7 @@
*/
import { Locator, by, element, Key, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, DropdownPage, TestElement } from '@alfresco/adf-testing';
export class MetadataViewPage {
@@ -216,6 +216,35 @@ export class MetadataViewPage {
await BrowserVisibility.waitUntilElementIsVisible(property);
}
async hasContentType(contentType: string): Promise<string> {
const nodeType = TestElement.byText('div[data-automation-id="header-nodeType"] .adf-property-value', contentType);
return nodeType.waitVisible();
}
async changeContentType(option: string): Promise<void> {
const nodeType = TestElement.byCss('div[data-automation-id="header-nodeType"] mat-form-field');
await nodeType.waitPresent();
await nodeType.click();
const typesDropDownPage = new DropdownPage(nodeType.elementFinder);
await typesDropDownPage.checkOptionIsDisplayed(option);
await typesDropDownPage.selectOption(option);
}
async checkConfirmDialogDisplayed(): Promise<void> {
const confirmButton = TestElement.byCss('adf-content-type-dialog');
await confirmButton.waitPresent();
}
async applyNodeProperties(): Promise<void> {
const confirmButton = TestElement.byId('content-type-dialog-apply-button');
await confirmButton.click();
}
async cancelNodeProperties(): Promise<void> {
const cancelButton = TestElement.byId('content-type-dialog-actions-cancel');
await cancelButton.click();
}
async checkPropertyIsNotVisible(propertyName: string, type: string): Promise<void> {
const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
await BrowserVisibility.waitUntilElementIsNotVisible(property);