[ACS-6136] cleanup e2e files (protractor) (#9009)

* cleanup e2e

* clean e2e
This commit is contained in:
Denys Vuika
2023-10-19 09:14:14 +01:00
committed by GitHub
parent b49c86fda5
commit d13db25609
9 changed files with 15 additions and 912 deletions

View File

@@ -47,8 +47,6 @@ export class ContentServicesPage {
createdHeader = $$('div[data-automation-id="auto_header_content_id_createdAt"] > span').first();
emptyFolder = $('.adf-empty-folder-this-space-is-empty');
emptyFolderImage = $('.adf-empty-folder-image');
gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
nameColumnHeader = 'name';
createdByColumnHeader = 'createdByUser.displayName';
createdColumnHeader = 'createdAt';
@@ -58,11 +56,8 @@ export class ContentServicesPage {
downloadContent = $('button[data-automation-id="Download"]');
downloadButton = $('button[title="Download"]');
multiSelectToggle = $('[data-automation-id="multiSelectToggle"]');
selectAllCheckbox = $$('.adf-checkbox-sr-only').first();
selectionModeDropdown = $('.mat-select[placeholder="Selection Mode"]');
selectedNodesList = $$('.app-content-service-settings li');
siteListDropdown = new DropdownPage($(`mat-select[data-automation-id='site-my-files-option']`));
sortingDropdown = new DropdownPage($('mat-select[data-automation-id="grid-view-sorting"]'));
async pressContextMenuActionNamed(actionName: string): Promise<void> {
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
@@ -78,7 +73,7 @@ export class ContentServicesPage {
return this.contentList;
}
async checkDeleteIsDisabled(content): Promise<void> {
async checkDeleteIsDisabled(content: string): Promise<void> {
await this.contentList.clickOnActionMenu(content);
const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`);
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
@@ -349,36 +344,6 @@ export class ContentServicesPage {
return BrowserActions.getAttribute(iconRow, 'src');
}
async checkGridViewButtonIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.gridViewButton);
}
async clickGridViewButton(): Promise<void> {
await this.checkGridViewButtonIsVisible();
await BrowserActions.click(this.gridViewButton);
}
async checkCardViewContainerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
}
async getCardElementShowedInPage(): Promise<number> {
await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
return $$('div.app-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
}
async getDocumentCardIconForElement(elementName: string): Promise<string> {
const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`);
return BrowserActions.getAttribute(elementIcon, 'src');
}
async checkDocumentCardPropertyIsShowed(elementName: string, propertyName: string): Promise<void> {
const elementProperty = $(
`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`
);
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
}
async getAttributeValueForElement(elementName: string, propertyName: string): Promise<string> {
const elementSize = $(
`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`
@@ -386,15 +351,6 @@ export class ContentServicesPage {
return BrowserActions.getText(elementSize);
}
async checkMenuIsShowedForElementIndex(elementIndex: number): Promise<void> {
const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`);
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
}
async selectGridSortingFromDropdown(sortingOption: string): Promise<void> {
await this.sortingDropdown.selectDropdownOption(sortingOption);
}
async checkSelectedSiteIsDisplayed(siteName: string): Promise<void> {
await this.siteListDropdown.checkOptionIsSelected(siteName);
}
@@ -409,14 +365,6 @@ export class ContentServicesPage {
await BrowserActions.click(this.multiSelectToggle);
}
async multiSelectToggleIsEnabled(): Promise<boolean> {
return this.multiSelectToggle.isEnabled();
}
async clickSelectAllCheckbox(): Promise<void> {
await BrowserActions.click(this.selectAllCheckbox);
}
async selectFolder(folderName: string): Promise<void> {
const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`);
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
@@ -433,20 +381,4 @@ export class ContentServicesPage {
const dropdownPage = new DropdownPage(this.selectionModeDropdown);
await dropdownPage.selectDropdownOption(option);
}
async getItemSelected(): Promise<string> {
return BrowserActions.getArrayText(this.selectedNodesList);
}
async selectItemWithCheckbox(itemName: string): Promise<void> {
const item = $(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`);
await BrowserVisibility.waitUntilElementIsVisible(item);
await BrowserActions.click(item);
}
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
const item = $(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`);
await BrowserVisibility.waitUntilElementIsVisible(item);
await BrowserActions.click(item);
}
}