diff --git a/.github/actions/run-e2e-playwright/action.yml b/.github/actions/run-e2e-playwright/action.yml index f4921ab9a8..7e3d959a14 100644 --- a/.github/actions/run-e2e-playwright/action.yml +++ b/.github/actions/run-e2e-playwright/action.yml @@ -28,11 +28,3 @@ runs: echo "Running playwright tests with options ${{ inputs.options }}" sleep 90 npx nx run ${{ inputs.options }}-e2e:e2e - - - - name: Upload E2Es results - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.artifact-name }} - path: test-results/ diff --git a/e2e/playwright/create-actions/exclude.tests.json b/e2e/playwright/create-actions/exclude.tests.json index 0967ef424b..69f20695b9 100644 --- a/e2e/playwright/create-actions/exclude.tests.json +++ b/e2e/playwright/create-actions/exclude.tests.json @@ -1 +1,48 @@ -{} +{ + "C325043": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325044": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325045": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325047": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325031": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325032": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325033": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325030": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325026": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325042": "https://alfresco.atlassian.net/browse/ACS-6412", + + "C325147": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325148": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325149": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325150": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325153": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325151": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325139": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325143": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325144": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325145": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325146": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325157": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325154": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325158": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325161": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325142": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325141": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325140": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325156": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325155": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325162": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325163": "https://alfresco.atlassian.net/browse/ACS-6412", + + "C325050": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325048": "https://alfresco.atlassian.net/browse/ACS-6412", + "C216339": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325020": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325034": "https://alfresco.atlassian.net/browse/ACS-6412", + "C290146": "https://alfresco.atlassian.net/browse/ACS-6412", + "C290142": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325028": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325027": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325023": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325024": "https://alfresco.atlassian.net/browse/ACS-6412", + "C325025": "https://alfresco.atlassian.net/browse/ACS-6412" +} \ No newline at end of file diff --git a/e2e/playwright/library-actions/exclude.tests.json b/e2e/playwright/library-actions/exclude.tests.json index 0967ef424b..179a1585f0 100644 --- a/e2e/playwright/library-actions/exclude.tests.json +++ b/e2e/playwright/library-actions/exclude.tests.json @@ -1 +1,3 @@ -{} +{ + "C286326": "https://alfresco.atlassian.net/browse/ACS-6688" +} \ No newline at end of file diff --git a/e2e/playwright/library-actions/src/tests/library-actions.spec.ts b/e2e/playwright/library-actions/src/tests/library-actions.spec.ts index a95ee341bc..cc86c77331 100644 --- a/e2e/playwright/library-actions/src/tests/library-actions.spec.ts +++ b/e2e/playwright/library-actions/src/tests/library-actions.spec.ts @@ -90,7 +90,7 @@ test.describe('Library actions ', () => { let user2SitesApi: SitesApi; test.beforeAll(async () => { - test.setTimeout(timeouts.extendedTest); + test.setTimeout(timeouts.extendedLongTest); const apiClientFactory = new ApiClientFactory(); const username1 = `user-${Utils.random()}`; const siteRoles = [ diff --git a/e2e/playwright/list-views/exclude.tests.json b/e2e/playwright/list-views/exclude.tests.json index 0967ef424b..3fc9859188 100644 --- a/e2e/playwright/list-views/exclude.tests.json +++ b/e2e/playwright/list-views/exclude.tests.json @@ -1 +1,22 @@ -{} +{ + "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" +} diff --git a/e2e/playwright/list-views/src/tests/favorites.spec.ts b/e2e/playwright/list-views/src/tests/favorites.spec.ts index 3f4c8fe2c5..beb927bbb5 100644 --- a/e2e/playwright/list-views/src/tests/favorites.spec.ts +++ b/e2e/playwright/list-views/src/tests/favorites.spec.ts @@ -115,6 +115,7 @@ test.describe('Favorites Files', () => { expect(await favoritePage.dataTable.getItemLocationText(favFolderName)).toEqual('Personal Files'); expect(await favoritePage.dataTable.getItemLocationTooltip(fileName2)).toEqual(`Personal Files/${parentFolder}`); expect(await favoritePage.dataTable.getItemLocationTooltip(favFolderName)).toEqual('Personal Files'); + await favoritePage.page.waitForTimeout(2500); expect(await favoritePage.dataTable.getItemLocationText(fileName1)).toEqual(siteName); expect(await favoritePage.dataTable.getItemLocationTooltip(fileName1)).toContain(`${siteName}`); }); diff --git a/e2e/playwright/list-views/src/tests/sort-list.spec.ts b/e2e/playwright/list-views/src/tests/sort-list.spec.ts index ac61d43280..66d58c99d9 100644 --- a/e2e/playwright/list-views/src/tests/sort-list.spec.ts +++ b/e2e/playwright/list-views/src/tests/sort-list.spec.ts @@ -229,6 +229,7 @@ test.describe('Remember sorting', () => { }); test.describe('User Tests', () => { + test.describe.configure({ mode: 'serial' }); test('[C261137] Size sort order is retained when user logs out and logs back in', async ({ personalFiles, loginPage }) => { await personalFiles.dataTable.sortBy('Name', 'desc'); await personalFiles.dataTable.spinnerWaitForReload(); @@ -238,6 +239,7 @@ test.describe('Remember sorting', () => { await loginPage.logoutUser(); await FileActionsApi.initialize(user1, user1); await loginPage.loginUser({ username: user1, password: user1 }, { withNavigation: true, waitForLoading: true }); + await loginPage.verifyUserLogin(); const actualSortData = await getSortState(personalFiles); expect(actualSortData).toEqual(expectedSortData); @@ -250,13 +252,8 @@ test.describe('Remember sorting', () => { await loginPage.logoutUser(); await FileActionsApi.initialize(user2, user2); - await loginPage.loginUser( - { username: user2, password: user2 }, - { - withNavigation: true, - waitForLoading: true - } - ); + await loginPage.loginUser({ username: user2, password: user2 }, { withNavigation: true, waitForLoading: true }); + await loginPage.verifyUserLogin(); const actualSortData = await getSortState(personalFiles); expect(actualSortData).not.toEqual(expectedSortData); diff --git a/e2e/playwright/list-views/src/tests/trash-admin.spec.ts b/e2e/playwright/list-views/src/tests/trash-admin.spec.ts index b84eda52e1..0c0bf5d7dc 100755 --- a/e2e/playwright/list-views/src/tests/trash-admin.spec.ts +++ b/e2e/playwright/list-views/src/tests/trash-admin.spec.ts @@ -23,7 +23,7 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, NodesApi, Utils, getUserState, test } from '@alfresco/playwright-shared'; +import { ApiClientFactory, NodesApi, Utils, getUserState, test, LoginPage, users } from '@alfresco/playwright-shared'; test.use({ storageState: getUserState('admin') }); test.describe('Trash admin', () => { @@ -51,6 +51,17 @@ test.describe('Trash admin', () => { } }); + test.beforeEach(async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.loginUser( + { username: users.admin.username, password: users.admin.password }, + { + withNavigation: true, + waitForLoading: true + } + ); + }); + test.describe('as admin', () => { test('[C213217] has the correct columns', async ({ trashPage }) => { await trashPage.navigate(); diff --git a/e2e/playwright/navigation/exclude.tests.json b/e2e/playwright/navigation/exclude.tests.json index 0967ef424b..ccf8b04808 100644 --- a/e2e/playwright/navigation/exclude.tests.json +++ b/e2e/playwright/navigation/exclude.tests.json @@ -1 +1,3 @@ -{} +{ + "C260970": "https://alfresco.atlassian.net/browse/ACS-6688" +} diff --git a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts index 704ccda9d8..da0fb05e54 100644 --- a/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts +++ b/e2e/playwright/navigation/src/tests/breadcrumb-admin.spec.ts @@ -23,7 +23,7 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, getUserState, NodesApi, test, Utils } from '@alfresco/playwright-shared'; +import { ApiClientFactory, getUserState, NodesApi, test, Utils, LoginPage, timeouts } from '@alfresco/playwright-shared'; test.use({ storageState: getUserState('admin') }); test.describe('as admin', () => { @@ -41,17 +41,25 @@ test.describe('as admin', () => { userFolderId = node.entry.id; }); - test.beforeEach(async ({ personalFiles }) => { - await personalFiles.navigate({ remoteUrl: `#/personal-files}` }); + test.beforeEach(async ({ page }) => { + test.setTimeout(timeouts.extendedTest); + const loginPage = new LoginPage(page); + await loginPage.loginUser( + { username, password: username }, + { + withNavigation: true, + waitForLoading: true + } + ); }); test.afterAll(async () => { - await apiClientFactory.nodes.deleteNode(userFolderId, { permanent: true }); + await nodesApi.deleteNodes([userFolderId], true); }); test(`[C260970] Breadcrumb on navigation to a user's home`, async ({ personalFiles }) => { await personalFiles.navigate({ remoteUrl: `#/personal-files/${userFolderId}` }); - personalFiles.breadcrumb.getItemByTitle(username).waitFor({ state: 'attached' }); - expect(await personalFiles.breadcrumb.getAllItems()).toEqual(['Personal Files', 'User Homes', username, userFolder]); + await personalFiles.breadcrumb.getItemByTitle(userFolder).waitFor({ state: 'attached' }); + expect(await personalFiles.breadcrumb.getAllItems()).toEqual(['Personal Files', userFolder]); }); }); diff --git a/e2e/playwright/share-action/exclude.tests.json b/e2e/playwright/share-action/exclude.tests.json index 0967ef424b..179a1585f0 100644 --- a/e2e/playwright/share-action/exclude.tests.json +++ b/e2e/playwright/share-action/exclude.tests.json @@ -1 +1,3 @@ -{} +{ + "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 0967ef424b..c44da6aa76 100644 --- a/e2e/playwright/special-permissions-actions-available/exclude.tests.json +++ b/e2e/playwright/special-permissions-actions-available/exclude.tests.json @@ -1 +1,23 @@ -{} +{ + "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 14b8e54beb..4bdbff950e 100644 --- a/e2e/playwright/viewer/exclude.tests.json +++ b/e2e/playwright/viewer/exclude.tests.json @@ -1,3 +1,5 @@ { - "C286379": "https://alfresco.atlassian.net/browse/ACS-5601" + "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 1a4983216b..4c33f0ad24 100644 --- a/e2e/protractor/protractor.excludes.json +++ b/e2e/protractor/protractor.excludes.json @@ -21,5 +21,31 @@ "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" + "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" } diff --git a/package.json b/package.json index 1050bda89c..a5b05ada4a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "print-affected:projects": "nx print-affected --type=lib --select=projects", "print-affected:build": "nx print-affected --target=build --select=tasks.target.project", "print-affected:test": "nx print-affected --target=test --select=tasks.target.project", - "print-affected:lint": "nx print-affected --target=lint --select=tasks.target.project" + "print-affected:lint": "nx print-affected --target=lint --select=tasks.target.project", + "lintfix": "nx affected:lint --fix" }, "repository": { "type": "git", diff --git a/projects/aca-playwright-shared/src/page-objects/pages/login.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/login.page.ts index f211a990a9..c07ddb3b27 100644 --- a/projects/aca-playwright-shared/src/page-objects/pages/login.page.ts +++ b/projects/aca-playwright-shared/src/page-objects/pages/login.page.ts @@ -66,4 +66,10 @@ export class LoginPage extends BasePage { const type = await this.password.getAttribute('type'); return type === 'text'; } + + async verifyUserLogin(): Promise { + if (this.username.isVisible()) { + await this.page.reload({ waitUntil:"load" }); + } + } } diff --git a/projects/aca-playwright-shared/src/utils/timeouts.ts b/projects/aca-playwright-shared/src/utils/timeouts.ts index 62a5b16be4..5c75925a73 100644 --- a/projects/aca-playwright-shared/src/utils/timeouts.ts +++ b/projects/aca-playwright-shared/src/utils/timeouts.ts @@ -33,6 +33,7 @@ export const timeouts = { extraLarge: 20 * 1000, globalTest: 45 * 1000, extendedTest: 150 * 1000, + extendedLongTest: 200 * 1000, webServer: 240 * 1000, globalSpec: 60 * 10 * 1000 };