[ACS-5639] fix viewer exclude test from protractor and playwright (#3443)

* [ACS-5923] sidenav and singleclick test

* remove protractor test and fix flaky test

* test fix

* [ACS-5639] fix exclude test  in viewer

* remove exclude test and fix test
This commit is contained in:
Akash Rathod
2023-09-25 18:39:16 +02:00
committed by GitHub
parent 97f01386f8
commit be761bae7d
13 changed files with 191 additions and 375 deletions

View File

@@ -31,12 +31,18 @@ test.describe('viewer file', () => {
const randomFolderName = `playwright-folder-${Utils.random()}`;
const randomDocxName = `${TEST_FILES.DOCX.name}-${Utils.random()}`;
let folderId: string;
let fileDocxId: string;
test.beforeAll(async ({ fileAction }) => {
test.beforeAll(async ({ fileAction, shareAction, favoritesPageAction }) => {
await apiClientFactory.setUpAcaBackend('hruser');
const node = await apiClientFactory.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
folderId = node.entry.id;
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
const fileDoc = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
fileDocxId = fileDoc.entry.id;
await shareAction.shareFileById(fileDocxId);
await favoritesPageAction.addFavoriteById('file', fileDocxId);
await favoritesPageAction.isFavoriteWithRetry('hruser', fileDocxId, { expect: true });
await fileAction.waitForNodes(randomDocxName, { expect: 1 });
});
test.beforeEach(async ({ personalFiles }) => {
@@ -98,28 +104,6 @@ test.describe('viewer file', () => {
expect(await searchPage.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true);
expect(await searchPage.viewer.isFileTitleDisplayed(), 'File title is not displayed').toBe(true);
});
});
test.describe('viewer file', () => {
const apiClientFactory = new ApiClientFactory();
const randomFolderName = `playwright-folder-${Utils.random()}`;
const randomDocxName = `$(TEST_FILES.DOCX.name)-${Utils.random()}`;
let folderId: string;
let fileDocxId: string;
test.beforeAll(async ({ fileAction, shareAction, favoritesPageAction: favoritesPageAction }) => {
await apiClientFactory.setUpAcaBackend('hruser');
const node = await apiClientFactory.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
folderId = node.entry.id;
const fileDoc = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
fileDocxId = fileDoc.entry.id;
await shareAction.shareFileById(fileDocxId);
await favoritesPageAction.addFavoriteById('file', fileDocxId);
});
test.afterAll(async () => {
await apiClientFactory.nodes.deleteNode(folderId, { permanent: true });
});
test('[C279285] Viewer opens when accessing the preview URL for a file', async ({ personalFiles }) => {
const previewURL = `#/personal-files/${folderId}/(viewer:view/${fileDocxId})`;