mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-9795] [E2E] Fixing tests from ACS-9795 (#4676)
* [ACS-9795] [E2E] Included tests for verification * [ACS-9795] [E2E] fixes for e2es pt.1 * [ACS-9795] e2e fixes pt.2 * [ACS-9795] e2e fixes pt.3 * [ACS-9795] deleted dist for testing * [ACS-9795] tests excluded - local ACS issues * [ACS-9795] sonar fixes * [ACS-9795] excluded XAT-17182 * [ACS-9795] updated exclude URLs * [ACS-9795] review fixes 1
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"XAT-5465": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-17781": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-17181": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-17182": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-17640": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-17644": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-5476": "https://hyland.atlassian.net/browse/ACS-9795"
|
||||
"XAT-17181": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||
"XAT-17640": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||
"XAT-17644": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||
"XAT-17182": "https://hyland.atlassian.net/browse/ACS-9889"
|
||||
}
|
||||
|
@@ -35,16 +35,16 @@ test.describe('viewer action file', () => {
|
||||
const randomDocxDelete = `${TEST_FILES.DOCX.name}-${Utils.random()}`;
|
||||
const fileForEditOffline = `playwright-file1-${Utils.random()}.docx`;
|
||||
const fileForCancelEditing = `playwright-file2-${Utils.random()}.docx`;
|
||||
const docxFile2 = TEST_FILES.DOCX2.name;
|
||||
const docxFile = TEST_FILES.DOCX.name;
|
||||
let folderId: string;
|
||||
let fileDocxShareId: string;
|
||||
let randomDocxNameFavoriteId: string;
|
||||
let fileForCancelEditingId: string;
|
||||
const filePersonalFiles = `file3-${Utils.random()}.docx`;
|
||||
const filePersonalFiles = `file3-${Utils.random()}.jpg`;
|
||||
let filePersonalFilesId: string;
|
||||
const fileForUploadNewVersion2 = `file4-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId2: string;
|
||||
const filePersonalFiles2 = TEST_FILES.JPG_FILE.name;
|
||||
const fileNewVersionLocked = `file4-${Utils.random()}.jpg`;
|
||||
const fileNewVersionLocked2 = TEST_FILES.JPG_FILE.name;
|
||||
let fileNewVersionLockedId: string;
|
||||
const destination = `viewer-action-destRF-${Utils.random()}`;
|
||||
let destinationId: string;
|
||||
const docxRecentFiles = `docxRF-${Utils.random()}.docx`;
|
||||
@@ -56,12 +56,12 @@ test.describe('viewer action file', () => {
|
||||
folderId = node.entry.id;
|
||||
|
||||
fileDocxShareId = (await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameShare, folderId)).entry.id;
|
||||
filePersonalFilesId = (await fileAction.uploadFile(TEST_FILES.DOCX2.path, filePersonalFiles, folderId)).entry.id;
|
||||
fileForUploadNewVersionId2 = (await fileAction.uploadFileWithRename(TEST_FILES.DOCX.path, fileForUploadNewVersion2, folderId)).entry.id;
|
||||
filePersonalFilesId = (await fileAction.uploadFile(TEST_FILES.JPG_FILE.path, filePersonalFiles, folderId)).entry.id;
|
||||
fileNewVersionLockedId = (await fileAction.uploadFileWithRename(TEST_FILES.JPG_FILE.path, fileNewVersionLocked, folderId)).entry.id;
|
||||
await fileAction.uploadFileWithRename(TEST_FILES.DOCX.path, docxRecentFiles, folderId);
|
||||
await shareAction.shareFileById(fileDocxShareId);
|
||||
fileForCancelEditingId = (await fileAction.uploadFile(TEST_FILES.DOCX.path, fileForCancelEditing, folderId)).entry.id;
|
||||
await fileAction.lockNodes([fileForCancelEditingId, fileForUploadNewVersionId2]);
|
||||
await fileAction.lockNodes([fileForCancelEditingId, fileNewVersionLockedId]);
|
||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
|
||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxDelete, folderId);
|
||||
const fileFavoritesNode = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameFavorite, folderId);
|
||||
@@ -183,7 +183,7 @@ test.describe('viewer action file', () => {
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(filePersonalFiles);
|
||||
await personalFiles.viewer.waitForViewerToOpen('wait for viewer content');
|
||||
|
||||
await Utils.uploadFileNewVersion(personalFiles, docxFile2);
|
||||
await Utils.uploadFileNewVersion(personalFiles, filePersonalFiles2, 'jpg');
|
||||
|
||||
await personalFiles.uploadNewVersionDialog.majorOption.click();
|
||||
await personalFiles.uploadNewVersionDialog.description.fill('new major version description');
|
||||
@@ -193,16 +193,16 @@ test.describe('viewer action file', () => {
|
||||
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not open').toBe(true);
|
||||
await Utils.waitForApiResponse(personalFiles, 'content', 200);
|
||||
|
||||
expect(await personalFiles.viewer.getFileTitle()).toContain(docxFile2);
|
||||
expect(await personalFiles.viewer.getFileTitle()).toContain(filePersonalFiles2);
|
||||
expect(await nodesApiAction.getNodeProperty(filePersonalFilesId, 'cm:versionType'), 'File has incorrect version type').toEqual('MAJOR');
|
||||
expect(await nodesApiAction.getNodeProperty(filePersonalFilesId, 'cm:versionLabel'), 'File has incorrect version label').toEqual('2.0');
|
||||
});
|
||||
|
||||
test('[XAT-17781] Upload new version action when node is locked', async ({ personalFiles }) => {
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(fileForUploadNewVersion2);
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(fileNewVersionLocked);
|
||||
await personalFiles.viewer.waitForViewerToOpen('wait for viewer content');
|
||||
|
||||
await Utils.uploadFileNewVersion(personalFiles, docxFile);
|
||||
await Utils.uploadFileNewVersion(personalFiles, fileNewVersionLocked2, 'jpg');
|
||||
|
||||
await personalFiles.uploadNewVersionDialog.uploadButton.click();
|
||||
await personalFiles.uploadNewVersionDialog.uploadButton.waitFor({ state: 'detached' });
|
||||
@@ -210,7 +210,7 @@ test.describe('viewer action file', () => {
|
||||
|
||||
await personalFiles.viewer.waitForViewerToOpen();
|
||||
await Utils.waitForApiResponse(personalFiles, 'content', 200);
|
||||
expect(await personalFiles.viewer.getFileTitle()).toContain(docxFile);
|
||||
expect(await personalFiles.viewer.getFileTitle()).toContain(fileNewVersionLocked2);
|
||||
|
||||
await personalFiles.acaHeader.clickViewerMoreActions();
|
||||
await expect(personalFiles.matMenu.getMenuItemFromHeaderMenu('Cancel Editing'), `'Cancel Editing' button shouldn't be shown`).toBeHidden();
|
||||
|
@@ -23,7 +23,17 @@
|
||||
*/
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
import { ApiClientFactory, FileActionsApi, NodesApi, test, TEST_FILES, Utils, TrashcanApi, PersonalFilesPage } from '@alfresco/aca-playwright-shared';
|
||||
import {
|
||||
ApiClientFactory,
|
||||
FileActionsApi,
|
||||
NodesApi,
|
||||
test,
|
||||
TEST_FILES,
|
||||
Utils,
|
||||
TrashcanApi,
|
||||
PersonalFilesPage,
|
||||
timeouts
|
||||
} from '@alfresco/aca-playwright-shared';
|
||||
|
||||
test.use({ channel: 'chrome' });
|
||||
test.describe('viewer file types', () => {
|
||||
@@ -92,7 +102,7 @@ test.describe('viewer file types', () => {
|
||||
) {
|
||||
await page.dataTable.performClickFolderOrFileToOpen(fileName);
|
||||
expect(await page.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||
await page.viewer.waitForViewerLoaderToFinish();
|
||||
await page.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||
|
||||
const viewerElements = {
|
||||
viewerImage: page.viewer.viewerImage,
|
||||
|
@@ -37,7 +37,8 @@ import {
|
||||
PersonalFilesPage,
|
||||
FavoritesPage,
|
||||
SharedPage,
|
||||
SearchPage
|
||||
SearchPage,
|
||||
timeouts
|
||||
} from '@alfresco/aca-playwright-shared';
|
||||
|
||||
test.describe('Version actions', () => {
|
||||
@@ -180,7 +181,7 @@ test.describe('Version actions', () => {
|
||||
test('[XAT-5506] Previous document version title should be the same in Preview mode as in Version Manager - Shared Files', async ({
|
||||
sharedPage
|
||||
}) => {
|
||||
await sharedPage.viewer.waitForViewerToOpen('wait for viewer content');
|
||||
await sharedPage.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||
expect(await sharedPage.viewer.getFileTitle()).toContain(filenameBeforeUpdate);
|
||||
});
|
||||
|
||||
|
@@ -186,7 +186,7 @@ test.describe('viewer zoom functionality and reset', () => {
|
||||
await myLibrariesPage.navigate();
|
||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
|
||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName);
|
||||
await myLibrariesPage.viewer.waitForViewerLoaderToFinish();
|
||||
await myLibrariesPage.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||
expect(await myLibrariesPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
|
||||
await validateZoomScaleInViewer(myLibrariesPage);
|
||||
@@ -224,7 +224,7 @@ test.describe('viewer zoom functionality and reset', () => {
|
||||
await myLibrariesPage.navigate();
|
||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
|
||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName);
|
||||
await myLibrariesPage.viewer.waitForViewerLoaderToFinish();
|
||||
await myLibrariesPage.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||
expect(await myLibrariesPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
|
||||
await validateFitToPageButtonActivity(myLibrariesPage);
|
||||
|
@@ -41,6 +41,7 @@ import { Site } from '@alfresco/js-api';
|
||||
test.describe('viewer file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const randomDocxName = `${TEST_FILES.DOCX.name}-${Utils.random()}`;
|
||||
const randomJpgName = `${TEST_FILES.JPG_FILE.name}-${Utils.random()}`;
|
||||
const siteUser = `siteUser-${Utils.random()}`;
|
||||
const fileInSite = TEST_FILES.DOCX.name;
|
||||
const siteAdmin = `siteAdmin-${Utils.random()}`;
|
||||
@@ -50,6 +51,7 @@ test.describe('viewer file', () => {
|
||||
let docLibSiteUserId: string;
|
||||
let folderId: string;
|
||||
let fileDocxId: string;
|
||||
let fileJpgId: string;
|
||||
let nodesApi: NodesApi;
|
||||
let trashcanApi: TrashcanApi;
|
||||
let siteActionsAdmin: SitesApi;
|
||||
@@ -79,6 +81,8 @@ test.describe('viewer file', () => {
|
||||
folderId = node.entry.id;
|
||||
const fileDoc = await fileActionApi.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
|
||||
fileDocxId = fileDoc.entry.id;
|
||||
const fileJpg = await fileActionApi.uploadFile(TEST_FILES.JPG_FILE.path, randomJpgName, folderId);
|
||||
fileJpgId = fileJpg.entry.id;
|
||||
const consumerFavoritesTotalItems = await favoritesActions.getFavoritesTotalItems(username);
|
||||
await shareActions.shareFileById(fileDocxId);
|
||||
await favoritesActions.addFavoriteById('file', fileDocxId);
|
||||
@@ -189,11 +193,10 @@ test.describe('viewer file', () => {
|
||||
});
|
||||
|
||||
test('[XAT-5476] Viewer opens when accessing the preview URL for a file', async ({ personalFiles }) => {
|
||||
const previewURL = `#/personal-files/${folderId}/(viewer:view/${fileDocxId})`;
|
||||
const previewURL = `#/personal-files/${folderId}/(viewer:view/${fileJpgId})`;
|
||||
await personalFiles.navigate({ remoteUrl: previewURL });
|
||||
await personalFiles.dataTable.spinnerWaitForReload();
|
||||
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||
await expect(personalFiles.viewer.fileTitleButtonLocator).toHaveText(randomDocxName);
|
||||
await personalFiles.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||
await expect(personalFiles.viewer.fileTitleButtonLocator).toContainText(randomJpgName);
|
||||
});
|
||||
|
||||
test('[XAT-5480] Viewer opens for a file from Shared Files', async ({ sharedPage }) => {
|
||||
|
Reference in New Issue
Block a user