Skip to content

Commit

Permalink
[AAE-5869] Added missing methods for e2e's (#7480)
Browse files Browse the repository at this point in the history
* [AAE-5869] added missing methods for e2e's

* [AAE-5869] use TestElement

* [AAE-5869] added method to display no content container

* [AAE-5869] added method to wait for file properties table

* trigger travis

* [AAE-5869] upgrade simpleapp id of new widget

* trigger travis

* [AAE-5869] upgrade simpleapp

* trigger travis

* [AAE-5869] removed check for table display for file not attached method

* [AAE-5869] fixed string lint

* [AAE-5869] fixed lint error
  • Loading branch information
tomgny committed Feb 3, 2022
1 parent 8dc736e commit 3205a3d
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 9 deletions.
Binary file modified e2e/resources/activiti7/simpleapp.zip
Binary file not shown.
Expand Up @@ -39,7 +39,7 @@ export class ContentNodeSelectorDialogPage {
dataTable = this.contentList.dataTablePage();
siteListDropdown = new DropdownPage(this.dialog.$(`mat-select[data-automation-id='site-my-files-option']`));
breadcrumbDropdown = new BreadcrumbDropdownPage();
tabPage: TabPage = new TabPage();
tab: TabPage = new TabPage();
uploadButtonComponent = new UploadButtonPage();

uploadFromLocalTab = $$('*[role="tab"]').get(1);
Expand All @@ -50,6 +50,10 @@ export class ContentNodeSelectorDialogPage {
return this.breadcrumbDropdown;
}

tabPage(): TabPage {
return this.tab;
}

uploadButtonPage(): UploadButtonPage {
return this.uploadButtonComponent;
}
Expand Down Expand Up @@ -159,11 +163,11 @@ export class ContentNodeSelectorDialogPage {
async attachFilesFromLocal(files: FileModel[]): Promise<void> {
await this.checkFileServerTabIsLoaded();

await this.tabPage.clickTabByLabel(this.uploadFromLocalTabName);
await this.tab.clickTabByLabel(this.uploadFromLocalTabName);

await this.uploadButtonComponent.attachFiles(files);

await this.tabPage.clickTabByLabel(this.repositoryTabName);
await this.tab.clickTabByLabel(this.repositoryTabName);

await this.dataTable.waitForTableBody();
await this.dataTable.waitTillContentLoaded();
Expand Down
Expand Up @@ -40,6 +40,18 @@ export class BreadcrumbDropdownPage {
await this.breadCrumbDropdown.checkDropdownIsVisible();
}

async checkBreadCrumbDropdownIsNotDisplayed(): Promise<void> {
await this.breadCrumbDropdown.checkDropdownIsNotVisible();
}

async checkBreadCrumbOptionIsDisplayed(optionName: string): Promise<void> {
await this.breadCrumbDropdown.checkOptionIsDisplayed(optionName);
}

async checkBreadCrumbOptionIsNotDisplayed(optionName: string): Promise<void> {
await this.breadCrumbDropdown.checkOptionIsNotDisplayed(optionName);
}

async getTextOfCurrentFolder(): Promise<string> {
return BrowserActions.getText(this.currentFolder);
}
Expand Down
Expand Up @@ -34,6 +34,7 @@ export class DataTableComponentPage {
emptyList: ElementFinder;
emptyListTitle: ElementFinder;
emptyListSubtitle: ElementFinder;
noContentContainer: ElementFinder;

rows = `adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`;

Expand All @@ -52,6 +53,7 @@ export class DataTableComponentPage {
this.emptyList = this.rootElement.$(`adf-empty-content`);
this.emptyListTitle = this.rootElement.$(`.adf-empty-content__title`);
this.emptyListSubtitle = this.rootElement.$(`.adf-empty-content__subtitle`);
this.noContentContainer = $(`div[class*='adf-no-content-container']`);
}

geCellElementDetail(detail: string): ElementArrayFinder {
Expand Down Expand Up @@ -462,6 +464,10 @@ export class DataTableComponentPage {
await BrowserVisibility.waitUntilElementIsVisible($(`div[data-automation-id="auto_id_entry.${column}"]`));
}

async checkNoContentContainerIsDisplayed() {
await BrowserVisibility.waitUntilElementIsVisible(this.noContentContainer);
}

async getNumberOfColumns(): Promise<number> {
return this.allColumns.count();
}
Expand Down
Expand Up @@ -16,12 +16,15 @@
*/

import { by, element, $ } from 'protractor';
import { TestElement } from '../../../test-element';
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';

export class TabPage {

changeTabAnimation = $('div[class="mat-ripple-element"]');

public disabledContentNodeSelectorTabInfoIcon = TestElement.byCss('[data-automation-id="adf-content-node-selector-disabled-tab-info-icon"]');

async clickTabByLabel(tabLabel): Promise<void> {
const user = element(by.cssContainingText('.mat-tab-label-content', tabLabel));
await BrowserActions.click(user);
Expand Down
Expand Up @@ -53,6 +53,10 @@ export class DropdownPage {
await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement);
}

async checkDropdownIsNotVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.dropDownElement);
}

async checkDropdownIsClickable(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.dropDownElement);
}
Expand Down
Expand Up @@ -24,14 +24,18 @@ import { TestElement } from '../../../../core/test-element';
export class AttachFileWidgetCloudPage {

widget: ElementFinder;
filesListLocator: string = 'div[class="adf-file-properties-table"]';

constructor(fieldId: string) {
this.assignWidget(fieldId);
}

getFileAttachedLocatorByContainingText = async (text: string): Promise<ElementFinder> => {
const filesListLocator = 'div[class="adf-file-properties-table"]';
return this.widget.$(filesListLocator).element(by.cssContainingText('table tbody tr td span ', text));
async isFileTablePropertiesDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.widget.$(this.filesListLocator));
}

getFileAttachedLocatorByContainingText = async(text: string): Promise<ElementFinder> => {
return this.widget.$(this.filesListLocator).element(by.cssContainingText('table tbody tr td span ', text));
};

assignWidget(fieldId: string): void {
Expand All @@ -55,6 +59,7 @@ export class AttachFileWidgetCloudPage {

async checkFileIsAttached(name): Promise<void> {
const fileAttached = await this.getFileAttachedLocatorByContainingText(name);
await this.isFileTablePropertiesDisplayed();
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
}

Expand All @@ -65,8 +70,7 @@ export class AttachFileWidgetCloudPage {
}

async checkNoFileIsAttached(): Promise<void> {
const filesListLocator = 'div[class="adf-file-properties-table"]';
const fileItem = new TestElement(this.widget.$(filesListLocator).$('table'));
const fileItem = new TestElement(this.widget.$(this.filesListLocator).$('table'));
await fileItem.waitNotVisible();
}

Expand Down
Expand Up @@ -298,7 +298,8 @@ export const ACTIVITI_CLOUD_APPS = {
attachFileWidget2: 'Attachfile04mfeb',
attachFileLocalChildFolder: 'Attachfilelocalchildfolder',
attachFileContentServices: 'Attachfilecontentservices',
attachFileLocalMultiple: 'Attachfilelocalmultiple'
attachFileLocalMultiple: 'Attachfilelocalmultiple',
attachFileInvalidPath: 'Attachfileinvalidpath'
},
attachSingleMultiple: {
name: 'attach-single-multiple',
Expand Down

0 comments on commit 3205a3d

Please sign in to comment.