[ACS-5014] Migrated Copy Move actions E2Es from protractor to playwright (#3531)

* [ACS-5014] Added Playwright E2E tests for copy-move actions

* [ACS-5014] Fixed missing import in tsconfig.e2e.json

* [ACS-5014] Removed unneeded method from utils.ts

* [ACS-5014] Updated playwright.config.ts

* [ACS-5014] Copy and Move tests are now working

* [ACS-5014] Removed unneeded test.only

* [ACS-5014] Added test case IDs to E2E tests

* [ACS-6211] Removed TODO note. Removed protractor test case files

* [ACS-5014] Added E2E tests for Destination Picker in copy-move actions

* [ACS-5014] Removed unneded only from test suite

* [ACS-5014] Updated import of logger from @alfresco/adf-cli to @alfresco/adf-testing

* [ACS-5014] Addressed code review findings. Moved objects to beforeAll/beforeEach wherever applicable. Added missing await.

* [ACS-5014] Addressed code review findings. Removed unused methods/objects from content-node-selector-dialog.ts

* [ACS-5014] Addressed code review findings. Removed unused methods/objects from content-node-selector-dialog.ts

* [ACS-5014] SonarLint fix

* [ACS-5014] Fixed breaking change for other E2Es

* [ACS-5014] Updated E2Es to use correct locator for more actions button
This commit is contained in:
swapnil-verma-gl
2023-12-06 16:01:48 +05:30
committed by GitHub
parent 5062220056
commit f917a663b7
18 changed files with 696 additions and 1137 deletions

View File

@@ -24,24 +24,19 @@
import { by, browser, protractor } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog';
import { isPresentAndDisplayed, waitForStaleness, waitForPresence, isPresentAndEnabled } from '../../utilities/utils';
import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
import { waitForStaleness, waitForPresence } from '../../utilities/utils';
import { DataTable } from '../data-table/data-table';
import { BrowserActions } from '@alfresco/adf-testing';
export class ContentNodeSelectorDialog extends GenericDialog {
cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]'));
copyButton = this.childElement(by.cssContainingText('[data-automation-id="content-node-selector-actions-choose"]', 'Copy'));
moveButton = this.childElement(by.cssContainingText('[data-automation-id="content-node-selector-actions-choose"]', 'Move'));
locationDropDown = this.rootElem.element(by.id('site-dropdown-container'));
locationPersonalFiles = browser.element(by.cssContainingText('.mat-option .mat-option-text', 'Personal Files'));
locationFileLibraries = browser.element(by.cssContainingText('.mat-option .mat-option-text', 'My Libraries'));
searchInput = this.rootElem.element(by.css('#searchInput'));
toolbarTitle = this.rootElem.element(by.css('.adf-toolbar-title'));
breadcrumb = new DropDownBreadcrumb();
dataTable = new DataTable('.adf-content-node-selector-dialog');
constructor() {
@@ -74,25 +69,9 @@ export class ContentNodeSelectorDialog extends GenericDialog {
await waitForPresence(browser.element(by.css('.adf-is-selected')));
}
async isSelectLocationDropdownDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.locationDropDown);
}
async isCopyButtonEnabled(): Promise<boolean> {
return isPresentAndEnabled(this.copyButton);
}
async isCancelButtonEnabled(): Promise<boolean> {
return isPresentAndEnabled(this.cancelButton);
}
async searchFor(text: string): Promise<void> {
await BrowserActions.clearWithBackSpace(this.searchInput);
await this.searchInput.sendKeys(text);
await this.searchInput.sendKeys(protractor.Key.ENTER);
}
async getToolbarTitle(): Promise<string> {
return this.toolbarTitle.getText();
}
}