diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index bd6b727f6..c11993f92 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,6 +15,8 @@ env: BASE_URL: http://localhost ADMIN_EMAIL: admin ADMIN_PASSWORD: admin + HR_USER: admin + HR_USER_PASSWORD: admin SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }} SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}} PLAYWRIGHT_E2E_HOST: http://localhost:4200 @@ -217,6 +219,8 @@ jobs: echo 'BASE_URL=$BASE_URL' >> $GITHUB_ENV echo 'ADMIN_EMAIL=${{ secrets.PIPELINE_ADMIN_USERNAME }}' >> $GITHUB_ENV echo 'ADMIN_PASSWORD=${{ secrets.PIPELINE_ADMIN_PASSWORD }}' >> $GITHUB_ENV + echo 'HR_USER=${{ secrets.HR_USER }}' >> $GITHUB_ENV + echo 'HR_USER_PASSWORD=${{ secrets.HR_USER_PASSWORD }}' >> $GITHUB_ENV fi - name: Before e2e diff --git a/e2e/playwright/viewer/src/tests/viewer-action.e2e.ts b/e2e/playwright/viewer/src/tests/viewer-action.e2e.ts index 82c065bea..6aa188ea0 100644 --- a/e2e/playwright/viewer/src/tests/viewer-action.e2e.ts +++ b/e2e/playwright/viewer/src/tests/viewer-action.e2e.ts @@ -23,8 +23,9 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, test, TEST_FILES, timeouts, Utils } from '@alfresco/aca-playwright-shared'; +import { ApiClientFactory, getUserState, test, TEST_FILES, timeouts, Utils } from '@alfresco/aca-playwright-shared'; +test.use({ storageState: getUserState('hruser') }); test.describe('viewer action file', () => { const apiClientFactory = new ApiClientFactory(); const randomFolderName = `viewer-action-${Utils.random()}`; @@ -49,7 +50,7 @@ test.describe('viewer action file', () => { const docxRecentFiles = `docxRF-${Utils.random()}.docx`; test.beforeAll(async ({ fileAction, favoritesPageAction, shareAction }) => { - await apiClientFactory.setUpAcaBackend('admin'); + await apiClientFactory.setUpAcaBackend('hruser'); const node = await apiClientFactory.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' }); destinationId = (await apiClientFactory.nodes.createNode('-my-', { name: destination, nodeType: 'cm:folder', relativePath: '/' })).entry.id; folderId = node.entry.id; @@ -67,7 +68,7 @@ test.describe('viewer action file', () => { randomDocxNameFavoriteId = fileFavoritesNode.entry.id; await fileAction.uploadFile(TEST_FILES.DOCX.path, fileForEditOffline, folderId); await favoritesPageAction.addFavoriteById('file', randomDocxNameFavoriteId); - await favoritesPageAction.isFavoriteWithRetry('admin', randomDocxNameFavoriteId, { expect: true }); + await favoritesPageAction.isFavoriteWithRetry('hruser', randomDocxNameFavoriteId, { expect: true }); await fileAction.isFileLockedWriteWithRetry(fileForCancelEditingId, true); }); diff --git a/e2e/playwright/viewer/src/tests/viewer-protected.e2e.ts b/e2e/playwright/viewer/src/tests/viewer-protected.e2e.ts index bfa197b50..cfb7d8211 100644 --- a/e2e/playwright/viewer/src/tests/viewer-protected.e2e.ts +++ b/e2e/playwright/viewer/src/tests/viewer-protected.e2e.ts @@ -23,8 +23,9 @@ */ import { expect } from '@playwright/test'; -import { ApiClientFactory, test, TEST_FILES, Utils } from '@alfresco/aca-playwright-shared'; +import { ApiClientFactory, getUserState, test, TEST_FILES, Utils } from '@alfresco/aca-playwright-shared'; +test.use({ storageState: getUserState('hruser') }); test.describe('viewer file', () => { const apiClientFactory = new ApiClientFactory(); const randomFolderName = `viewer-protected-${Utils.random()}`; @@ -33,7 +34,7 @@ test.describe('viewer file', () => { let fileDocxId: string; test.beforeAll(async ({ fileAction, shareAction, favoritesPageAction }) => { - await apiClientFactory.setUpAcaBackend('admin'); + 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.PDF_PROTECTED.path, randomDocxName, folderId);