mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +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:
parent
e0a74d7fb9
commit
c843a8dbaa
57
.github/actions/run-e2e-playwright/action.yml
vendored
Normal file
57
.github/actions/run-e2e-playwright/action.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
name: "Run e2e Playwright"
|
||||||
|
description: "Run e2e Playwright"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
options:
|
||||||
|
description: 'Options'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
test-runner:
|
||||||
|
description: 'Test runner'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: 'Playwright'
|
||||||
|
artifact-name:
|
||||||
|
description: Name of the artifact cache
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Setup and run with options
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# npx http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}"
|
||||||
|
echo "APP_CONFIG_PLUGIN_FOLDER_RULES=true"
|
||||||
|
echo "APP_CONFIG_PLUGIN_AOS=true"
|
||||||
|
echo "APP_CONFIG_PLUGIN_CONTENT_SERVICE=true"
|
||||||
|
echo "APP_CONFIG_ENABLE_MOBILE_APP_SWITCH=false"
|
||||||
|
echo "APP_CONFIG_PROVIDER=ECM"
|
||||||
|
echo "APP_CONFIG_AUTH_TYPE=BASIC"
|
||||||
|
echo "APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco"
|
||||||
|
echo "APP_CONFIG_OAUTH2_CLIENTID=alfresco"
|
||||||
|
echo "APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS=12"
|
||||||
|
echo "APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true"
|
||||||
|
echo "APP_CONFIG_OAUTH2_SILENT_LOGIN=true"
|
||||||
|
echo "APP_CONFIG_OAUTH2_REDIRECT_LOGOUT=/"
|
||||||
|
echo "APP_CONFIG_OAUTH2_REDIRECT_LOGIN=/"
|
||||||
|
echo "APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI={protocol}//{hostname}{:port}/assets/silent-refresh.html"
|
||||||
|
} >> .env
|
||||||
|
|
||||||
|
npm start > /dev/null &\
|
||||||
|
|
||||||
|
echo "Running playwright tests with options ${{ inputs.options }}"
|
||||||
|
sleep 90
|
||||||
|
npx nx run ${{ inputs.options }}-e2e:e2e
|
||||||
|
|
||||||
|
|
||||||
|
- name: Upload E2Es results
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.artifact-name }}
|
||||||
|
path: test-results/
|
4
.github/actions/run-e2e/action.yml
vendored
4
.github/actions/run-e2e/action.yml
vendored
@ -22,7 +22,7 @@ runs:
|
|||||||
- name: Setup and run with options
|
- name: Setup and run with options
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
./node_modules/.bin/tsc -p "./e2e/$E2E_TSCONFIG" || exit 1;
|
./node_modules/.bin/tsc -p "./e2e/protractor/$E2E_TSCONFIG" || exit 1;
|
||||||
# npx http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
|
# npx http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ runs:
|
|||||||
if [ ${{ inputs.test-runner }} == "playwright" ]; then
|
if [ ${{ inputs.test-runner }} == "playwright" ]; then
|
||||||
echo "Running playwright tests with options ${{ inputs.options }}"
|
echo "Running playwright tests with options ${{ inputs.options }}"
|
||||||
sleep 90
|
sleep 90
|
||||||
npx playwright test --config ${{ inputs.options }}
|
npx nx run ${{ inputs.options }}-e2e:e2e
|
||||||
else
|
else
|
||||||
echo "Running protractor tests with options ${{ inputs.options }}"
|
echo "Running protractor tests with options ${{ inputs.options }}"
|
||||||
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" ${{ inputs.options }} || exit 1"
|
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" ${{ inputs.options }} || exit 1"
|
||||||
|
24
.github/workflows/pull-request.yml
vendored
24
.github/workflows/pull-request.yml
vendored
@ -13,6 +13,14 @@ env:
|
|||||||
APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }}
|
APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }}
|
||||||
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
|
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
|
||||||
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
|
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
|
||||||
|
HR_USER: ${{ secrets.HR_USER }}
|
||||||
|
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
|
||||||
|
SUPERADMIN_EMAIL: ${{ secrets.SUPERADMIN_EMAIL }}
|
||||||
|
SUPERADMIN_PASSWORD: ${{ secrets.SUPERADMIN_PASSWORD }}
|
||||||
|
IDENTITY_USER_EMAIL: ${{ secrets.IDENTITY_USER_EMAIL }}
|
||||||
|
IDENTITY_USER_PASSWORD: ${{ secrets.IDENTITY_USER_PASSWORD }}
|
||||||
|
CONTENT_IDENTITY_USERNAME: ${{ secrets.CONTENT_IDENTITY_USERNAME }}
|
||||||
|
CONTENT_IDENTITY_PASSWORD: ${{ secrets.CONTENT_IDENTITY_PASSWORD }}
|
||||||
SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }}
|
SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }}
|
||||||
SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}}
|
SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}}
|
||||||
AWS_REGION: "eu-west-2"
|
AWS_REGION: "eu-west-2"
|
||||||
@ -177,8 +185,16 @@ jobs:
|
|||||||
|
|
||||||
e2es-playwright:
|
e2es-playwright:
|
||||||
needs: [lint, build, unit-tests]
|
needs: [lint, build, unit-tests]
|
||||||
name: 'E2e test suites: Folder Rules - Playwright'
|
name: 'E2e test suites: Playwright'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
e2e-suites:
|
||||||
|
- name: "actions"
|
||||||
|
id: 1
|
||||||
|
- name: "folder-rules"
|
||||||
|
id: 2
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -203,10 +219,10 @@ jobs:
|
|||||||
- name: before playwright
|
- name: before playwright
|
||||||
shell: bash
|
shell: bash
|
||||||
run: npx playwright install chromium
|
run: npx playwright install chromium
|
||||||
- uses: ./.github/actions/run-e2e
|
- uses: ./.github/actions/run-e2e-playwright
|
||||||
with:
|
with:
|
||||||
options: "e2e/playwright/tests/folder-rules/playwright.config.ts"
|
options: "${{ matrix.e2e-suites.name }}"
|
||||||
artifact-name: folder-rules
|
artifact-name: ${{ matrix.e2e-suites.name }}
|
||||||
test-runner: playwright
|
test-runner: playwright
|
||||||
- uses: ./.github/actions/after-e2e
|
- uses: ./.github/actions/after-e2e
|
||||||
|
|
||||||
|
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/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Page } from '@playwright/test';
|
import { PlaywrightTestConfig } from '@playwright/test';
|
||||||
import { BaseComponent } from '../base.component';
|
import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared';
|
||||||
|
import EXCLUDED_JSON from './exclude.tests.json';
|
||||||
|
|
||||||
export class MatMenuComponent extends BaseComponent {
|
const config: PlaywrightTestConfig<CustomConfig> = {
|
||||||
private static rootElement = '.mat-menu-content';
|
...getGlobalConfig,
|
||||||
|
|
||||||
constructor(page: Page) {
|
grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Actions'),
|
||||||
super(page, MatMenuComponent.rootElement);
|
projects: [
|
||||||
}
|
{
|
||||||
|
name: 'Actions',
|
||||||
|
testDir: './src/tests',
|
||||||
|
use: {
|
||||||
|
users: ['hruser']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
public getMenuItemsLocator = this.getChild('button');
|
export default config;
|
||||||
|
|
||||||
public getButtonByText = (text: string) => this.getChild('button', { hasText: text });
|
|
||||||
}
|
|
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}"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
50
e2e/playwright/actions/src/tests/create-folder.spec.ts
Normal file
50
e2e/playwright/actions/src/tests/create-folder.spec.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/*!
|
||||||
|
* 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 { expect } from '@playwright/test';
|
||||||
|
import { getUserState, test } from '@alfresco/playwright-shared';
|
||||||
|
|
||||||
|
test.use({ storageState: getUserState('hruser') });
|
||||||
|
test.describe('Create actions', () => {
|
||||||
|
let randomFolderName: string;
|
||||||
|
|
||||||
|
test.beforeEach(async ({ personalFiles }) => {
|
||||||
|
randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||||
|
await personalFiles.navigate();
|
||||||
|
});
|
||||||
|
|
||||||
|
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 @@
|
|||||||
|
{}
|
44
e2e/playwright/folder-rules/playwright.config.ts
Normal file
44
e2e/playwright/folder-rules/playwright.config.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*!
|
||||||
|
* 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 } from '@playwright/test';
|
||||||
|
import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared';
|
||||||
|
import EXCLUDED_JSON from './exclude.tests.json';
|
||||||
|
|
||||||
|
const config: PlaywrightTestConfig<CustomConfig> = {
|
||||||
|
...getGlobalConfig,
|
||||||
|
|
||||||
|
grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Folder Rules'),
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
name: 'Folder Rules',
|
||||||
|
testDir: './src/tests',
|
||||||
|
use: {
|
||||||
|
users: ['admin']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
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/>.
|
* 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 { expect } from '@playwright/test';
|
||||||
|
import { ActionType, getUserState, test } from '@alfresco/playwright-shared';
|
||||||
|
|
||||||
|
test.use({ storageState: getUserState('admin') });
|
||||||
test.describe('Folder Rules Actions', () => {
|
test.describe('Folder Rules Actions', () => {
|
||||||
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||||
const randomRuleName = `playwright-rule-${(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;
|
let folderId: string;
|
||||||
|
|
||||||
test.beforeAll(async ({ apiClient }) => {
|
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||||
const node = await apiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||||
folderId = node.entry.id;
|
folderId = node.entry.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -45,15 +45,15 @@ test.describe('Folder Rules Actions', () => {
|
|||||||
await personalFiles.navigate({ waitUntil: 'domcontentloaded' });
|
await personalFiles.navigate({ waitUntil: 'domcontentloaded' });
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ apiClient }) => {
|
test.afterAll(async ({ superAdminApiClient }) => {
|
||||||
await apiClient.nodes.deleteNode(folderId);
|
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 personalFiles.dataTable.performActionFromExpandableMenu(randomFolderName, 'Manage rules');
|
||||||
|
|
||||||
await nodesPage.toolbar.clickCreateRuleButton();
|
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.HideRecord, 0);
|
||||||
await nodesPage.actionsDropdown.selectAction(ActionType.IncrementCounter, 1);
|
await nodesPage.actionsDropdown.selectAction(ActionType.IncrementCounter, 1);
|
@ -22,11 +22,10 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* 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 { expect } from '@playwright/test';
|
||||||
|
import { ActionType, Comparator, Field, getUserState, test } from '@alfresco/playwright-shared';
|
||||||
|
|
||||||
|
test.use({ storageState: getUserState('admin') });
|
||||||
test.describe('Folder Rules Conditions', () => {
|
test.describe('Folder Rules Conditions', () => {
|
||||||
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||||
const randomRuleName = `playwright-rule-${(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;
|
let folderId: string;
|
||||||
|
|
||||||
test.beforeAll(async ({ apiClient }) => {
|
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||||
const node = await apiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' });
|
||||||
folderId = node.entry.id;
|
folderId = node.entry.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -43,18 +42,18 @@ test.describe('Folder Rules Conditions', () => {
|
|||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ apiClient }) => {
|
test.afterAll(async ({ superAdminApiClient }) => {
|
||||||
await apiClient.nodes.deleteNode(folderId);
|
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 personalFiles.dataTable.performActionFromExpandableMenu(randomFolderName, 'Manage rules');
|
||||||
|
|
||||||
await nodesPage.toolbar.clickCreateRuleButton();
|
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, 0);
|
||||||
await nodesPage.conditionsDropdown.addCondition(Field.Size, Comparator.Equals, specialChars, 1);
|
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, 0);
|
||||||
await nodesPage.conditionsDropdown.addConditionGroup(Field.Size, Comparator.Equals, specialChars, 1);
|
await nodesPage.conditionsDropdown.addConditionGroup(Field.Size, Comparator.Equals, specialChars, 1);
|
||||||
await nodesPage.actionsDropdown.selectAction(ActionType.IncrementCounter, 0);
|
await nodesPage.actionsDropdown.selectAction(ActionType.IncrementCounter, 0);
|
@ -22,29 +22,30 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* 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', () => {
|
test.describe('Rules - Manage Rules', () => {
|
||||||
const randomName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
const randomName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||||
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
const randomRuleName = `playwright-rule-${(Math.random() + 1).toString(36).substring(6)}`;
|
||||||
|
|
||||||
let folderId: string;
|
let folderId: string;
|
||||||
|
|
||||||
test.beforeAll(async ({ apiClient }) => {
|
test.beforeAll(async ({ superAdminApiClient }) => {
|
||||||
const node = await apiClient.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder', relativePath: '/' });
|
const node = await superAdminApiClient.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder', relativePath: '/' });
|
||||||
folderId = node.entry.id;
|
folderId = node.entry.id;
|
||||||
await apiClient.createRandomRule(folderId, randomRuleName);
|
await superAdminApiClient.createRandomRule(folderId, randomRuleName);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.beforeEach(async ({ personalFiles }) => {
|
test.beforeEach(async ({ personalFiles }) => {
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ apiClient }) => {
|
test.afterAll(async ({ superAdminApiClient }) => {
|
||||||
await apiClient.nodes.deleteNode(folderId);
|
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 personalFiles.dataTable.performActionFromExpandableMenu(randomName, 'Manage rules');
|
||||||
await nodesPage.manageRules.disableRuleToggle.click();
|
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,8 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "playwright-shared",
|
|
||||||
"version": "3.0.0",
|
|
||||||
"main": "index.ts",
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -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,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../.eslintrc.json",
|
"extends": "../../.eslintrc.json",
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"!**/*"
|
"!**/*"
|
||||||
],
|
],
|
||||||
@ -10,7 +10,7 @@
|
|||||||
],
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"project": [
|
"project": [
|
||||||
"e2e/tsconfig.e2e.json"
|
"e2e/protractor/tsconfig.e2e.json"
|
||||||
],
|
],
|
||||||
"createDefaultProgram": true
|
"createDefaultProgram": true
|
||||||
},
|
},
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
"name": "app-e2e",
|
"name": "app-e2e",
|
||||||
"sourceRoot": "e2e",
|
"sourceRoot": "e2e",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../../../extension.schema.json",
|
||||||
"$id": "app.core",
|
"$id": "app.core",
|
||||||
"$name": "app.core",
|
"$name": "app.core",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user