Skip to content

Commit

Permalink
[ACS-7901] unsupported file e2e moved to aca (#9779)
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrathod28 authored Jun 6, 2024
1 parent b9399d3 commit 6586bec
Showing 1 changed file with 0 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,72 +380,4 @@ describe('Content Services Viewer', () => {
await viewerPage.clickCloseButton();
});
});

describe('Viewer - version update with unsupported file', () => {
it('[C587084] Should display unknown format the preview for an unsupported file', async () => {
await changeFileNameInViewer(unsupportedFile.name, 'generic-unsupported-file-1st.3DS');
await uploadNewVersion(jpgFile.name, unsupportedFileByLocation.location);
await previewUnsupportedFile(unsupportedFileByLocation.name);

await changeFileNameInViewer(unsupportedFileByLocation.name, 'generic-unsupported-file-2nd.3DS');
await uploadNewVersion(pdfFile.name, unsupportedFileByLocation.location);
await previewUnsupportedFile(unsupportedFileByLocation.name);

await changeFileNameInViewer(unsupportedFileByLocation.name, 'generic-unsupported-file-3rd.3DS');
await uploadNewVersion(mp4File.name, unsupportedFileByLocation.location);
await previewUnsupportedFile(unsupportedFileByLocation.name);
});
});

/**
* Upload a new version of a file
*
* @param originalFileName The name of the original file
* @param newVersionLocation The location of the new version
*/
async function uploadNewVersion(originalFileName: string, newVersionLocation: string): Promise<void> {
await contentServicesPage.doubleClickRow(originalFileName);
await viewerPage.waitTillContentLoaded();

await viewerPage.clickCloseButton();
await contentServicesPage.versionManagerContent(originalFileName);
await versionManagePage.showNewVersionButton.click();
await versionManagePage.uploadNewVersionFile(newVersionLocation);
await versionManagePage.closeActionsMenu();
await versionManagePage.closeVersionDialog();
await browser.refresh();
}

/**
* Preview an unsupported file
*
* @param unsupportedFileName The name of the unsupported file
*/
async function previewUnsupportedFile(unsupportedFileName: string): Promise<void> {
await contentServicesPage.doubleClickRow(unsupportedFileName);
await viewerPage.waitTillContentLoaded();
await viewerPage.checkUnknownFormatIsDisplayed();
expect(await viewerPage.getUnknownFormatMessage()).toBe(`Couldn't load preview. Unknown format.`);
await viewerPage.clickCloseButton();
}

/**
* Change the name of the file in the viewer
*
* @param fileName The name of the file to be changed
* @param newName The new name of the file
*/
async function changeFileNameInViewer(fileName: string, newName: string): Promise<void> {
await contentServicesPage.doubleClickRow(fileName);
await viewerPage.waitTillContentLoaded();

await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnTab('Properties');
await viewerPage.checkTabIsActive('Properties');
await metadataViewPage.clickEditIconGeneral();
await metadataViewPage.enterPropertyText('properties.cm:name', newName);
await metadataViewPage.clickSaveGeneralMetadata();
await viewerPage.clickCloseButton();
}
});

0 comments on commit 6586bec

Please sign in to comment.