mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-10838] enable hruser for viewer test
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user