mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5585] add direct api-client-factory call in tests (#3323)
This commit is contained in:
@@ -35,7 +35,7 @@ const config: PlaywrightTestConfig<CustomConfig> = {
|
||||
name: 'Folder Rules',
|
||||
testDir: './src/tests',
|
||||
use: {
|
||||
users: ['admin']
|
||||
users: ['hruser']
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@@ -23,10 +23,11 @@
|
||||
*/
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
import { ActionType, getUserState, test } from '@alfresco/playwright-shared';
|
||||
import { ActionType, ApiClientFactory, getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
test.use({ storageState: getUserState('admin') });
|
||||
test.use({ storageState: getUserState('hruser') });
|
||||
test.describe('Folder Rules Actions', () => {
|
||||
const apiClientFactory = new ApiClientFactory();
|
||||
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const checkInValue = 'check In Value';
|
||||
@@ -36,8 +37,9 @@ test.describe('Folder Rules Actions', () => {
|
||||
|
||||
let folderId: string;
|
||||
|
||||
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
test.beforeAll(async () => {
|
||||
await apiClientFactory.setUpAcaBackend('hruser');
|
||||
const node = await apiClientFactory.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder' });
|
||||
folderId = node.entry.id;
|
||||
});
|
||||
|
||||
@@ -45,8 +47,8 @@ test.describe('Folder Rules Actions', () => {
|
||||
await personalFiles.navigate({ waitUntil: 'domcontentloaded' });
|
||||
});
|
||||
|
||||
test.afterAll(async ({ superAdminApiClient }) => {
|
||||
await superAdminApiClient.nodes.deleteNode(folderId);
|
||||
test.afterAll(async () => {
|
||||
await apiClientFactory.nodes.deleteNode(folderId);
|
||||
});
|
||||
|
||||
test('[C691637] Create a rule with actions', async ({ personalFiles, nodesPage }) => {
|
||||
|
@@ -23,18 +23,20 @@
|
||||
*/
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
import { ActionType, Comparator, Field, getUserState, test } from '@alfresco/playwright-shared';
|
||||
import { ActionType, ApiClientFactory, Comparator, Field, getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
test.use({ storageState: getUserState('admin') });
|
||||
test.use({ storageState: getUserState('hruser') });
|
||||
test.describe('Folder Rules Conditions', () => {
|
||||
const apiClientFactory = new ApiClientFactory();
|
||||
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const specialChars = '!@£$%^&*()~#/';
|
||||
|
||||
let folderId: string;
|
||||
|
||||
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
test.beforeAll(async () => {
|
||||
await apiClientFactory.setUpAcaBackend('hruser');
|
||||
const node = await apiClientFactory.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder' });
|
||||
folderId = node.entry.id;
|
||||
});
|
||||
|
||||
@@ -42,8 +44,8 @@ test.describe('Folder Rules Conditions', () => {
|
||||
await personalFiles.navigate();
|
||||
});
|
||||
|
||||
test.afterAll(async ({ superAdminApiClient }) => {
|
||||
await superAdminApiClient.nodes.deleteNode(folderId);
|
||||
test.afterAll(async () => {
|
||||
await apiClientFactory.nodes.deleteNode(folderId);
|
||||
});
|
||||
|
||||
test('[C691638] Create a rule with condition', async ({ personalFiles, nodesPage }) => {
|
||||
|
@@ -22,27 +22,29 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { getUserState, test } from '@alfresco/playwright-shared';
|
||||
import { ApiClientFactory, getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
test.use({ storageState: getUserState('admin') });
|
||||
test.use({ storageState: getUserState('hruser') });
|
||||
test.describe('Rules - Manage Rules', () => {
|
||||
const apiClientFactory = new ApiClientFactory();
|
||||
const randomName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
|
||||
let folderId: string;
|
||||
|
||||
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
test.beforeAll(async () => {
|
||||
await apiClientFactory.setUpAcaBackend('hruser');
|
||||
const node = await apiClientFactory.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder' });
|
||||
folderId = node.entry.id;
|
||||
await superAdminApiClient.createRandomRule(folderId, randomRuleName);
|
||||
await apiClientFactory.createRandomRule(folderId, randomRuleName);
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ personalFiles }) => {
|
||||
await personalFiles.navigate();
|
||||
});
|
||||
|
||||
test.afterAll(async ({ superAdminApiClient }) => {
|
||||
await superAdminApiClient.nodes.deleteNode(folderId);
|
||||
test.afterAll(async () => {
|
||||
await apiClientFactory.nodes.deleteNode(folderId);
|
||||
});
|
||||
|
||||
test('[C691651] Disable an existing rule', async ({ personalFiles, nodesPage }) => {
|
||||
|
Reference in New Issue
Block a user