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,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"XAT-5523": "https://hyland.atlassian.net/browse/ACA-4697",
|
"XAT-5523": "https://hyland.atlassian.net/browse/ACA-4697",
|
||||||
"XAT-17239": "https://hyland.atlassian.net/browse/ACS-9795",
|
|
||||||
"XAT-5516": "https://hyland.atlassian.net/browse/ACS-9795",
|
|
||||||
"XAT-5520": "https://hyland.atlassian.net/browse/ACS-9795",
|
|
||||||
"XAT-5544": "https://hyland.atlassian.net/browse/ACS-9767",
|
"XAT-5544": "https://hyland.atlassian.net/browse/ACS-9767",
|
||||||
"XAT-5539": "https://hyland.atlassian.net/browse/ACS-9767"
|
"XAT-5539": "https://hyland.atlassian.net/browse/ACS-9767",
|
||||||
|
"XAT-5516": "https://hyland.atlassian.net/browse/ACS-9889"
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,7 @@ test.describe('Info Drawer - file folder Properties', () => {
|
|||||||
const folder5514 = `xat-5514-e2e-${Utils.random()}`;
|
const folder5514 = `xat-5514-e2e-${Utils.random()}`;
|
||||||
const folder5516 = `xat-5516-e2e-${Utils.random()}`;
|
const folder5516 = `xat-5516-e2e-${Utils.random()}`;
|
||||||
const propertiesFolder = `properties-folder-${Utils.random()}`;
|
const propertiesFolder = `properties-folder-${Utils.random()}`;
|
||||||
const file5516 = `xat-5516-e2e-${Utils.random()}`;
|
const file5516 = `xat-5516-e2e-${Utils.random()}.jpg`;
|
||||||
const folder17238 = `xat-17238-e2e-${Utils.random()}`;
|
const folder17238 = `xat-17238-e2e-${Utils.random()}`;
|
||||||
const folder17239 = `xat-17239-e2e-${Utils.random()}`;
|
const folder17239 = `xat-17239-e2e-${Utils.random()}`;
|
||||||
const folder17240 = `xat-17240-e2e-${Utils.random()}`;
|
const folder17240 = `xat-17240-e2e-${Utils.random()}`;
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
{
|
{
|
||||||
"XAT-4525": "https://hyland.atlassian.net/browse/ACS-9741",
|
"XAT-4525": "https://hyland.atlassian.net/browse/ACS-9741"
|
||||||
"XAT-4526": "https://hyland.atlassian.net/browse/ACS-9795"
|
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
{
|
{
|
||||||
"XAT-5601": "https://hyland.atlassian.net/browse/ACS-6928",
|
|
||||||
"XAT-5600": "https://hyland.atlassian.net/browse/ACS-6928",
|
|
||||||
"XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464",
|
"XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464",
|
||||||
"XAT-17121": "https://hyland.atlassian.net/browse/ACS-9795",
|
"XAT-17121": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||||
"XAT-17702": "https://hyland.atlassian.net/browse/ACS-9795",
|
"XAT-17702": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||||
"XAT-17701": "https://hyland.atlassian.net/browse/ACS-9860",
|
"XAT-17701": "https://hyland.atlassian.net/browse/ACS-9860",
|
||||||
"XAT-17700": "https://hyland.atlassian.net/browse/ACS-9860",
|
"XAT-17700": "https://hyland.atlassian.net/browse/ACS-9860",
|
||||||
"XAT-5581": "https://hyland.atlassian.net/browse/ACS-9860",
|
"XAT-5581": "https://hyland.atlassian.net/browse/ACS-9860",
|
||||||
|
@@ -53,6 +53,8 @@ test.describe('Search Highlighting', () => {
|
|||||||
await nodesApi.createFile(fileNameHighlight, '-my-');
|
await nodesApi.createFile(fileNameHighlight, '-my-');
|
||||||
await nodesApi.createFile(fileDescriptionHighlight, '-my-', null, fileDescription);
|
await nodesApi.createFile(fileDescriptionHighlight, '-my-', null, fileDescription);
|
||||||
await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileContentHighlight);
|
await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileContentHighlight);
|
||||||
|
|
||||||
|
await fileActionsApi.waitForNodesSearchHighlight(fileContentHighlight, { expect: 1 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`beforeAll failed: ${error}`);
|
console.error(`beforeAll failed: ${error}`);
|
||||||
}
|
}
|
||||||
@@ -75,7 +77,8 @@ test.describe('Search Highlighting', () => {
|
|||||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
|
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[XAT-17121] Matching phrases should be highlighted in the file content for search results', async ({ searchPage }) => {
|
test('[XAT-17121] Matching phrases should be highlighted in the file content for search results', async ({ searchPage, personalFiles }) => {
|
||||||
|
await personalFiles.navigate();
|
||||||
await searchPage.searchWithin(fileContent, 'files');
|
await searchPage.searchWithin(fileContent, 'files');
|
||||||
await searchPage.dataTable.progressBarWaitForReload();
|
await searchPage.dataTable.progressBarWaitForReload();
|
||||||
expect(await searchPage.dataTable.hasHighlightedText('content')).toBe(true);
|
expect(await searchPage.dataTable.hasHighlightedText('content')).toBe(true);
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"XAT-17738": "https://hyland.atlassian.net/browse/ACS-9795"
|
"XAT-17738": "https://hyland.atlassian.net/browse/ACS-9889"
|
||||||
}
|
}
|
||||||
|
@@ -109,8 +109,7 @@ test.describe('viewer file', () => {
|
|||||||
test('[XAT-17738] Viewer with preview URL', async ({ personalFiles }) => {
|
test('[XAT-17738] Viewer with preview URL', async ({ personalFiles }) => {
|
||||||
const previewURL = `#/personal-files/${folderId}/(viewer:view/${fileDocxId})`;
|
const previewURL = `#/personal-files/${folderId}/(viewer:view/${fileDocxId})`;
|
||||||
await personalFiles.navigate({ remoteUrl: previewURL });
|
await personalFiles.navigate({ remoteUrl: previewURL });
|
||||||
await personalFiles.dataTable.spinnerWaitForReload();
|
await personalFiles.viewer.waitForViewerLoaderToFinish(timeouts.sixtySeconds);
|
||||||
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
|
||||||
await expect(personalFiles.viewer.fileTitleButtonLocator).toHaveText(randomDocxName);
|
await expect(personalFiles.viewer.fileTitleButtonLocator).toHaveText(randomDocxName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"XAT-5465": "https://hyland.atlassian.net/browse/ACS-9795",
|
"XAT-17181": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||||
"XAT-17781": "https://hyland.atlassian.net/browse/ACS-9795",
|
"XAT-17640": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||||
"XAT-17181": "https://hyland.atlassian.net/browse/ACS-9795",
|
"XAT-17644": "https://hyland.atlassian.net/browse/ACS-9889",
|
||||||
"XAT-17182": "https://hyland.atlassian.net/browse/ACS-9795",
|
"XAT-17182": "https://hyland.atlassian.net/browse/ACS-9889"
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
|
@@ -35,16 +35,16 @@ test.describe('viewer action file', () => {
|
|||||||
const randomDocxDelete = `${TEST_FILES.DOCX.name}-${Utils.random()}`;
|
const randomDocxDelete = `${TEST_FILES.DOCX.name}-${Utils.random()}`;
|
||||||
const fileForEditOffline = `playwright-file1-${Utils.random()}.docx`;
|
const fileForEditOffline = `playwright-file1-${Utils.random()}.docx`;
|
||||||
const fileForCancelEditing = `playwright-file2-${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 folderId: string;
|
||||||
let fileDocxShareId: string;
|
let fileDocxShareId: string;
|
||||||
let randomDocxNameFavoriteId: string;
|
let randomDocxNameFavoriteId: string;
|
||||||
let fileForCancelEditingId: string;
|
let fileForCancelEditingId: string;
|
||||||
const filePersonalFiles = `file3-${Utils.random()}.docx`;
|
const filePersonalFiles = `file3-${Utils.random()}.jpg`;
|
||||||
let filePersonalFilesId: string;
|
let filePersonalFilesId: string;
|
||||||
const fileForUploadNewVersion2 = `file4-${Utils.random()}.docx`;
|
const filePersonalFiles2 = TEST_FILES.JPG_FILE.name;
|
||||||
let fileForUploadNewVersionId2: string;
|
const fileNewVersionLocked = `file4-${Utils.random()}.jpg`;
|
||||||
|
const fileNewVersionLocked2 = TEST_FILES.JPG_FILE.name;
|
||||||
|
let fileNewVersionLockedId: string;
|
||||||
const destination = `viewer-action-destRF-${Utils.random()}`;
|
const destination = `viewer-action-destRF-${Utils.random()}`;
|
||||||
let destinationId: string;
|
let destinationId: string;
|
||||||
const docxRecentFiles = `docxRF-${Utils.random()}.docx`;
|
const docxRecentFiles = `docxRF-${Utils.random()}.docx`;
|
||||||
@@ -56,12 +56,12 @@ test.describe('viewer action file', () => {
|
|||||||
folderId = node.entry.id;
|
folderId = node.entry.id;
|
||||||
|
|
||||||
fileDocxShareId = (await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameShare, folderId)).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;
|
filePersonalFilesId = (await fileAction.uploadFile(TEST_FILES.JPG_FILE.path, filePersonalFiles, folderId)).entry.id;
|
||||||
fileForUploadNewVersionId2 = (await fileAction.uploadFileWithRename(TEST_FILES.DOCX.path, fileForUploadNewVersion2, 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 fileAction.uploadFileWithRename(TEST_FILES.DOCX.path, docxRecentFiles, folderId);
|
||||||
await shareAction.shareFileById(fileDocxShareId);
|
await shareAction.shareFileById(fileDocxShareId);
|
||||||
fileForCancelEditingId = (await fileAction.uploadFile(TEST_FILES.DOCX.path, fileForCancelEditing, folderId)).entry.id;
|
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, randomDocxName, folderId);
|
||||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxDelete, folderId);
|
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxDelete, folderId);
|
||||||
const fileFavoritesNode = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameFavorite, 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.dataTable.performClickFolderOrFileToOpen(filePersonalFiles);
|
||||||
await personalFiles.viewer.waitForViewerToOpen('wait for viewer content');
|
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.majorOption.click();
|
||||||
await personalFiles.uploadNewVersionDialog.description.fill('new major version description');
|
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);
|
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not open').toBe(true);
|
||||||
await Utils.waitForApiResponse(personalFiles, 'content', 200);
|
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:versionType'), 'File has incorrect version type').toEqual('MAJOR');
|
||||||
expect(await nodesApiAction.getNodeProperty(filePersonalFilesId, 'cm:versionLabel'), 'File has incorrect version label').toEqual('2.0');
|
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 }) => {
|
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 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.click();
|
||||||
await personalFiles.uploadNewVersionDialog.uploadButton.waitFor({ state: 'detached' });
|
await personalFiles.uploadNewVersionDialog.uploadButton.waitFor({ state: 'detached' });
|
||||||
@@ -210,7 +210,7 @@ test.describe('viewer action file', () => {
|
|||||||
|
|
||||||
await personalFiles.viewer.waitForViewerToOpen();
|
await personalFiles.viewer.waitForViewerToOpen();
|
||||||
await Utils.waitForApiResponse(personalFiles, 'content', 200);
|
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 personalFiles.acaHeader.clickViewerMoreActions();
|
||||||
await expect(personalFiles.matMenu.getMenuItemFromHeaderMenu('Cancel Editing'), `'Cancel Editing' button shouldn't be shown`).toBeHidden();
|
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 { 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.use({ channel: 'chrome' });
|
||||||
test.describe('viewer file types', () => {
|
test.describe('viewer file types', () => {
|
||||||
@@ -92,7 +102,7 @@ test.describe('viewer file types', () => {
|
|||||||
) {
|
) {
|
||||||
await page.dataTable.performClickFolderOrFileToOpen(fileName);
|
await page.dataTable.performClickFolderOrFileToOpen(fileName);
|
||||||
expect(await page.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
expect(await page.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||||
await page.viewer.waitForViewerLoaderToFinish();
|
await page.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||||
|
|
||||||
const viewerElements = {
|
const viewerElements = {
|
||||||
viewerImage: page.viewer.viewerImage,
|
viewerImage: page.viewer.viewerImage,
|
||||||
|
@@ -37,7 +37,8 @@ import {
|
|||||||
PersonalFilesPage,
|
PersonalFilesPage,
|
||||||
FavoritesPage,
|
FavoritesPage,
|
||||||
SharedPage,
|
SharedPage,
|
||||||
SearchPage
|
SearchPage,
|
||||||
|
timeouts
|
||||||
} from '@alfresco/aca-playwright-shared';
|
} from '@alfresco/aca-playwright-shared';
|
||||||
|
|
||||||
test.describe('Version actions', () => {
|
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 ({
|
test('[XAT-5506] Previous document version title should be the same in Preview mode as in Version Manager - Shared Files', async ({
|
||||||
sharedPage
|
sharedPage
|
||||||
}) => {
|
}) => {
|
||||||
await sharedPage.viewer.waitForViewerToOpen('wait for viewer content');
|
await sharedPage.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||||
expect(await sharedPage.viewer.getFileTitle()).toContain(filenameBeforeUpdate);
|
expect(await sharedPage.viewer.getFileTitle()).toContain(filenameBeforeUpdate);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -186,7 +186,7 @@ test.describe('viewer zoom functionality and reset', () => {
|
|||||||
await myLibrariesPage.navigate();
|
await myLibrariesPage.navigate();
|
||||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
|
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
|
||||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName);
|
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);
|
expect(await myLibrariesPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||||
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
|
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
|
||||||
await validateZoomScaleInViewer(myLibrariesPage);
|
await validateZoomScaleInViewer(myLibrariesPage);
|
||||||
@@ -224,7 +224,7 @@ test.describe('viewer zoom functionality and reset', () => {
|
|||||||
await myLibrariesPage.navigate();
|
await myLibrariesPage.navigate();
|
||||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
|
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
|
||||||
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName);
|
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);
|
expect(await myLibrariesPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||||
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
|
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
|
||||||
await validateFitToPageButtonActivity(myLibrariesPage);
|
await validateFitToPageButtonActivity(myLibrariesPage);
|
||||||
|
@@ -41,6 +41,7 @@ import { Site } from '@alfresco/js-api';
|
|||||||
test.describe('viewer file', () => {
|
test.describe('viewer file', () => {
|
||||||
const username = `user-${Utils.random()}`;
|
const username = `user-${Utils.random()}`;
|
||||||
const randomDocxName = `${TEST_FILES.DOCX.name}-${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 siteUser = `siteUser-${Utils.random()}`;
|
||||||
const fileInSite = TEST_FILES.DOCX.name;
|
const fileInSite = TEST_FILES.DOCX.name;
|
||||||
const siteAdmin = `siteAdmin-${Utils.random()}`;
|
const siteAdmin = `siteAdmin-${Utils.random()}`;
|
||||||
@@ -50,6 +51,7 @@ test.describe('viewer file', () => {
|
|||||||
let docLibSiteUserId: string;
|
let docLibSiteUserId: string;
|
||||||
let folderId: string;
|
let folderId: string;
|
||||||
let fileDocxId: string;
|
let fileDocxId: string;
|
||||||
|
let fileJpgId: string;
|
||||||
let nodesApi: NodesApi;
|
let nodesApi: NodesApi;
|
||||||
let trashcanApi: TrashcanApi;
|
let trashcanApi: TrashcanApi;
|
||||||
let siteActionsAdmin: SitesApi;
|
let siteActionsAdmin: SitesApi;
|
||||||
@@ -79,6 +81,8 @@ test.describe('viewer file', () => {
|
|||||||
folderId = node.entry.id;
|
folderId = node.entry.id;
|
||||||
const fileDoc = await fileActionApi.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
|
const fileDoc = await fileActionApi.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
|
||||||
fileDocxId = fileDoc.entry.id;
|
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);
|
const consumerFavoritesTotalItems = await favoritesActions.getFavoritesTotalItems(username);
|
||||||
await shareActions.shareFileById(fileDocxId);
|
await shareActions.shareFileById(fileDocxId);
|
||||||
await favoritesActions.addFavoriteById('file', 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 }) => {
|
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.navigate({ remoteUrl: previewURL });
|
||||||
await personalFiles.dataTable.spinnerWaitForReload();
|
await personalFiles.viewer.waitForViewerLoaderToFinish(timeouts.fortySeconds);
|
||||||
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
await expect(personalFiles.viewer.fileTitleButtonLocator).toContainText(randomJpgName);
|
||||||
await expect(personalFiles.viewer.fileTitleButtonLocator).toHaveText(randomDocxName);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[XAT-5480] Viewer opens for a file from Shared Files', async ({ sharedPage }) => {
|
test('[XAT-5480] Viewer opens for a file from Shared Files', async ({ sharedPage }) => {
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { ApiClientFactory } from './api-client-factory';
|
import { ApiClientFactory } from './api-client-factory';
|
||||||
import { Utils, waitForApi } from '../utils';
|
import { Utils, waitForApi } from '../utils';
|
||||||
import { NodeBodyCreate, NodeEntry, ResultSetPaging } from '@alfresco/js-api';
|
import { NodeBodyCreate, NodeEntry, ResultSetPaging, SearchRequest } from '@alfresco/js-api';
|
||||||
|
|
||||||
export class FileActionsApi {
|
export class FileActionsApi {
|
||||||
private apiService: ApiClientFactory;
|
private apiService: ApiClientFactory;
|
||||||
@@ -159,6 +159,63 @@ export class FileActionsApi {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await waitForApi(apiCall, predicate, 30, 2500);
|
await waitForApi(apiCall, predicate, 30, 2500);
|
||||||
|
console.log(`waitForNodes: Found ${data.expect} nodes with search term "${searchTerm}"`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error: ${error}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async queryNodesSearchHighlight(searchTerm: string): Promise<ResultSetPaging> {
|
||||||
|
const data: SearchRequest = {
|
||||||
|
query: {
|
||||||
|
query: `cm:name:"${searchTerm}*"`,
|
||||||
|
language: 'afts'
|
||||||
|
},
|
||||||
|
filterQueries: [{ query: `+TYPE:'cm:folder' OR +TYPE:'cm:content'` }],
|
||||||
|
highlight: {
|
||||||
|
prefix: "<span class='aca-highlight'>",
|
||||||
|
postfix: '</span>',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
field: 'cm:title'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cm:name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cm:description',
|
||||||
|
snippetCount: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cm:content',
|
||||||
|
snippetCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
return this.apiService.search.search(data);
|
||||||
|
} catch {
|
||||||
|
return new ResultSetPaging();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async waitForNodesSearchHighlight(searchTerm: string, data: { expect: number }): Promise<void> {
|
||||||
|
const predicate = (totalItems: number): boolean => totalItems === data.expect;
|
||||||
|
|
||||||
|
const apiCall = async (): Promise<number> => {
|
||||||
|
try {
|
||||||
|
return (await this.queryNodesSearchHighlight(searchTerm)).list.pagination.totalItems;
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(`queryNodesSearchHighlight failed for "${searchTerm}":`, error);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
await waitForApi(apiCall, predicate, 30, 2500);
|
||||||
|
console.log(`waitForNodesSearchHighlight: Found ${data.expect} nodes with search term "${searchTerm}"`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error: ${error}`);
|
console.error(`Error: ${error}`);
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,8 @@ export class SearchFiltersProperties extends BaseComponent {
|
|||||||
|
|
||||||
if (fileTypeInputText) {
|
if (fileTypeInputText) {
|
||||||
await this.fileTypeInput?.fill(fileTypeInputText);
|
await this.fileTypeInput?.fill(fileTypeInputText);
|
||||||
const targetDropdownOption = this.page.locator(`mat-option`, { hasText: fileTypeInputText });
|
await this.dropdownOptions.getByText(fileTypeInputText).waitFor();
|
||||||
|
await this.dropdownOptions.getByText(fileTypeInputText).click();
|
||||||
await targetDropdownOption.click();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await page.searchFilters.menuCardApply.click();
|
await page.searchFilters.menuCardApply.click();
|
||||||
|
@@ -63,6 +63,11 @@ export class ViewerComponent extends BaseComponent {
|
|||||||
return count > 0;
|
return count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async isViewerOpened(): Promise<boolean> {
|
||||||
|
await this.waitForViewerToOpen();
|
||||||
|
return this.viewerLocator.isVisible();
|
||||||
|
}
|
||||||
|
|
||||||
async waitForViewerToOpen(waitForViewerContent?: 'wait for viewer content'): Promise<void> {
|
async waitForViewerToOpen(waitForViewerContent?: 'wait for viewer content'): Promise<void> {
|
||||||
if (waitForViewerContent) {
|
if (waitForViewerContent) {
|
||||||
await this.waitForViewerLoaderToFinish();
|
await this.waitForViewerLoaderToFinish();
|
||||||
@@ -70,13 +75,13 @@ export class ViewerComponent extends BaseComponent {
|
|||||||
await this.viewerLocator.waitFor({ state: 'visible', timeout: timeouts.large });
|
await this.viewerLocator.waitFor({ state: 'visible', timeout: timeouts.large });
|
||||||
}
|
}
|
||||||
|
|
||||||
async isViewerOpened(): Promise<boolean> {
|
async waitForViewerLoaderToFinish(customTimeout?: number): Promise<void> {
|
||||||
await this.waitForViewerToOpen();
|
try {
|
||||||
return this.viewerLocator.isVisible();
|
await this.viewerSpinner.waitFor({ state: 'hidden', timeout: customTimeout || timeouts.extraLarge });
|
||||||
}
|
} catch (error) {
|
||||||
|
this.logger.log('waitForViewerLoaderToFinish: Timeout reached while waiting for viewer loader to finish.');
|
||||||
async waitForViewerLoaderToFinish(): Promise<void> {
|
throw error;
|
||||||
await this.viewerSpinner.waitFor({ state: 'hidden', timeout: timeouts.extraLarge });
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkViewerActivePage(pageNumber: number): Promise<void> {
|
async checkViewerActivePage(pageNumber: number): Promise<void> {
|
||||||
|
@@ -31,6 +31,8 @@ export const timeouts = {
|
|||||||
big: 7.5 * 1000,
|
big: 7.5 * 1000,
|
||||||
large: 10 * 1000,
|
large: 10 * 1000,
|
||||||
extraLarge: 20 * 1000,
|
extraLarge: 20 * 1000,
|
||||||
|
fortySeconds: 40 * 1000,
|
||||||
|
sixtySeconds: 60 * 1000,
|
||||||
globalTest: 85 * 1000,
|
globalTest: 85 * 1000,
|
||||||
extendedTest: 150 * 1000,
|
extendedTest: 150 * 1000,
|
||||||
extendedLongTest: 200 * 1000,
|
extendedLongTest: 200 * 1000,
|
||||||
|
@@ -96,9 +96,9 @@ export class Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async uploadFileNewVersion(personalFilesPage: PersonalFilesPage, fileFromOS: string): Promise<void> {
|
static async uploadFileNewVersion(personalFilesPage: PersonalFilesPage, fileFromOS: string, fileType: string): Promise<void> {
|
||||||
const fileInput = await personalFilesPage.page.$('#app-upload-file-version');
|
const fileInput = await personalFilesPage.page.$('#app-upload-file-version');
|
||||||
await fileInput.setInputFiles(path.join(__dirname, `../resources/test-files/${fileFromOS}.docx`));
|
await fileInput.setInputFiles(path.join(__dirname, `../resources/test-files/${fileFromOS}.${fileType}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
static async reloadPageIfRowNotVisible(
|
static async reloadPageIfRowNotVisible(
|
||||||
|
Reference in New Issue
Block a user