[ACS-7765] playwright Migration for upload new action e2e test (#3866)

* [ACS-7764] Migrated e2e tests Actions - upload

* [ACS-7764] Protractor2Playwright - Actions - Upload

* [ACS-7764] upload file fix

* [ACS-7765] playwright upload new action e2e test

* [ACS-7765] fix locator

* [ACS-7765] added fix and new test

* suggested fix for locator text

Co-authored-by: MichalKinas <113341662+MichalKinas@users.noreply.github.com>

* Update viewer.component.ts

---------

Co-authored-by: Katarzyna Kita <katarzyna.kita@hyland.com>
Co-authored-by: MichalKinas <113341662+MichalKinas@users.noreply.github.com>
This commit is contained in:
Akash Rathod
2024-06-04 15:27:48 +02:00
committed by GitHub
parent e35b12d53f
commit 157451841c
10 changed files with 232 additions and 895 deletions

View File

@@ -42,6 +42,7 @@ export class AcaHeader extends BaseComponent {
public uploadButton = this.getChild('button[id="app.toolbar.upload"]');
public uploadFileButton = this.page.locator('button[id="app.create.uploadFile"]');
public uploadInput = this.page.locator('input[id="app-upload-files"]');
public uploadNewVersionButton = this.page.locator('#app-upload-file-version');
public permanentlyDeleteButton = this.getChild('button[id="app.toolbar.purgeDeletedNodes"]');
public restoreButton = this.getChild('button[id="app.toolbar.restoreDeletedNodes"]');

View File

@@ -31,7 +31,9 @@ export class UploadNewVersionDialog extends BaseComponent {
public cancelButton = this.getChild('#adf-new-version-cancel');
public uploadButton = this.getChild('[data-automation-id="adf-new-version-file-upload"]');
public majorOption = this.getChild('#adf-new-version-major');
public minorOption = this.getChild('#adf-new-version-minor');
public description = this.getChild('#adf-new-version-text-area');
public title = this.getChild(' .mat-dialog-title');
constructor(page: Page) {
super(page, UploadNewVersionDialog.rootElement);

View File

@@ -37,6 +37,7 @@ export class ViewerComponent extends BaseComponent {
public shareButton = this.getChild('button[id="share-action-button"]');
public downloadButton = this.getChild('button[id="app.viewer.download"]');
public allButtons = this.getChild('button');
public unknownFormat = this.getChild(`adf-viewer-unknown-format .adf-viewer__unknown-format-view`);
toolbar = new AcaHeader(this.page);
@@ -51,8 +52,8 @@ export class ViewerComponent extends BaseComponent {
async waitForViewerToOpen(waitForViewerContent?: 'wait for viewer content'): Promise<void> {
await this.viewerLocator.waitFor({ state: 'visible', timeout: timeouts.medium });
if(waitForViewerContent) {
await this.spinnerWaitForReload();
if (waitForViewerContent) {
await this.spinnerWaitForReload();
}
}
@@ -99,4 +100,12 @@ export class ViewerComponent extends BaseComponent {
expect(actualPrimaryActions.includes(action), `Expected to contain ${action}`).toBe(true);
}
}
async checkUnknownFormatIsDisplayed(): Promise<void> {
await this.unknownFormat.waitFor({ state: 'visible', timeout: timeouts.normal });
}
async getUnknownFormatMessage(): Promise<string> {
return this.unknownFormat.locator(`.adf-viewer__unknown-label`).innerText();
}
}

View File

@@ -41,7 +41,7 @@ import {
SearchFiltersProperties
} from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfConfirmDialogComponent, AdfFolderDialogComponent, ManageVersionsDialog } from '../components/dialogs';
import { AdfConfirmDialogComponent, AdfFolderDialogComponent, UploadNewVersionDialog, ManageVersionsDialog } from '../components/dialogs';
export type SearchType = 'files' | 'folders' | 'filesAndFolders' | 'libraries';
@@ -69,6 +69,7 @@ export class SearchPage extends BasePage {
public searchFiltersLogic = new SearchFiltersLogic(this.page);
public sidenav = new SidenavComponent(this.page);
public confirmDialogComponent = new AdfConfirmDialogComponent(this.page);
public uploadNewVersionDialog = new UploadNewVersionDialog(this.page);
public manageVersionsDialog = new ManageVersionsDialog(this.page);
async searchWithin(searchText: string, searchType: SearchType): Promise<void> {

View File

@@ -38,11 +38,12 @@ export const TEST_FILES = {
PDF: {
path: resolve(__dirname, 'file-pdf.pdf'),
name: 'file-pdf',
extension: 'pdf',
data: 'Lorem ipsum dolor sit amet'
},
FILE_UNSUPPORTED: {
path: resolve(__dirname, 'file_unsupported.3DS'),
name: 'file-3DS',
name: 'file_unsupported.3DS',
data: 'Lorem ipsum dolor sit amet'
},
PDF_PROTECTED: {