mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5343] refactor Playwright framework in ACA (#3261)
* [ACS-5343] refactor Playwright framework in ACA * Add the tests for Actions, from the Adam PR [ACS-5328] * Small fixes * Improve logs * [ACS-5343] adding-goThroughPages-and-delete * [ACS-5343] added git changes * [ACS-5343] added git changes for playwright * [ACS-5343] fix for e2e * [ACS-5343] e2e protractor path fix * remove import * [ACS-5343] e2e playwright user fix * [ACS-5343] e2e playwright user ids fix * [ACS-5343] e2e playwright users ids fix * changes for git * fix playwright test run * tsconfig path fix * playwright action yml added * retrigger checks * add test id from testrail * merge conflits * fix gha * fix credentials --------- Co-authored-by: adam.zakrzewski <adam.zakrzewski@hyland.com> Co-authored-by: akash.rathod@hyland.com <akash.rathod@hyland.com> Co-authored-by: Denys Vuika <denys.vuika@gmail.com>
This commit is contained in:
26
e2e/playwright/actions/.eslintrc.json
Normal file
26
e2e/playwright/actions/.eslintrc.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"extends": "../../../.eslintrc.json",
|
||||
"ignorePatterns": [
|
||||
"!**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"e2e/playwright/actions/tsconfig.e2e.json"
|
||||
],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"plugins": [
|
||||
"rxjs",
|
||||
"unicorn"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-floating-promises": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
1
e2e/playwright/actions/exclude.tests.json
Normal file
1
e2e/playwright/actions/exclude.tests.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
@@ -22,17 +22,23 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
import { PlaywrightTestConfig } from '@playwright/test';
|
||||
import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared';
|
||||
import EXCLUDED_JSON from './exclude.tests.json';
|
||||
|
||||
export class MatMenuComponent extends BaseComponent {
|
||||
private static rootElement = '.mat-menu-content';
|
||||
const config: PlaywrightTestConfig<CustomConfig> = {
|
||||
...getGlobalConfig,
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, MatMenuComponent.rootElement);
|
||||
}
|
||||
grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Actions'),
|
||||
projects: [
|
||||
{
|
||||
name: 'Actions',
|
||||
testDir: './src/tests',
|
||||
use: {
|
||||
users: ['hruser']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
public getMenuItemsLocator = this.getChild('button');
|
||||
|
||||
public getButtonByText = (text: string) => this.getChild('button', { hasText: text });
|
||||
}
|
||||
export default config;
|
34
e2e/playwright/actions/project.json
Normal file
34
e2e/playwright/actions/project.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"name": "actions-e2e",
|
||||
"sourceRoot": "e2e/playwright/actions/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"npx playwright test --config=e2e/playwright/actions/playwright.config.ts"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "content-ce:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"e2e/**/*.ts",
|
||||
"e2e/**/*.html"
|
||||
],
|
||||
"cache": true,
|
||||
"cacheLocation": ".eslintcache",
|
||||
"ignorePath": ".eslintignore"
|
||||
},
|
||||
"outputs": ["{options.outputFile}"]
|
||||
}
|
||||
}
|
||||
}
|
@@ -22,30 +22,29 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { PersonalFilesPage, NodesPage } from '../page-objects';
|
||||
import { test as base } from '@playwright/test';
|
||||
import { ApiClientFactory } from '@alfresco/playwright-shared';
|
||||
import { expect } from '@playwright/test';
|
||||
import { getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
interface Pages {
|
||||
personalFiles: PersonalFilesPage;
|
||||
nodesPage: NodesPage;
|
||||
}
|
||||
test.use({ storageState: getUserState('hruser') });
|
||||
test.describe('Create actions', () => {
|
||||
let randomFolderName: string;
|
||||
|
||||
interface Api {
|
||||
apiClient: ApiClientFactory;
|
||||
}
|
||||
test.beforeEach(async ({ personalFiles }) => {
|
||||
randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
await personalFiles.navigate();
|
||||
});
|
||||
|
||||
export const test = base.extend<Pages & Api>({
|
||||
personalFiles: async ({ page }, use) => {
|
||||
await use(new PersonalFilesPage(page));
|
||||
},
|
||||
nodesPage: async ({ page }, use) => {
|
||||
await use(new NodesPage(page));
|
||||
},
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
apiClient: async ({}, use) => {
|
||||
const apiClient = new ApiClientFactory();
|
||||
await apiClient.setUpAcaBackend('admin');
|
||||
await use(apiClient);
|
||||
}
|
||||
test.afterEach(async ({ personalFiles }) => {
|
||||
await personalFiles.dataTable.performActionFromExpandableMenu(randomFolderName, 'Delete');
|
||||
});
|
||||
|
||||
test('[C216341] Create a folder with name only', async ({ personalFiles }) => {
|
||||
await personalFiles.acaHeader.createButton.click();
|
||||
await personalFiles.matMenu.createFolder.click();
|
||||
await personalFiles.folderDialog.folderNameInputLocator.fill(randomFolderName);
|
||||
await personalFiles.folderDialog.createButton.click();
|
||||
|
||||
await personalFiles.dataTable.goThroughPagesLookingForRowWithName(randomFolderName);
|
||||
await expect(personalFiles.dataTable.getRowByName(randomFolderName)).toBeVisible();
|
||||
});
|
||||
});
|
15
e2e/playwright/actions/tsconfig.e2e.adf.json
Normal file
15
e2e/playwright/actions/tsconfig.e2e.adf.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.adf.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"types": ["jasmine", "jasminewd2", "node"],
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
12
e2e/playwright/actions/tsconfig.e2e.json
Executable file
12
e2e/playwright/actions/tsconfig.e2e.json
Executable file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
|
||||
"skipLibCheck": true,
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
26
e2e/playwright/folder-rules/.eslintrc.json
Normal file
26
e2e/playwright/folder-rules/.eslintrc.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"extends": "../../../.eslintrc.json",
|
||||
"ignorePatterns": [
|
||||
"!**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"e2e/playwright/folder-rules/tsconfig.e2e.json"
|
||||
],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"plugins": [
|
||||
"rxjs",
|
||||
"unicorn"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-floating-promises": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
1
e2e/playwright/folder-rules/exclude.tests.json
Normal file
1
e2e/playwright/folder-rules/exclude.tests.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
@@ -22,18 +22,23 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BaseComponent } from '../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
import { PlaywrightTestConfig } from '@playwright/test';
|
||||
import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared';
|
||||
import EXCLUDED_JSON from './exclude.tests.json';
|
||||
|
||||
export class ToolbarComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-toolbar';
|
||||
private createRuleButton = this.getChild('[data-automation-id="manage-rules-create-button"]');
|
||||
const config: PlaywrightTestConfig<CustomConfig> = {
|
||||
...getGlobalConfig,
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, ToolbarComponent.rootElement);
|
||||
}
|
||||
grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Folder Rules'),
|
||||
projects: [
|
||||
{
|
||||
name: 'Folder Rules',
|
||||
testDir: './src/tests',
|
||||
use: {
|
||||
users: ['admin']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
async clickCreateRuleButton(): Promise<void> {
|
||||
await this.createRuleButton.click();
|
||||
}
|
||||
}
|
||||
export default config;
|
34
e2e/playwright/folder-rules/project.json
Normal file
34
e2e/playwright/folder-rules/project.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"name": "folder-rules-e2e",
|
||||
"sourceRoot": "e2e/playwright/folder-rules/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"npx playwright test --config=e2e/playwright/folder-rules/playwright.config.ts"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "content-ce:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"e2e/**/*.ts",
|
||||
"e2e/**/*.html"
|
||||
],
|
||||
"cache": true,
|
||||
"cacheLocation": ".eslintcache",
|
||||
"ignorePath": ".eslintignore"
|
||||
},
|
||||
"outputs": ["{options.outputFile}"]
|
||||
}
|
||||
}
|
||||
}
|
@@ -22,10 +22,10 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { test } from '../fixtures/page-initialization';
|
||||
import { ActionType } from '../page-objects/components/actions-dropdown.component';
|
||||
import { expect } from '@playwright/test';
|
||||
import { ActionType, getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
test.use({ storageState: getUserState('admin') });
|
||||
test.describe('Folder Rules Actions', () => {
|
||||
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
@@ -36,8 +36,8 @@ test.describe('Folder Rules Actions', () => {
|
||||
|
||||
let folderId: string;
|
||||
|
||||
test.beforeAll(async ({ apiClient }) => {
|
||||
const node = await apiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
folderId = node.entry.id;
|
||||
});
|
||||
|
||||
@@ -45,15 +45,15 @@ test.describe('Folder Rules Actions', () => {
|
||||
await personalFiles.navigate({ waitUntil: 'domcontentloaded' });
|
||||
});
|
||||
|
||||
test.afterAll(async ({ apiClient }) => {
|
||||
await apiClient.nodes.deleteNode(folderId);
|
||||
test.afterAll(async ({ superAdminApiClient }) => {
|
||||
await superAdminApiClient.nodes.deleteNode(folderId);
|
||||
});
|
||||
|
||||
test('Create a rule with actions', async ({ personalFiles, nodesPage }) => {
|
||||
test('[C691637] Create a rule with actions', async ({ personalFiles, nodesPage }) => {
|
||||
await personalFiles.dataTable.performActionFromExpandableMenu(randomFolderName, 'Manage rules');
|
||||
|
||||
await nodesPage.toolbar.clickCreateRuleButton();
|
||||
await nodesPage.manageRulesDialog.typeRuleName(randomRuleName);
|
||||
await nodesPage.manageRulesDialog.ruleNameInputLocator.type(randomRuleName);
|
||||
|
||||
await nodesPage.actionsDropdown.selectAction(ActionType.HideRecord, 0);
|
||||
await nodesPage.actionsDropdown.selectAction(ActionType.IncrementCounter, 1);
|
@@ -22,11 +22,10 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { test } from '../fixtures/page-initialization';
|
||||
import { ActionType } from '../page-objects/components/actions-dropdown.component';
|
||||
import { Comparator, Field } from '../page-objects/components/conditions.component';
|
||||
import { expect } from '@playwright/test';
|
||||
import { ActionType, Comparator, Field, getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
test.use({ storageState: getUserState('admin') });
|
||||
test.describe('Folder Rules Conditions', () => {
|
||||
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||
@@ -34,8 +33,8 @@ test.describe('Folder Rules Conditions', () => {
|
||||
|
||||
let folderId: string;
|
||||
|
||||
test.beforeAll(async ({ apiClient }) => {
|
||||
const node = await apiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
folderId = node.entry.id;
|
||||
});
|
||||
|
||||
@@ -43,18 +42,18 @@ test.describe('Folder Rules Conditions', () => {
|
||||
await personalFiles.navigate();
|
||||
});
|
||||
|
||||
test.afterAll(async ({ apiClient }) => {
|
||||
await apiClient.nodes.deleteNode(folderId);
|
||||
test.afterAll(async ({ superAdminApiClient }) => {
|
||||
await superAdminApiClient.nodes.deleteNode(folderId);
|
||||
});
|
||||
|
||||
test('Create a rule with condition', async ({ personalFiles, nodesPage }) => {
|
||||
test('[C691638] Create a rule with condition', async ({ personalFiles, nodesPage }) => {
|
||||
await personalFiles.dataTable.performActionFromExpandableMenu(randomFolderName, 'Manage rules');
|
||||
|
||||
await nodesPage.toolbar.clickCreateRuleButton();
|
||||
await nodesPage.manageRulesDialog.typeRuleName(randomRuleName);
|
||||
await nodesPage.manageRulesDialog.ruleNameInputLocator.type(randomRuleName);
|
||||
await nodesPage.conditionsDropdown.addCondition(Field.Size, Comparator.Equals, specialChars, 0);
|
||||
await nodesPage.conditionsDropdown.addCondition(Field.Size, Comparator.Equals, specialChars, 1);
|
||||
await nodesPage.conditionsDropdown.createConditionGroup();
|
||||
await nodesPage.conditionsDropdown.addConditionGroupButton.click();
|
||||
await nodesPage.conditionsDropdown.addConditionGroup(Field.Size, Comparator.Equals, specialChars, 0);
|
||||
await nodesPage.conditionsDropdown.addConditionGroup(Field.Size, Comparator.Equals, specialChars, 1);
|
||||
await nodesPage.actionsDropdown.selectAction(ActionType.IncrementCounter, 0);
|
@@ -22,29 +22,30 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { test } from '../fixtures/page-initialization';
|
||||
import { getUserState, test } from '@alfresco/playwright-shared';
|
||||
|
||||
test.use({ storageState: getUserState('admin') });
|
||||
test.describe('Rules - Manage Rules', () => {
|
||||
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 ({ apiClient }) => {
|
||||
const node = await apiClient.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder', relativePath: '/' });
|
||||
folderId = node.entry.id;
|
||||
await apiClient.createRandomRule(folderId, randomRuleName);
|
||||
await superAdminApiClient.createRandomRule(folderId, randomRuleName);
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ personalFiles }) => {
|
||||
await personalFiles.navigate();
|
||||
});
|
||||
|
||||
test.afterAll(async ({ apiClient }) => {
|
||||
await apiClient.nodes.deleteNode(folderId);
|
||||
test.afterAll(async ({ superAdminApiClient }) => {
|
||||
await superAdminApiClient.nodes.deleteNode(folderId);
|
||||
});
|
||||
|
||||
test('Disable an existing rule', async ({ personalFiles, nodesPage }) => {
|
||||
test('[C691651] Disable an existing rule', async ({ personalFiles, nodesPage }) => {
|
||||
await personalFiles.dataTable.performActionFromExpandableMenu(randomName, 'Manage rules');
|
||||
await nodesPage.manageRules.disableRuleToggle.click();
|
||||
});
|
15
e2e/playwright/folder-rules/tsconfig.e2e.adf.json
Normal file
15
e2e/playwright/folder-rules/tsconfig.e2e.adf.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.adf.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"types": ["jasmine", "jasminewd2", "node"],
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
12
e2e/playwright/folder-rules/tsconfig.e2e.json
Executable file
12
e2e/playwright/folder-rules/tsconfig.e2e.json
Executable file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
|
||||
"skipLibCheck": true,
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
@@ -1,138 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
AdminTenantsApi,
|
||||
AdminUsersApi,
|
||||
AlfrescoApi,
|
||||
ContentClient,
|
||||
GroupsApi,
|
||||
NodesApi,
|
||||
PeopleApi,
|
||||
QueriesApi,
|
||||
SearchApi,
|
||||
SecurityGroupsApi,
|
||||
SecurityMarksApi,
|
||||
SitesApi,
|
||||
UploadApi
|
||||
} from '@alfresco/js-api';
|
||||
import { users } from '../page-objects';
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
import { ActionTypes, Rule } from './rules-api';
|
||||
|
||||
export interface AcaBackend {
|
||||
sites: SitesApi;
|
||||
upload: UploadApi;
|
||||
nodes: NodesApi;
|
||||
|
||||
tearDown(): Promise<any>;
|
||||
}
|
||||
|
||||
const config = {
|
||||
authType: process.env.APP_CONFIG_AUTH_TYPE,
|
||||
hostBpm: process.env.APP_CONFIG_BPM_HOST,
|
||||
hostEcm: process.env.APP_CONFIG_ECM_HOST,
|
||||
provider: process.env.APP_CONFIG_PROVIDER,
|
||||
contextRoot: 'alfresco'
|
||||
};
|
||||
|
||||
export class ApiClientFactory {
|
||||
public alfrescoApi: AlfrescoApi;
|
||||
public sites: SitesApi;
|
||||
public upload: UploadApi;
|
||||
public nodes: NodesApi;
|
||||
public people: PeopleApi;
|
||||
public adminUsers: AdminUsersApi;
|
||||
public adminTenant: AdminTenantsApi;
|
||||
public groups: GroupsApi;
|
||||
public queries: QueriesApi;
|
||||
public search: SearchApi;
|
||||
public securityGroupsApi: SecurityGroupsApi;
|
||||
public securityMarksApi: SecurityMarksApi;
|
||||
public contentClient: ContentClient;
|
||||
|
||||
constructor() {
|
||||
this.alfrescoApi = new AlfrescoApi(config);
|
||||
}
|
||||
|
||||
public async setUpAcaBackend(userProfile: keyof typeof users): Promise<AcaBackend> {
|
||||
await this.login(userProfile);
|
||||
|
||||
this.sites = new SitesApi(this.alfrescoApi);
|
||||
this.upload = new UploadApi(this.alfrescoApi);
|
||||
this.nodes = new NodesApi(this.alfrescoApi);
|
||||
this.people = new PeopleApi(this.alfrescoApi);
|
||||
this.adminUsers = new AdminUsersApi(this.alfrescoApi);
|
||||
this.adminTenant = new AdminTenantsApi(this.alfrescoApi);
|
||||
this.groups = new GroupsApi(this.alfrescoApi);
|
||||
this.queries = new QueriesApi(this.alfrescoApi);
|
||||
this.search = new SearchApi(this.alfrescoApi);
|
||||
this.securityGroupsApi = new SecurityGroupsApi(this.alfrescoApi);
|
||||
this.securityMarksApi = new SecurityMarksApi(this.alfrescoApi);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
async tearDown(): Promise<ApiClientFactory> {
|
||||
await this.alfrescoApi.logout();
|
||||
return this;
|
||||
}
|
||||
|
||||
private callApi(path: string, httpMethod: string, body: object = {}): Promise<any> {
|
||||
// APIs used by this service are still private and not yet available for public use
|
||||
const params = [{}, {}, {}, {}, body, ['application/json'], ['application/json']];
|
||||
return this.alfrescoApi.contentPrivateClient.callApi(path, httpMethod, ...params);
|
||||
}
|
||||
|
||||
async createRule(nodeId: string, rule: Partial<Rule>, ruleSetId: string = '-default-'): Promise<Rule> {
|
||||
const response = await this.callApi(`/nodes/${nodeId}/rule-sets/${ruleSetId}/rules`, 'POST', { ...rule });
|
||||
return response.entry;
|
||||
}
|
||||
|
||||
async createRandomRule(folderId: string, ruleName: string): Promise<Rule> {
|
||||
const response = await this.createRule(folderId, {
|
||||
name: ruleName,
|
||||
isEnabled: true,
|
||||
actions: [ActionTypes.ADDFEATURES.value, ActionTypes.CHECKIN.value]
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
async login(userProfile: keyof typeof users) {
|
||||
const userToLog =
|
||||
users[
|
||||
Object.keys(users)
|
||||
.filter((user) => user.match(new RegExp(`^${userProfile.toString()}$`)))
|
||||
.toString()
|
||||
] || userProfile;
|
||||
let e: any;
|
||||
|
||||
try {
|
||||
e = await this.alfrescoApi.login(userToLog.username, userToLog.password);
|
||||
} catch (error) {
|
||||
logger.error(`[API Client Factory] Log in user ${userToLog.username} failed ${e}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './rules-api';
|
||||
export * from './api-client-factory';
|
@@ -1,72 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
type RuleTrigger = 'inbound' | 'update' | 'outbound';
|
||||
|
||||
export interface RuleCompositeCondition {
|
||||
inverted: boolean;
|
||||
booleanMode: 'and' | 'or';
|
||||
compositeConditions: RuleCompositeCondition[];
|
||||
simpleConditions: RuleSimpleCondition[];
|
||||
}
|
||||
|
||||
export interface RuleSimpleCondition {
|
||||
field: string;
|
||||
comparator: string;
|
||||
parameter: string;
|
||||
}
|
||||
|
||||
export interface Rule {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
isEnabled: boolean;
|
||||
isInheritable: boolean;
|
||||
isAsynchronous: boolean;
|
||||
errorScript: string;
|
||||
isShared: boolean;
|
||||
triggers: RuleTrigger[];
|
||||
conditions: RuleCompositeCondition;
|
||||
actions: RuleAction[];
|
||||
}
|
||||
|
||||
export interface RuleAction {
|
||||
actionDefinitionId: string;
|
||||
params?: { [key: string]: unknown };
|
||||
}
|
||||
|
||||
export class ActionTypes {
|
||||
static ADDFEATURES = new ActionTypes('ADDFEATURES', {
|
||||
actionDefinitionId: 'add-features',
|
||||
params: { 'aspect-name': 'cm:thumbnailed' }
|
||||
});
|
||||
static CHECKIN = new ActionTypes('CHECKIN', {
|
||||
actionDefinitionId: 'check-in',
|
||||
params: {
|
||||
description: 'test',
|
||||
minorChange: true
|
||||
}
|
||||
});
|
||||
constructor(public key: string, public value: RuleAction) {}
|
||||
}
|
@@ -1,62 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { chromium, FullConfig } from '@playwright/test';
|
||||
import { LoginPage } from '../page-objects';
|
||||
import fs from 'fs';
|
||||
|
||||
const E2E_HOST = process.env.PLAYWRIGHT_E2E_HOST;
|
||||
const E2E_PORT = process.env.PLAYWRIGHT_E2E_PORT;
|
||||
const acsAdminUser = process.env.ADMIN_EMAIL;
|
||||
const acsAdminUserPassword = process.env.ADMIN_PASSWORD;
|
||||
|
||||
async function globalSetup(config: FullConfig) {
|
||||
const { use } = config.projects[0];
|
||||
|
||||
let baseUrl: string;
|
||||
|
||||
if (use.baseURL) {
|
||||
baseUrl = use.baseURL;
|
||||
} else {
|
||||
if (E2E_HOST?.match(/localhost/)) {
|
||||
baseUrl = `${E2E_HOST}:${E2E_PORT}`;
|
||||
} else {
|
||||
baseUrl = E2E_HOST;
|
||||
}
|
||||
}
|
||||
|
||||
const browser = await chromium.launch({
|
||||
args: ['--disable-web-security']
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
const loginPage = new LoginPage(page);
|
||||
|
||||
fs.mkdirSync(`./storage-state`, { recursive: true });
|
||||
await page.goto(baseUrl);
|
||||
await loginPage.loginUser({ username: acsAdminUser, password: acsAdminUserPassword }, { withNavigation: false, waitForLoading: true });
|
||||
await page.context().storageState({ path: `./storage-state/AdminUserState.json` });
|
||||
await browser.close();
|
||||
}
|
||||
|
||||
export default globalSetup;
|
@@ -1,25 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './global.setup';
|
@@ -1,28 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './api';
|
||||
export * from './base-config';
|
||||
export * from './models';
|
||||
export * from './page-objects';
|
@@ -1,25 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './user-model';
|
@@ -1,60 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
|
||||
const LOWER_CASE_ALPHA = 'helloworld';
|
||||
export class UserModel {
|
||||
firstName?: string = StringUtil.generateRandomCharset(length, LOWER_CASE_ALPHA)(7);
|
||||
lastName?: string = StringUtil.generateRandomCharset(length, LOWER_CASE_ALPHA)(7);
|
||||
password?: string = StringUtil.generateRandomCharset(length, LOWER_CASE_ALPHA)(7);
|
||||
email?: string;
|
||||
username?: string;
|
||||
idIdentityService?: string;
|
||||
type = 'enterprise';
|
||||
tenantId?: number;
|
||||
company?: string;
|
||||
id: number;
|
||||
|
||||
constructor(details: any = {}) {
|
||||
const EMAIL_DOMAIN = 'alfresco';
|
||||
this.firstName = details.firstName ?? this.firstName;
|
||||
this.lastName = details.lastName ?? this.lastName;
|
||||
|
||||
const USER_IDENTIFY = `${this.firstName}${this.lastName}.${StringUtil.generateRandomCharset(length, LOWER_CASE_ALPHA)(7)}`;
|
||||
|
||||
this.password = details.password ?? this.password;
|
||||
this.email = details.email ?? `${USER_IDENTIFY}@${EMAIL_DOMAIN}.com`;
|
||||
this.username = details.username ?? USER_IDENTIFY;
|
||||
this.idIdentityService = details.idIdentityService ?? this.idIdentityService;
|
||||
this.type = details.type ?? this.type;
|
||||
this.tenantId = details.tenantId ?? this.tenantId;
|
||||
this.company = details.company ?? this.company;
|
||||
this.id = details.id ?? this.id;
|
||||
}
|
||||
|
||||
get fullName(): string {
|
||||
return `${this.firstName ?? ''} ${this.lastName ?? ''}`;
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"name": "playwright-shared",
|
||||
"version": "3.0.0",
|
||||
"main": "index.ts",
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
import { PlaywrightBase } from '../playwright-base';
|
||||
|
||||
export abstract class BaseComponent extends PlaywrightBase {
|
||||
private readonly rootElement: string;
|
||||
private overlayElement = this.page.locator('.cdk-overlay-backdrop-showing');
|
||||
|
||||
protected constructor(page: Page, rootElement: string) {
|
||||
super(page);
|
||||
this.rootElement = rootElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which should be used across the repository, while creating
|
||||
* reference to elements, which are in root element of component.
|
||||
*
|
||||
* @param cssLocator css selector as String. Need to be in the tree under the root element
|
||||
* @param options if you want to localize it by text, then provide an optional hasText
|
||||
* @returns Locator object
|
||||
*/
|
||||
getChild(cssLocator: string, options?: { hasText?: string | RegExp; has?: Locator }): Locator {
|
||||
return this.page.locator(`${this.rootElement} ${cssLocator}`, options);
|
||||
}
|
||||
|
||||
async closeAdditionalOverlayElementIfVisible(): Promise<void> {
|
||||
if (await this.overlayElement.isVisible()) {
|
||||
await this.page.keyboard.press('Escape');
|
||||
await this.overlayElement.waitFor({ state: 'detached', timeout: 5000 });
|
||||
}
|
||||
}
|
||||
|
||||
async spinnerWaitForReload(): Promise<void> {
|
||||
try {
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: 2000 });
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'detached', timeout: 2000 });
|
||||
} catch (e) {
|
||||
this.logger.info('Spinner was not present');
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,183 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
import { MatMenuComponent } from './mat-menu.component';
|
||||
import { PaginationActionsType, PaginationComponent } from '../pagination.component';
|
||||
|
||||
export class DataTableComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-datatable';
|
||||
contextMenuActions = new MatMenuComponent(this.page);
|
||||
|
||||
constructor(page: Page, rootElement = DataTableComponent.rootElement) {
|
||||
super(page, rootElement);
|
||||
}
|
||||
|
||||
public pagination = new PaginationComponent(this.page);
|
||||
getEmptyFolderLocator = this.getChild('.adf-empty-folder');
|
||||
getEmptyContentTitleLocator = this.getChild('adf-empty-content .adf-empty-content__title');
|
||||
getEmptyContentSubTitleLocator = this.getChild('adf-empty-content .adf-empty-content__subtitle');
|
||||
|
||||
/** Locator for row (or rows) */
|
||||
getRowLocator = this.getChild(`adf-datatable-row`);
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to check that some record is visible in the datatable. It will consider whole row
|
||||
*
|
||||
* @returns reference to cell element which contains text.
|
||||
*/
|
||||
getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to check that some record is visible in the datatable.
|
||||
* But we want to check it by column header title and value of this column.
|
||||
*
|
||||
* @returns reference to cell element which contains text.
|
||||
*/
|
||||
getRowByColumnTitleAndItsCellValue = (columnTitle: string, cellValue: string | number): Locator =>
|
||||
this.page.locator(`//div[contains(@title, '${columnTitle}')]//span[contains(text(), '${cellValue}')]/ancestor::adf-datatable-row`);
|
||||
|
||||
/**
|
||||
* Method used in cases where user have possibility to navigate "inside" the element (it's clickable and has link attribute).
|
||||
* Perform action .click() to navigate inside it
|
||||
*
|
||||
* @returns reference to cell element which contains link.
|
||||
*/
|
||||
getCellLinkByName = (name: string): Locator => this.getChild('.adf-datatable-cell-value[role="link"]', { hasText: name });
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to localize the element by [aria-label]
|
||||
*
|
||||
* @returns reference to cell element.
|
||||
*/
|
||||
getByAriaLabelTitle = (title: string): Locator => this.getChild(`[aria-label="${title}"]`);
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to get the button (hamburger menu) for row element
|
||||
*
|
||||
* @returns reference to menu placed in row localized by the name
|
||||
*/
|
||||
getActionsButtonByName = (name: string): Locator =>
|
||||
this.getRowByName(name).locator('mat-icon', { hasText: new RegExp(`^\\s*more_vert\\s*$`, 'g') });
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to get the edit button and there is no hamburger menu
|
||||
*
|
||||
* @returns reference to edit button placed in row localized by the name
|
||||
*/
|
||||
getEditButtonByName = (name: string): Locator => this.getRowByName(name).locator('button#editButton');
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to get the button and there is no hamburger menu
|
||||
*
|
||||
* @returns reference to button placed in row localized by the name
|
||||
*/
|
||||
getButtonByNameForSpecificRow = (elementTitleInRow: string, buttonTitle: string): Locator =>
|
||||
this.getRowByName(elementTitleInRow).locator('button', { hasText: buttonTitle });
|
||||
|
||||
/**
|
||||
* Method used in cases where you want to get some specific cell (by column name) for row which contains some name/title/etc.
|
||||
*
|
||||
* @returns reference to cell element
|
||||
*/
|
||||
getCellByColumnNameAndRowItem = (item: string | number, columnName: string): Locator => this.getRowByName(item).locator(`[title="${columnName}"]`);
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to get the checkbox for row element
|
||||
*
|
||||
* @returns reference to checkbox placed in row localized by the name
|
||||
*/
|
||||
getCheckboxForElement = (item: string): Locator => this.getRowByName(item).locator('mat-checkbox');
|
||||
|
||||
getColumnHeaderByTitleLocator = (headerTitle: string): Locator => this.getChild('[role="columnheader"]', { hasText: headerTitle });
|
||||
|
||||
async sortBy(columnTitle: string, order: 'Ascending' | 'Descending'): Promise<void> {
|
||||
const columnHeaderLocator = this.getColumnHeaderByTitleLocator(columnTitle);
|
||||
await this.spinnerWaitForReload();
|
||||
await columnHeaderLocator.click();
|
||||
|
||||
const sortAttribute = await columnHeaderLocator.getAttribute('aria-sort');
|
||||
if (sortAttribute !== order) {
|
||||
await columnHeaderLocator.click();
|
||||
}
|
||||
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used when we want to perform right mouse click on the dataTable row and perform some action
|
||||
*
|
||||
* @param name of the data table element with which we want to click
|
||||
* @param action provide which action you want to perform
|
||||
*/
|
||||
async performActionFromExpandableMenu(name: string | number, action: string): Promise<void> {
|
||||
await this.goThroughPagesLookingForRowWithName(name);
|
||||
const actionButtonLocator = await this.getActionLocatorFromExpandableMenu(name, action);
|
||||
await actionButtonLocator.click();
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Click action from the expandable kebab menu for the element in datatable
|
||||
*
|
||||
* @param name title of the record you would like to proceed
|
||||
* @param action provide button title for the action
|
||||
* @param subAction if the action is in sub menu, then provide it here
|
||||
*/
|
||||
async performActionForElement(name: string, action: string, subAction?: string): Promise<void> {
|
||||
await this.getActionsButtonByName(name).click();
|
||||
await this.contextMenuActions.getButtonByText(action).click();
|
||||
|
||||
if (subAction) {
|
||||
await this.contextMenuActions.getButtonByText(subAction).click();
|
||||
}
|
||||
}
|
||||
|
||||
async getActionLocatorFromExpandableMenu(name: string | number, action: string): Promise<Locator> {
|
||||
await this.getRowByName(name).click({ button: 'right' });
|
||||
return this.contextMenuActions.getButtonByText(action);
|
||||
}
|
||||
|
||||
async goThroughPagesLookingForRowWithName(name: string | number): Promise<void> {
|
||||
await this.spinnerWaitForReload();
|
||||
if (await this.getRowByName(name).isVisible()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((await this.pagination.currentPageLocator.textContent()) !== ' Page 1 ') {
|
||||
await this.pagination.navigateToPage(1);
|
||||
}
|
||||
|
||||
const maxPages = (await this.pagination.totalPageLocator.textContent()).match(/\d/)[0];
|
||||
for (let page = 1; page <= Number(maxPages); page++) {
|
||||
if (await this.getRowByName(name).isVisible()) {
|
||||
break;
|
||||
}
|
||||
await this.pagination.getArrowLocatorFor(PaginationActionsType.NextPageSelector).isEnabled();
|
||||
await this.pagination.getArrowLocatorFor(PaginationActionsType.NextPageSelector).click();
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './data-table.component';
|
||||
export * from './mat-menu.component';
|
||||
export * from './toolbar.component';
|
@@ -1,27 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './base.component';
|
||||
export * from './snack-bar.component';
|
||||
export * from './spinner.component';
|
@@ -1,39 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from './base.component';
|
||||
|
||||
export class MatMenuComponent extends BaseComponent {
|
||||
private static rootElement = '.mat-menu-content';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, MatMenuComponent.rootElement);
|
||||
}
|
||||
|
||||
public getMenuItemsLocator = this.getChild('button');
|
||||
public getMenuItemTextLocator = this.getChild('[data-automation-id="menu-item-title"]');
|
||||
|
||||
public getButtonByText = (text: string) => this.getChild('button', { hasText: text });
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BaseComponent } from './base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
import { MatMenuComponent } from './mat-menu.component';
|
||||
|
||||
export enum PaginationActionsType {
|
||||
PageSizeSelector = 'Page size selector',
|
||||
CurrentPageSelector = 'Current page selector',
|
||||
NextPageSelector = 'Next page button'
|
||||
}
|
||||
|
||||
export class PaginationComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-pagination';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, PaginationComponent.rootElement);
|
||||
}
|
||||
|
||||
private itemsPerPageMenu = new MatMenuComponent(this.page);
|
||||
|
||||
public currentPageLocator = this.getChild('.adf-pagination__current-page');
|
||||
public totalPageLocator = this.getChild('.adf-pagination__total-pages');
|
||||
public getArrowLocatorFor = (action: PaginationActionsType) => this.getChild(`[aria-label="${action}"]`);
|
||||
|
||||
async setItemsPerPage(amount: number): Promise<void> {
|
||||
await this.getArrowLocatorFor(PaginationActionsType.PageSizeSelector).click();
|
||||
await this.itemsPerPageMenu.getButtonByText(amount.toString()).click();
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
|
||||
async navigateToPage(pageNumber: number): Promise<void> {
|
||||
await this.getArrowLocatorFor(PaginationActionsType.CurrentPageSelector).click();
|
||||
await this.itemsPerPageMenu.getButtonByText(pageNumber.toString()).click();
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
|
||||
async spinnerWaitForReload(): Promise<void> {
|
||||
try {
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: 2000 });
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'detached', timeout: 2000 });
|
||||
} catch (e) {
|
||||
this.logger.info('Spinner was not present');
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from './base.component';
|
||||
|
||||
export class SnackBarComponent extends BaseComponent {
|
||||
private static rootElement = 'simple-snack-bar';
|
||||
|
||||
public message = this.getChild(' > span');
|
||||
public getByMessageLocator = (message: string) => this.getChild('span', { hasText: message });
|
||||
|
||||
constructor(page: Page, rootElement = SnackBarComponent.rootElement) {
|
||||
super(page, rootElement);
|
||||
}
|
||||
}
|
@@ -1,43 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from './base.component';
|
||||
|
||||
export class SpinnerComponent extends BaseComponent {
|
||||
private static rootElement = 'mat-progress-spinner';
|
||||
|
||||
constructor(page: Page, rootElement = SpinnerComponent.rootElement) {
|
||||
super(page, rootElement);
|
||||
}
|
||||
|
||||
async waitForReload(): Promise<void> {
|
||||
try {
|
||||
await this.getChild('').waitFor({ state: 'attached', timeout: 2000 });
|
||||
await this.getChild('').waitFor({ state: 'detached', timeout: 2000 });
|
||||
} catch (e) {
|
||||
this.logger.info('Spinner was not present');
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,53 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const env = process.env;
|
||||
|
||||
export const testEmailDomain = env.E2E_EMAIL_DOMAIN;
|
||||
export const users = {
|
||||
superadmin: {
|
||||
username: env.SUPERADMIN_EMAIL,
|
||||
password: env.SUPERADMIN_PASSWORD
|
||||
},
|
||||
identity: {
|
||||
username: env.IDENTITY_USER_EMAIL,
|
||||
password: env.IDENTITY_USER_PASSWORD
|
||||
},
|
||||
hruser: {
|
||||
username: env.HR_USER,
|
||||
password: env.HR_USER_PASSWORD
|
||||
},
|
||||
salesuser: {
|
||||
username: env.SALES_USER,
|
||||
password: env.SALES_USER_PASSWORD
|
||||
},
|
||||
admin: {
|
||||
username: env.ADMIN_EMAIL,
|
||||
password: env.ADMIN_PASSWORD
|
||||
},
|
||||
contentIdentity: {
|
||||
username: env.CONTENT_IDENTITY_USERNAME,
|
||||
password: env.CONTENT_IDENTITY_PASSWORD
|
||||
}
|
||||
};
|
@@ -1,29 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './global-variables';
|
||||
export * from './playwright-base';
|
||||
export * from './components';
|
||||
export * from './components/dataTable';
|
||||
export * from './pages';
|
@@ -1,96 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { PlaywrightBase } from '../playwright-base';
|
||||
import { SnackBarComponent, SpinnerComponent } from '../components';
|
||||
|
||||
export interface NavigateOptions {
|
||||
query?: string;
|
||||
waitForRequest?: boolean;
|
||||
waitUntil?: 'networkidle' | 'commit' | 'load' | 'domcontentloaded';
|
||||
remoteUrl?: string;
|
||||
}
|
||||
export abstract class BasePage extends PlaywrightBase {
|
||||
private readonly pageUrl: string;
|
||||
private readonly urlRequest: RegExp;
|
||||
public snackBar: SnackBarComponent;
|
||||
public spinner: SpinnerComponent;
|
||||
|
||||
protected constructor(page: Page, pageUrl: string, urlRequest?: RegExp) {
|
||||
super(page);
|
||||
this.pageUrl = pageUrl;
|
||||
this.urlRequest = urlRequest;
|
||||
this.snackBar = new SnackBarComponent(this.page);
|
||||
this.spinner = new SpinnerComponent(this.page);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which navigate to appropriate page or remoteURL
|
||||
*
|
||||
* @param options object with configurable options
|
||||
* @property {string} query if you would like to navigate to page which support query,
|
||||
* then pass it in this option - e.g. '?appName=content'
|
||||
* @property {boolean} waitForRequest if you would like to NOT wait for request (which need to be passed
|
||||
* in the constructor of the page), then pass false. By default it'll wait for request to be fulfilled.
|
||||
* @property {'networkidle' | 'commit' | 'load' | 'domcontentloaded'} waitUntil by default will wait until 'networkidle' but you can change it if needed
|
||||
* @property {string} remoteUrl if you need to navigate to third part site, then you need to pass all of the URL in this option
|
||||
*/
|
||||
async navigate(options?: Partial<NavigateOptions>): Promise<void> {
|
||||
const actualOptions: NavigateOptions = {
|
||||
query: '',
|
||||
waitForRequest: true,
|
||||
remoteUrl: '',
|
||||
...options
|
||||
};
|
||||
|
||||
if (actualOptions.remoteUrl) {
|
||||
await this.page.goto(actualOptions.remoteUrl, {
|
||||
waitUntil: actualOptions.waitUntil
|
||||
});
|
||||
} else {
|
||||
if (this.urlRequest && actualOptions.waitForRequest) {
|
||||
await Promise.all([
|
||||
this.page.goto(`./#/${this.pageUrl}${actualOptions.query}`, { waitUntil: 'load' }),
|
||||
this.page.waitForResponse(this.urlRequest)
|
||||
]);
|
||||
} else {
|
||||
await this.page.goto(`./#/${this.pageUrl}${actualOptions.query}`, {
|
||||
waitUntil: actualOptions.waitUntil,
|
||||
timeout: 60000
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await this.spinner.waitForReload();
|
||||
}
|
||||
|
||||
async reload(options?: Pick<NavigateOptions, 'waitUntil'>): Promise<void> {
|
||||
const actualOptions: Pick<NavigateOptions, 'waitUntil'> = {
|
||||
waitUntil: 'networkidle',
|
||||
...options
|
||||
};
|
||||
await this.page.reload(actualOptions);
|
||||
}
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './base.page';
|
||||
export * from './login.page';
|
@@ -1,54 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { BasePage } from './base.page';
|
||||
import { UserModel } from '../../models';
|
||||
|
||||
interface LoginOptions {
|
||||
waitForLoading?: boolean;
|
||||
withNavigation?: boolean;
|
||||
}
|
||||
export class LoginPage extends BasePage {
|
||||
constructor(page: Page) {
|
||||
super(page, '');
|
||||
}
|
||||
|
||||
private username = this.page.locator('#username');
|
||||
private password = this.page.locator('#password');
|
||||
private submitButton = this.page.locator('#login-button');
|
||||
|
||||
async loginUser(userData: { username: string; password: string } | UserModel, options?: LoginOptions): Promise<void> {
|
||||
if (options?.withNavigation) {
|
||||
await this.navigate();
|
||||
}
|
||||
await this.username.fill(userData.username);
|
||||
await this.password.fill(userData.password);
|
||||
await this.submitButton.click();
|
||||
|
||||
if (options?.waitForLoading) {
|
||||
await Promise.all([this.page.waitForLoadState('domcontentloaded'), this.spinner.waitForReload()]);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { GenericLogger, LoggerLike } from '@alfresco/adf-testing';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export abstract class PlaywrightBase {
|
||||
public page: Page;
|
||||
public logger: LoggerLike;
|
||||
|
||||
protected constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.logger = new GenericLogger(process.env.PLAYWRIGHT_CUSTOM_LOG_LEVEL);
|
||||
}
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.e2e.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../out-tsc/playwright-testing",
|
||||
"target": "es2015",
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"importHelpers": true,
|
||||
"lib": ["dom", "es2018"]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
"strictInjectionParameters": true,
|
||||
"enableResourceInlining": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
@@ -1,108 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
import { BaseComponent } from '@alfresco/playwright-shared';
|
||||
|
||||
export enum ActionType {
|
||||
AddAspect = 'Add aspect',
|
||||
SimpleWorkflow = 'Add simple workflow',
|
||||
IncrementCounter = 'Increment Counter',
|
||||
CheckIn = 'Check in',
|
||||
AutoDeclareOptions = 'Auto-Declare Options',
|
||||
CheckOut = 'Check out',
|
||||
Copy = 'Copy',
|
||||
ExecuteScript = 'Execute script',
|
||||
ExtractCommonMetadataFields = 'Extract common metadata fields',
|
||||
FileAsRecord = 'File as Record',
|
||||
FileVersionAsRecord = 'File Version as Record',
|
||||
HideRecord = 'Hide Record',
|
||||
Import = 'Import',
|
||||
Move = 'Move',
|
||||
RemoveAspect = 'Remove aspect',
|
||||
RequestAIRenditions = 'Request AI renditions',
|
||||
SendEmail = 'Send email',
|
||||
SetPropertyValue = 'Set property value',
|
||||
SpecialiseType = 'Specialise type',
|
||||
TransformAndCopyContent = 'Transform and copy content',
|
||||
TransformAndCopyImage = 'Transform and copy image'
|
||||
}
|
||||
|
||||
export class ActionsDropdownComponent extends BaseComponent {
|
||||
private static rootElement = 'aca-rule-action-list';
|
||||
|
||||
private getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-select-panel .mat-option-text', { hasText: optionName });
|
||||
private ruleActionLocator = this.getChild('aca-rule-action [data-automation-id="rule-action-card-view"]');
|
||||
private addActionButtonLocator = this.getChild('[data-automation-id="rule-action-list-add-action-button"]');
|
||||
private actionDropdownLocator = this.getChild('[data-automation-id="rule-action-select"]');
|
||||
private actionAspectNameLocator = '[data-automation-id="header-aspect-name"] mat-select';
|
||||
private actionCheckInInputLocator = '[data-automation-id="header-description"] input';
|
||||
private actionAutoDeclareLocator = '[data-automation-id="header-version"] mat-select';
|
||||
private actionSimpleWorkflowStepInputLocator = '[data-automation-id="header-approve-step"] input';
|
||||
private actionSimpleWorkflowApproveFolderLocator = `[data-automation-id="header-approve-folder"] input`;
|
||||
private actionSimpleWorkflowActionChoiceLocator = '[data-automation-id="content-node-selector-actions-choose"]';
|
||||
private actionSimpleWorkflowLabelApproveLocator = `[data-automation-id="card-boolean-label-approve-move"]`;
|
||||
private actionSimpleWorkflowSRejectStepLocator = '[data-automation-id="header-reject-step"] input';
|
||||
private actionSimpleWorkflowRejectFolderLocator = `[data-automation-id="header-reject-folder"] input`;
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, ActionsDropdownComponent.rootElement);
|
||||
}
|
||||
|
||||
async selectAction(action: Partial<ActionType>, index: number): Promise<void> {
|
||||
if (index > 0) {
|
||||
await this.addActionButtonLocator.click();
|
||||
}
|
||||
await this.actionDropdownLocator.nth(index).click();
|
||||
const option = this.getOptionLocator(action);
|
||||
await option.nth(0).click();
|
||||
}
|
||||
|
||||
async dropdownSelection(selectValue: string, locator: string, index: number): Promise<void> {
|
||||
await this.ruleActionLocator.nth(index).locator(locator).click();
|
||||
await this.getOptionLocator(selectValue).nth(0).click();
|
||||
}
|
||||
|
||||
async insertCheckInActionValues(checkInValue: string, index: number): Promise<void> {
|
||||
await this.ruleActionLocator.nth(index).locator(this.actionCheckInInputLocator).type(checkInValue, { delay: 50 });
|
||||
}
|
||||
|
||||
async insertAddAspectActionValues(AspectValue: string, index: number): Promise<void> {
|
||||
await this.dropdownSelection(AspectValue, this.actionAspectNameLocator, index);
|
||||
}
|
||||
|
||||
async insertAutoDeclareOptionsActionValues(autoDeclareOptionsValue: string, index: number): Promise<void> {
|
||||
await this.dropdownSelection(autoDeclareOptionsValue, this.actionAutoDeclareLocator, index);
|
||||
}
|
||||
|
||||
async insertSimpleWorkflowActionValues(stepValue: string, index: number): Promise<void> {
|
||||
await this.ruleActionLocator.nth(index).locator(this.actionSimpleWorkflowStepInputLocator).type(stepValue, { delay: 50 });
|
||||
await this.ruleActionLocator.nth(index).locator(this.actionSimpleWorkflowApproveFolderLocator).click();
|
||||
await this.page.locator(this.actionSimpleWorkflowActionChoiceLocator).click();
|
||||
await this.ruleActionLocator.nth(index).locator(this.actionSimpleWorkflowLabelApproveLocator).click();
|
||||
await this.ruleActionLocator.nth(index).locator(this.actionSimpleWorkflowSRejectStepLocator).type(stepValue, { delay: 50 });
|
||||
await this.ruleActionLocator.nth(index).locator(this.actionSimpleWorkflowRejectFolderLocator).click();
|
||||
await this.page.locator(this.actionSimpleWorkflowActionChoiceLocator).click();
|
||||
}
|
||||
}
|
@@ -1,77 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
import { ManageRulesDialogComponent } from './manage-rules-dialog.component';
|
||||
|
||||
export enum Field {
|
||||
Name = 'Name',
|
||||
Size = 'Size',
|
||||
Mimetype = 'Mimetype'
|
||||
}
|
||||
|
||||
export enum Comparator {
|
||||
Equals = '(=) Equals',
|
||||
Contains = 'Contains',
|
||||
StartsWith = 'Starts with',
|
||||
EndsWith = 'Ends with'
|
||||
}
|
||||
|
||||
export class ConditionComponent extends ManageRulesDialogComponent {
|
||||
private getOptionLocator = (optionName: string): Locator => this.page.locator(`.cdk-overlay-pane .mat-option span`, { hasText: optionName });
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page);
|
||||
}
|
||||
|
||||
private async selectField(fields: Partial<Field>, index: number): Promise<void> {
|
||||
await this.fieldDropDown.nth(index).click();
|
||||
const option = this.getOptionLocator(fields);
|
||||
await option.click();
|
||||
}
|
||||
|
||||
private async selectComparator(comparators: Partial<Comparator>, index: number): Promise<void> {
|
||||
await this.comparatorDropDown.nth(index).click();
|
||||
const option = this.getOptionLocator(comparators);
|
||||
await option.click();
|
||||
}
|
||||
|
||||
async addCondition(fields: Partial<Field>, comparators: Partial<Comparator>, value: string, index: number): Promise<void> {
|
||||
await this.addConditionButton.click();
|
||||
await this.selectField(fields, index);
|
||||
await this.selectComparator(comparators, index);
|
||||
await this.typeConditionValue(value, index);
|
||||
}
|
||||
|
||||
async createConditionGroup(): Promise<void> {
|
||||
await this.addConditionGroupButton.click();
|
||||
}
|
||||
|
||||
async addConditionGroup(fields: Partial<Field>, comparators: Partial<Comparator>, value: string, index: number): Promise<void> {
|
||||
await this.addConditionButton.nth(0).click();
|
||||
await this.selectField(fields, index);
|
||||
await this.selectComparator(comparators, index);
|
||||
await this.typeConditionValue(value, index);
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BaseComponent } from '@alfresco/playwright-shared';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class ManageRulesDialogComponent extends BaseComponent {
|
||||
private static rootElement = 'aca-edit-rule-dialog';
|
||||
|
||||
public createRuleButton = this.getChild('[data-automation-id="edit-rule-dialog-submit"]');
|
||||
private ruleNameInputLocator = this.getChild('[id="rule-details-name-input"]');
|
||||
public addConditionButton = this.getChild('[data-automation-id="add-condition-button"]');
|
||||
public addConditionGroupButton = this.getChild('[data-automation-id="add-group-button"]');
|
||||
public fieldDropDown = this.getChild('[data-automation-id="field-select"]');
|
||||
public comparatorDropDown = this.getChild('[data-automation-id="comparator-select"]');
|
||||
private valueField = this.getChild('[data-automation-id="value-input"]');
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, ManageRulesDialogComponent.rootElement);
|
||||
}
|
||||
|
||||
async typeRuleName(ruleName: string): Promise<void> {
|
||||
await this.ruleNameInputLocator.type(ruleName, { delay: 50 });
|
||||
}
|
||||
|
||||
async typeConditionValue(ruleName: string, index: number): Promise<void> {
|
||||
await this.valueField.nth(index).type(ruleName, { delay: 50 });
|
||||
}
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
import { BaseComponent } from '@alfresco/playwright-shared';
|
||||
|
||||
export class ManageRules extends BaseComponent {
|
||||
private static rootElement = '.aca-manage-rules';
|
||||
|
||||
public getGroupsList = (optionName: string): Locator => this.getChild('.aca-rule-list-item__header', { hasText: optionName });
|
||||
public disableRuleToggle = this.getChild('.aca-manage-rules__container .mat-slide-toggle-bar').first();
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, ManageRules.rootElement);
|
||||
}
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from './pages/personal-files.page';
|
||||
export * from './pages/nodes.page';
|
@@ -1,44 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BasePage, ToolbarComponent } from '@alfresco/playwright-shared';
|
||||
import { Page } from '@playwright/test';
|
||||
import { ManageRulesDialogComponent } from '../components/manage-rules-dialog.component';
|
||||
import { ActionsDropdownComponent } from '../components/actions-dropdown.component';
|
||||
import { ConditionComponent } from '../components/conditions.component';
|
||||
import { ManageRules } from '../components/manage-rules.component';
|
||||
|
||||
export class NodesPage extends BasePage {
|
||||
private static pageUrl = 'nodes';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, NodesPage.pageUrl);
|
||||
}
|
||||
|
||||
public toolbar = new ToolbarComponent(this.page);
|
||||
public manageRulesDialog = new ManageRulesDialogComponent(this.page);
|
||||
public actionsDropdown = new ActionsDropdownComponent(this.page);
|
||||
public conditionsDropdown = new ConditionComponent(this.page);
|
||||
public manageRules = new ManageRules(this.page);
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BasePage, DataTableComponent } from '@alfresco/playwright-shared';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class PersonalFilesPage extends BasePage {
|
||||
private static pageUrl = 'personal-files';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, PersonalFilesPage.pageUrl);
|
||||
}
|
||||
|
||||
public dataTable = new DataTableComponent(this.page);
|
||||
}
|
@@ -1,76 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
export const config: PlaywrightTestConfig = {
|
||||
testDir: './',
|
||||
expect: {
|
||||
/**
|
||||
* Maximum time expect() should wait for the condition to be met.
|
||||
* For example in `await expect(locator).toHaveText();`
|
||||
*/
|
||||
timeout: 10000
|
||||
},
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: 5,
|
||||
timeout: 40000,
|
||||
|
||||
globalSetup: require.resolve('../../shared/base-config/global.setup'),
|
||||
use: {
|
||||
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
||||
storageState: './storage-state/AdminUserState.json',
|
||||
actionTimeout: 0,
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: process.env.PLAYWRIGHT_E2E_HOST,
|
||||
ignoreHTTPSErrors: true,
|
||||
bypassCSP: true,
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry',
|
||||
launchOptions: {
|
||||
devtools: false,
|
||||
args: ['--disable-web-security', '--no-sandbox', '--disable-site-isolation-trials']
|
||||
}
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: {
|
||||
...devices['Desktop Chrome']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default config;
|
Reference in New Issue
Block a user