-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [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 <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Denys Vuika <[email protected]>
- Loading branch information
1 parent
e0a74d7
commit c843a8d
Showing
180 changed files
with
899 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
Oops, something went wrong.