From d77b8a3d375dd5afec2a611a27196d004f529bb8 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Thu, 29 Feb 2024 19:02:16 +0530 Subject: [PATCH 1/6] [ACS-6907] enable exclude test --- e2e/playwright/list-views/exclude.tests.json | 19 ------------ e2e/playwright/navigation/exclude.tests.json | 4 +-- .../share-action/exclude.tests.json | 4 +-- .../exclude.tests.json | 24 +------------- e2e/playwright/viewer/exclude.tests.json | 6 +--- e2e/protractor/protractor.excludes.json | 31 ++----------------- 6 files changed, 6 insertions(+), 82 deletions(-) diff --git a/e2e/playwright/list-views/exclude.tests.json b/e2e/playwright/list-views/exclude.tests.json index cbf1aa46ea..91d27fbe25 100644 --- a/e2e/playwright/list-views/exclude.tests.json +++ b/e2e/playwright/list-views/exclude.tests.json @@ -1,23 +1,4 @@ { - "C213173": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213178": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213668": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297653": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297659": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213168": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213171": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213174": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213176": "https://alfresco.atlassian.net/browse/ACS-6688", - "C280486": "https://alfresco.atlassian.net/browse/ACS-6688", - "C280487": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213116": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213113": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213115": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213117": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213118": "https://alfresco.atlassian.net/browse/ACS-6688", - "C213666": "https://alfresco.atlassian.net/browse/ACS-6688", - "C280490": "https://alfresco.atlassian.net/browse/ACS-6688", - "C280491": "https://alfresco.atlassian.net/browse/ACS-6688", "C213217": "https://alfresco.atlassian.net/browse/ACS-6710", "C213245": "https://alfresco.atlassian.net/browse/ACS-6717", "C261153": "https://alfresco.atlassian.net/browse/AAE-7517", diff --git a/e2e/playwright/navigation/exclude.tests.json b/e2e/playwright/navigation/exclude.tests.json index ccf8b04808..0967ef424b 100644 --- a/e2e/playwright/navigation/exclude.tests.json +++ b/e2e/playwright/navigation/exclude.tests.json @@ -1,3 +1 @@ -{ - "C260970": "https://alfresco.atlassian.net/browse/ACS-6688" -} +{} diff --git a/e2e/playwright/share-action/exclude.tests.json b/e2e/playwright/share-action/exclude.tests.json index 179a1585f0..0967ef424b 100644 --- a/e2e/playwright/share-action/exclude.tests.json +++ b/e2e/playwright/share-action/exclude.tests.json @@ -1,3 +1 @@ -{ - "C286326": "https://alfresco.atlassian.net/browse/ACS-6688" -} \ No newline at end of file +{} diff --git a/e2e/playwright/special-permissions-actions-available/exclude.tests.json b/e2e/playwright/special-permissions-actions-available/exclude.tests.json index c44da6aa76..0967ef424b 100644 --- a/e2e/playwright/special-permissions-actions-available/exclude.tests.json +++ b/e2e/playwright/special-permissions-actions-available/exclude.tests.json @@ -1,23 +1 @@ -{ - "C326658": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326659": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326660": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326661": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326662": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297655": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297658": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326663": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297651": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297662": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297665": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297652": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297660": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297653": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297659": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297666": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297667": "https://alfresco.atlassian.net/browse/ACS-6688", - "C297672": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326674": "https://alfresco.atlassian.net/browse/ACS-6688", - "C326675": "https://alfresco.atlassian.net/browse/ACS-6688" - } - \ No newline at end of file +{} diff --git a/e2e/playwright/viewer/exclude.tests.json b/e2e/playwright/viewer/exclude.tests.json index 4bdbff950e..0967ef424b 100644 --- a/e2e/playwright/viewer/exclude.tests.json +++ b/e2e/playwright/viewer/exclude.tests.json @@ -1,5 +1 @@ -{ - "C286379": "https://alfresco.atlassian.net/browse/ACS-5601", - "C284636": "https://alfresco.atlassian.net/browse/ACS-6688", - "C284635": "https://alfresco.atlassian.net/browse/ACS-6688" -} +{} diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json index 4c33f0ad24..24e4de9629 100644 --- a/e2e/protractor/protractor.excludes.json +++ b/e2e/protractor/protractor.excludes.json @@ -19,33 +19,6 @@ "C213097": "https://alfresco.atlassian.net/browse/ACS-5479", "C269007" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ", "C307106" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ", - "C269003" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ", - "C290018" : "https://alfresco.atlassian.net/browse/ACA-4731", - "C277727" : "https://alfresco.atlassian.net/browse/ACS-6672", - "C277728" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C277740" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C277738" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C277734" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C277736" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C277732" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C299189" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C299195" : "https://alfresco.atlassian.net/browse/ACS-6688", - "MNT-21058" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C286384" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C286379" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297551" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297552" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297553" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297554" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297556" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297555" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297557" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297558" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297559" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297560" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297561" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297562" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297563" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297564" : "https://alfresco.atlassian.net/browse/ACS-6688", - "C297571" : "https://alfresco.atlassian.net/browse/ACS-6688" + "C269003" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 " + } From 05786d07ac630e225b58e937be1a861863aaf5a3 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Fri, 1 Mar 2024 13:47:21 +0530 Subject: [PATCH 2/6] [ACS-6907] test fix --- .../navigation/src/tests/breadcrumb-admin.spec.ts | 9 +++------ e2e/protractor/protractor.excludes.json | 5 +++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts index da0fb05e54..85abe445f1 100644 --- a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts +++ b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts @@ -23,29 +23,26 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, getUserState, NodesApi, test, Utils, LoginPage, timeouts } from '@alfresco/playwright-shared'; +import { ApiClientFactory, getUserState, LoginPage, NodesApi, test, users, Utils } from '@alfresco/playwright-shared'; test.use({ storageState: getUserState('admin') }); test.describe('as admin', () => { const apiClientFactory = new ApiClientFactory(); const userFolder = `userFolder-${Utils.random()}`; - const username = `userAdmin-${Utils.random()}`; let userFolderId: string; let nodesApi: NodesApi; test.beforeAll(async () => { await apiClientFactory.setUpAcaBackend('admin'); - await apiClientFactory.createUser({ username }); - nodesApi = await NodesApi.initialize(username, username); + nodesApi = await NodesApi.initialize('admin'); const node = await nodesApi.createFolder(userFolder); userFolderId = node.entry.id; }); test.beforeEach(async ({ page }) => { - test.setTimeout(timeouts.extendedTest); const loginPage = new LoginPage(page); await loginPage.loginUser( - { username, password: username }, + { username: users.admin.username, password: users.admin.password }, { withNavigation: true, waitForLoading: true diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json index 24e4de9629..1a4983216b 100644 --- a/e2e/protractor/protractor.excludes.json +++ b/e2e/protractor/protractor.excludes.json @@ -19,6 +19,7 @@ "C213097": "https://alfresco.atlassian.net/browse/ACS-5479", "C269007" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ", "C307106" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ", - "C269003" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 " - + "C269003" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ", + "C290018" : "https://alfresco.atlassian.net/browse/ACA-4731", + "C277727" : "https://alfresco.atlassian.net/browse/ACS-6672" } From 2c773a93ba031e69ae43ffd166cd910fe3f098f8 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Fri, 1 Mar 2024 14:32:40 +0530 Subject: [PATCH 3/6] [ACS-6907] test fix --- e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts index 85abe445f1..5a638b329a 100644 --- a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts +++ b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts @@ -27,6 +27,7 @@ import { ApiClientFactory, getUserState, LoginPage, NodesApi, test, users, Utils test.use({ storageState: getUserState('admin') }); test.describe('as admin', () => { + test.describe.configure({ mode: 'serial' }); const apiClientFactory = new ApiClientFactory(); const userFolder = `userFolder-${Utils.random()}`; let userFolderId: string; From 97b7badb4eb1ad575d54c856499e0cb7429bf961 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Fri, 1 Mar 2024 18:31:04 +0530 Subject: [PATCH 4/6] remove hruser dependancy --- .../src/tests/breadcrumb-admin.spec.ts | 6 +- .../navigation/src/tests/breadcrumb.spec.ts | 59 ++++++++++++------- .../navigation/src/tests/sidebar.spec.ts | 21 +++++-- .../navigation/src/tests/single-click.spec.ts | 44 +++++++++----- 4 files changed, 87 insertions(+), 43 deletions(-) diff --git a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts index 5a638b329a..9f7b90aa60 100644 --- a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts +++ b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts @@ -23,9 +23,8 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, getUserState, LoginPage, NodesApi, test, users, Utils } from '@alfresco/playwright-shared'; +import { ApiClientFactory, LoginPage, NodesApi, test, users, Utils } from '@alfresco/playwright-shared'; -test.use({ storageState: getUserState('admin') }); test.describe('as admin', () => { test.describe.configure({ mode: 'serial' }); const apiClientFactory = new ApiClientFactory(); @@ -40,8 +39,9 @@ test.describe('as admin', () => { userFolderId = node.entry.id; }); - test.beforeEach(async ({ page }) => { + test.beforeEach(async ({ page, personalFiles }) => { const loginPage = new LoginPage(page); + await personalFiles.navigate(); await loginPage.loginUser( { username: users.admin.username, password: users.admin.password }, { diff --git a/e2e/playwright/navigation/src/tests/breadcrumb.spec.ts b/e2e/playwright/navigation/src/tests/breadcrumb.spec.ts index ae4b2c9dfb..2bbe8c23db 100644 --- a/e2e/playwright/navigation/src/tests/breadcrumb.spec.ts +++ b/e2e/playwright/navigation/src/tests/breadcrumb.spec.ts @@ -23,11 +23,13 @@ */ import { expect } from '@playwright/test'; -import { getUserState, test, Utils } from '@alfresco/playwright-shared'; +import { ApiClientFactory, LoginPage, NodesApi, SitesApi, test, timeouts, Utils } from '@alfresco/playwright-shared'; import { Site } from '@alfresco/js-api'; -test.use({ storageState: getUserState('hruser') }); test.describe('viewer action file', () => { + let nodesApi: NodesApi; + let siteActions: SitesApi; + const username = `user-${Utils.random()}`; const parent = `parent-${Utils.random()}`; let parentId: string; const subFolder1 = `subFolder1-${Utils.random()}`; @@ -52,27 +54,44 @@ test.describe('viewer action file', () => { let folder1Id: string; const folder1Renamed = `renamed-${Utils.random()}`; - test.beforeAll(async ({ nodesApiAction, sitesApiAction }) => { - const parentNode = await nodesApiAction.createFolder(parent); + test.beforeAll(async () => { + test.setTimeout(timeouts.extendedTest); + const apiClientFactory = new ApiClientFactory(); + await apiClientFactory.setUpAcaBackend('admin'); + await apiClientFactory.createUser({ username }); + nodesApi = await NodesApi.initialize(username, username); + siteActions = await SitesApi.initialize(username, username); + const parentNode = await nodesApi.createFolder(parent); parentId = parentNode.entry.id; - subFolder1Id = (await nodesApiAction.createFolder(subFolder1, parentId)).entry.id; - subFolder2Id = (await nodesApiAction.createFolder(subFolder2, subFolder1Id)).entry.id; - await nodesApiAction.createFile(fileName1, subFolder2Id); - - parent2Id = (await nodesApiAction.createFolder(parent2)).entry.id; - folder1Id = (await nodesApiAction.createFolder(folder1, parent2Id)).entry.id; - - await sitesApiAction.createSite(siteName, Site.VisibilityEnum.PUBLIC); - docLibId = await sitesApiAction.getDocLibId(siteName); - parentFromSiteId = (await nodesApiAction.createFolder(parentFromSite, docLibId)).entry.id; - subFolder1FromSiteId = (await nodesApiAction.createFolder(subFolder1FromSite, parentFromSiteId)).entry.id; - subFolder2FromSiteId = (await nodesApiAction.createFolder(subFolder2FromSite, subFolder1FromSiteId)).entry.id; - await nodesApiAction.createFile(fileName1FromSite, subFolder2FromSiteId); + subFolder1Id = (await nodesApi.createFolder(subFolder1, parentId)).entry.id; + subFolder2Id = (await nodesApi.createFolder(subFolder2, subFolder1Id)).entry.id; + await nodesApi.createFile(fileName1, subFolder2Id); + + parent2Id = (await nodesApi.createFolder(parent2)).entry.id; + folder1Id = (await nodesApi.createFolder(folder1, parent2Id)).entry.id; + + await siteActions.createSite(siteName, Site.VisibilityEnum.PUBLIC); + docLibId = await siteActions.getDocLibId(siteName); + parentFromSiteId = (await nodesApi.createFolder(parentFromSite, docLibId)).entry.id; + subFolder1FromSiteId = (await nodesApi.createFolder(subFolder1FromSite, parentFromSiteId)).entry.id; + subFolder2FromSiteId = (await nodesApi.createFolder(subFolder2FromSite, subFolder1FromSiteId)).entry.id; + await nodesApi.createFile(fileName1FromSite, subFolder2FromSiteId); + }); + + test.beforeEach(async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.loginUser( + { username, password: username }, + { + withNavigation: true, + waitForLoading: true + } + ); }); - test.afterAll(async ({ nodesApiAction, sitesApiAction }) => { - await nodesApiAction.deleteNodes([parentId, parent2Id], true); - await sitesApiAction.deleteSites([docLibId]); + test.afterAll(async () => { + await nodesApi.deleteNodes([parentId, parent2Id], true); + await siteActions.deleteSites([docLibId]); }); test('[C260964] Personal Files breadcrumb main node', async ({ personalFiles }) => { diff --git a/e2e/playwright/navigation/src/tests/sidebar.spec.ts b/e2e/playwright/navigation/src/tests/sidebar.spec.ts index 7fcc577f1b..f02d8eed8e 100644 --- a/e2e/playwright/navigation/src/tests/sidebar.spec.ts +++ b/e2e/playwright/navigation/src/tests/sidebar.spec.ts @@ -23,14 +23,25 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, APP_ROUTES, getUserState, SIDEBAR_LABELS, test } from '@alfresco/playwright-shared'; +import { ApiClientFactory, APP_ROUTES, LoginPage, SIDEBAR_LABELS, test, Utils } from '@alfresco/playwright-shared'; -test.use({ storageState: getUserState('hruser') }); test.describe('Sidebar', () => { - const apiClientFactory = new ApiClientFactory(); - + const username = `user-${Utils.random()}`; test.beforeAll(async () => { - await apiClientFactory.setUpAcaBackend('hruser'); + const apiClientFactory = new ApiClientFactory(); + await apiClientFactory.setUpAcaBackend('admin'); + await apiClientFactory.createUser({ username }); + }); + + test.beforeEach(async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.loginUser( + { username, password: username }, + { + withNavigation: true, + waitForLoading: true + } + ); }); test('[C289901] navigate to My Libraries', async ({ personalFiles, myLibrariesPage }) => { diff --git a/e2e/playwright/navigation/src/tests/single-click.spec.ts b/e2e/playwright/navigation/src/tests/single-click.spec.ts index 9eb6b19f45..89e2e08f4f 100644 --- a/e2e/playwright/navigation/src/tests/single-click.spec.ts +++ b/e2e/playwright/navigation/src/tests/single-click.spec.ts @@ -23,12 +23,11 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, getUserState, test, Utils } from '@alfresco/playwright-shared'; +import { ApiClientFactory, LoginPage, NodesApi, SitesApi, test, Utils } from '@alfresco/playwright-shared'; -test.use({ storageState: getUserState('hruser') }); test.describe('Single click on item name', () => { - const apiClientFactory = new ApiClientFactory(); - + let nodesApi: NodesApi; + const username = `user-${Utils.random()}`; const folder1 = `folder1-${Utils.random()}`; let folder1Id: string; const folderSearch = `folder1-${Utils.random()}`; @@ -42,21 +41,36 @@ test.describe('Single click on item name', () => { const siteName = `site-${Utils.random()}`; const fileSite = `fileSite-${Utils.random()}.txt`; - test.beforeAll(async ({ nodesApiAction, sitesApiAction }) => { - await apiClientFactory.setUpAcaBackend('hruser'); - const node = await apiClientFactory.nodes.createNode('-my-', { name: folder1, nodeType: 'cm:folder', relativePath: '/' }); + test.beforeAll(async () => { + const apiClientFactory = new ApiClientFactory(); + await apiClientFactory.setUpAcaBackend('admin'); + await apiClientFactory.createUser({ username }); + nodesApi = await NodesApi.initialize(username, username); + const siteActions = await SitesApi.initialize(username, username); + const node = await nodesApi.createFolder(folder1); folder1Id = node.entry.id; - folderSearchId = (await nodesApiAction.createFolder(folderSearch)).entry.id; - deletedFile1Id = (await nodesApiAction.createFile(deletedFile1)).entry.id; - deletedFolder1Id = (await nodesApiAction.createFolder(deletedFolder1)).entry.id; + folderSearchId = (await nodesApi.createFolder(folderSearch)).entry.id; + deletedFile1Id = (await nodesApi.createFile(deletedFile1)).entry.id; + deletedFolder1Id = (await nodesApi.createFolder(deletedFolder1)).entry.id; + + await siteActions.createSite(siteName); + const docLibId = await siteActions.getDocLibId(siteName); + await nodesApi.createFile(fileSite, docLibId); + }); - await sitesApiAction.createSite(siteName); - const docLibId = await sitesApiAction.getDocLibId(siteName); - await nodesApiAction.createFile(fileSite, docLibId); + test.beforeEach(async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.loginUser( + { username, password: username }, + { + withNavigation: true, + waitForLoading: true + } + ); }); - test.afterAll(async ({ nodesApiAction }) => { - await nodesApiAction.deleteNodes([deletedFolder1Id, deletedFile1Id, folder1Id, folderSearchId], true); + test.afterAll(async () => { + await nodesApi.deleteNodes([deletedFolder1Id, deletedFile1Id, folder1Id, folderSearchId], true); }); test('[C284899] Hyperlink does not appear for items in the Trash', async ({ trashPage }) => { From e39858d4a968961b2a68dd7c16e8dd938dd10b37 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Fri, 1 Mar 2024 19:37:01 +0530 Subject: [PATCH 5/6] remove protractor duplicate tests --- .../suites/viewer/viewer-actions.test.ts | 168 ------------------ 1 file changed, 168 deletions(-) diff --git a/e2e/protractor/suites/viewer/viewer-actions.test.ts b/e2e/protractor/suites/viewer/viewer-actions.test.ts index cff6a6e2c4..1445c0afcd 100755 --- a/e2e/protractor/suites/viewer/viewer-actions.test.ts +++ b/e2e/protractor/suites/viewer/viewer-actions.test.ts @@ -32,11 +32,9 @@ import { Utils, Viewer, ContentNodeSelectorDialog, - ShareDialog, UploadNewVersionDialog, UploadFilesDialog } from '@alfresco/aca-testing-shared'; -import { By, element } from 'protractor'; describe('Viewer actions', () => { const username = `user-${Utils.random()}`; @@ -56,14 +54,12 @@ describe('Viewer actions', () => { const viewer = new Viewer(); const { toolbar } = viewer; const copyMoveDialog = new ContentNodeSelectorDialog(); - const shareDialog = new ShareDialog(); const uploadNewVersionDialog = new UploadNewVersionDialog(); const adminApiActions = new AdminActions(); const userActions = new UserActions(); const uploadFilesDialog = new UploadFilesDialog(); - const shareButton = element(By.css(`adf-viewer [data-automation-id="share-action-button"]`)); beforeAll(async () => { await adminApiActions.createUser({ username }); @@ -252,168 +248,4 @@ describe('Viewer actions', () => { await apis.user.nodes.deleteNodeChildren(destinationId); }); }); - - describe('from Shared Files', () => { - const parent = `parentSF-${Utils.random()}`; - let parentId: string; - const destination = `destSF-${Utils.random()}`; - let destinationId: string; - - const docxSharedFiles = `docxSF-${Utils.random()}.docx`; - let docxFileId: string; - - const xlsxSharedFiles = `xlsxSF-${Utils.random()}.xlsx`; - let xlsxFileId: string; - const pdfSharedFiles = `pdfSF-${Utils.random()}.pdf`; - let pdfFileId: string; - let fileSharedId: string; - - const fileForEditOffline = `file1-${Utils.random()}.docx`; - let fileForEditOfflineId: string; - const fileForCancelEditing = `file2-${Utils.random()}.docx`; - let fileForCancelEditingId: string; - const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; - let fileForUploadNewVersionId; - - beforeAll(async () => { - try { - parentId = (await apis.user.nodes.createFolder(parent)).entry.id; - destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; - docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxSharedFiles)).entry.id; - - xlsxFileId = (await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxSharedFiles)).entry.id; - pdfFileId = (await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfSharedFiles)).entry.id; - fileSharedId = (await apis.user.upload.uploadFile(docxFile2, parentId)).entry.id; - - fileForEditOfflineId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForEditOffline)).entry.id; - fileForCancelEditingId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForCancelEditing)).entry.id; - fileForUploadNewVersionId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForUploadNewVersion)).entry.id; - - await userActions.lockNodes([fileForCancelEditingId, fileForUploadNewVersionId]); - - await apis.user.shared.shareFilesByIds([ - docxFileId, - xlsxFileId, - pdfFileId, - fileForCancelEditingId, - fileForEditOfflineId, - fileForUploadNewVersionId, - fileSharedId - ]); - await apis.user.shared.waitForFilesToBeShared([ - docxFileId, - xlsxFileId, - pdfFileId, - fileForCancelEditingId, - fileForEditOfflineId, - fileForUploadNewVersionId, - fileSharedId - ]); - - await loginPage.loginWith(username); - } catch {} - }); - - beforeEach(async () => { - await page.clickSharedFilesAndWait(); - }); - - afterEach(async () => { - try { - await page.closeOpenDialogs(); - await Utils.pressEscape(); - await uploadFilesDialog.closeUploadDialog(); - } catch {} - }); - - afterAll(async () => { - try { - await userActions.login(username, username); - await apis.user.nodes.deleteNodesById([parentId, destinationId]); - await userActions.emptyTrashcan(); - } catch {} - }); - - it('[C286379] Favorite action', async () => { - await dataTable.doubleClickOnRowByName(docxSharedFiles); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - - await toolbar.clickMoreActionsFavorite(); - await viewer.closeButton.click(); - await page.clickFavoritesAndWait(); - expect(await apis.user.favorites.isFavorite(docxFileId)).toBe(true, 'Item is not favorite'); - expect(await dataTable.isItemPresent(docxSharedFiles)).toBe(true, 'Item is not present in Favorites list'); - }); - }); - - describe('from Favorites', () => { - const parent = `parentFav-${Utils.random()}`; - let parentId: string; - const destination = `destFav-${Utils.random()}`; - let destinationId: string; - - const docxFavorites = `docxFav-${Utils.random()}.docx`; - const xlsxFavorites = `xlsxFav-${Utils.random()}.xlsx`; - const pdfFavorites = `pdfFav-${Utils.random()}.pdf`; - const fileForEditOffline = `file1-${Utils.random()}.docx`; - const fileForCancelEditing = `file2-${Utils.random()}.docx`; - const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; - - beforeAll(async () => { - try { - parentId = (await apis.user.nodes.createFolder(parent)).entry.id; - destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; - const docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxFavorites)).entry.id; - - const xlsxFileId = (await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxFavorites)).entry.id; - const pdfFileId = (await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfFavorites)).entry.id; - const fileFavId = (await apis.user.upload.uploadFile(docxFile2, parentId)).entry.id; - - const fileForEditOfflineId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForEditOffline)).entry.id; - const fileForCancelEditingId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForCancelEditing)).entry.id; - const fileForUploadNewVersionId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForUploadNewVersion)).entry.id; - - await userActions.lockNodes([fileForCancelEditingId, fileForUploadNewVersionId]); - - await apis.user.favorites.addFavoritesByIds('file', [ - docxFileId, - xlsxFileId, - pdfFileId, - fileForEditOfflineId, - fileForCancelEditingId, - fileForUploadNewVersionId, - fileFavId - ]); - await apis.user.favorites.waitForApi({ expect: 7 }); - - await loginPage.loginWith(username); - } catch {} - }); - - beforeEach(async () => { - await page.clickFavoritesAndWait(); - }); - - afterEach(async () => { - await Utils.pressEscape(); - await uploadFilesDialog.closeUploadDialog(); - }); - - afterAll(async () => { - try { - await userActions.login(username, username); - await apis.user.nodes.deleteNodesById([parentId, destinationId]); - await userActions.emptyTrashcan(); - } catch {} - }); - - it('[C286395] Share action', async () => { - await dataTable.doubleClickOnRowByName(docxFavorites); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - - await shareButton.click(); - expect(await shareDialog.isDialogOpen()).toBe(true, 'Dialog is not open'); - await shareDialog.clickClose(); - }); - }); }); From 8903456867ffb0f4a8822f6d65ada1461b82f343 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Fri, 1 Mar 2024 19:51:56 +0530 Subject: [PATCH 6/6] review fix --- e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts | 2 +- e2e/playwright/navigation/src/tests/sidebar.spec.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts index 9f7b90aa60..4e75660799 100644 --- a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts +++ b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts @@ -27,12 +27,12 @@ import { ApiClientFactory, LoginPage, NodesApi, test, users, Utils } from '@alfr test.describe('as admin', () => { test.describe.configure({ mode: 'serial' }); - const apiClientFactory = new ApiClientFactory(); const userFolder = `userFolder-${Utils.random()}`; let userFolderId: string; let nodesApi: NodesApi; test.beforeAll(async () => { + const apiClientFactory = new ApiClientFactory(); await apiClientFactory.setUpAcaBackend('admin'); nodesApi = await NodesApi.initialize('admin'); const node = await nodesApi.createFolder(userFolder); diff --git a/e2e/playwright/navigation/src/tests/sidebar.spec.ts b/e2e/playwright/navigation/src/tests/sidebar.spec.ts index f02d8eed8e..a8c7f863b4 100644 --- a/e2e/playwright/navigation/src/tests/sidebar.spec.ts +++ b/e2e/playwright/navigation/src/tests/sidebar.spec.ts @@ -27,6 +27,7 @@ import { ApiClientFactory, APP_ROUTES, LoginPage, SIDEBAR_LABELS, test, Utils } test.describe('Sidebar', () => { const username = `user-${Utils.random()}`; + test.beforeAll(async () => { const apiClientFactory = new ApiClientFactory(); await apiClientFactory.setUpAcaBackend('admin');