mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[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:
@@ -1,9 +1 @@
|
||||
{
|
||||
"C284636" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639",
|
||||
"C284635" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639",
|
||||
"C279175" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639",
|
||||
"C284634" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639",
|
||||
"C297585" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639",
|
||||
"C286379" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639",
|
||||
"C286395" : "this have Protractor test Enabled https://alfresco.atlassian.net/browse/ACS-5639"
|
||||
}
|
||||
{}
|
||||
|
@@ -37,19 +37,26 @@ test.describe('viewer action file', () => {
|
||||
const fileForCancelEditing = `playwright-file2-${Utils.random()}.docx`;
|
||||
let folderId: string;
|
||||
let fileDocxShareId: string;
|
||||
let randomDocxNameFavoriteId: string;
|
||||
let fileForCancelEditingId: string;
|
||||
|
||||
test.beforeAll(async ({ fileAction, shareAction }) => {
|
||||
test.beforeAll(async ({ fileAction, favoritesPageAction, shareAction }) => {
|
||||
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, fileForCancelEditing, folderId);
|
||||
|
||||
fileDocxShareId = (await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameShare, folderId)).entry.id;
|
||||
await shareAction.shareFileById(fileDocxShareId);
|
||||
fileForCancelEditingId = (await fileAction.uploadFile(TEST_FILES.DOCX.path, fileForCancelEditing, folderId)).entry.id;
|
||||
await fileAction.lockNodes([fileForCancelEditingId]);
|
||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId);
|
||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxDelete, folderId);
|
||||
const fileDocShare = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameShare, folderId);
|
||||
fileDocxShareId = fileDocShare.entry.id;
|
||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameFavorite, folderId);
|
||||
await shareAction.shareFileById(fileDocxShareId);
|
||||
const fileFavoritesNode = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxNameFavorite, folderId);
|
||||
randomDocxNameFavoriteId = fileFavoritesNode.entry.id;
|
||||
await fileAction.uploadFile(TEST_FILES.DOCX.path, fileForEditOffline, folderId);
|
||||
await favoritesPageAction.addFavoriteById('file', randomDocxNameFavoriteId);
|
||||
await favoritesPageAction.isFavoriteWithRetry('hruser', randomDocxNameFavoriteId, { expect: true });
|
||||
await fileAction.isFileLockedWriteWithRetry(fileForCancelEditingId, true);
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ personalFiles }) => {
|
||||
@@ -140,6 +147,7 @@ test.describe('viewer action file', () => {
|
||||
await favoritePage.viewerDialog.favoriteMenuButton.waitFor({ state: 'detached', timeout: timeouts.normal });
|
||||
|
||||
await sharedPage.acaHeader.clickViewerMoreActions();
|
||||
await favoritePage.viewerDialog.removeFavoriteMenuButton.waitFor({ state: 'attached', timeout: timeouts.normal });
|
||||
expect(await sharedPage.viewerDialog.removeFavoriteMenuButton.isVisible(), 'Item should be remove favorite').toBe(true);
|
||||
await sharedPage.page.keyboard.press('Escape');
|
||||
await favoritePage.navigate({ waitUntil: 'domcontentloaded' });
|
||||
@@ -150,8 +158,9 @@ test.describe('viewer action file', () => {
|
||||
await favoritePage.navigate({ waitUntil: 'domcontentloaded' });
|
||||
await favoritePage.dataTable.performClickFolderOrFileToOpen(randomDocxNameFavorite);
|
||||
expect(await favoritePage.viewer.isViewerOpened(), 'Viewer should be opened').toBe(true);
|
||||
|
||||
await favoritePage.acaHeader.shareButton.click();
|
||||
await favoritePage.viewer.shareButton.waitFor({ state: 'attached', timeout: timeouts.normal });
|
||||
await favoritePage.viewer.shareButton.click();
|
||||
await favoritePage.viewerDialog.shareDialogTitle.waitFor({ state: 'attached', timeout: timeouts.normal });
|
||||
expect(await favoritePage.viewerDialog.shareDialogTitle.isVisible(), 'Share dialog should be open').toBe(true);
|
||||
await favoritePage.viewerDialog.shareDialogClose.click();
|
||||
await favoritePage.viewerDialog.shareDialogClose.waitFor({ state: 'detached', timeout: timeouts.large });
|
||||
|
@@ -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})`;
|
||||
|
Reference in New Issue
Block a user