diff --git a/.eslintrc.json b/.eslintrc.json index 2ad07cd96..df79cb686 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,6 +5,15 @@ ], "plugins": ["@nrwl/nx"], "overrides": [ + { + "files": ["*.ts"], + "plugins": ["@alfresco/eslint-angular"], + "extends": ["plugin:@angular-eslint/template/process-inline-templates"], + "excludedFiles": ["*.spec.ts"], + "rules": { + "@alfresco/eslint-angular/use-none-component-view-encapsulation": "error" + } + }, { "files": [ "*.ts" @@ -15,7 +24,6 @@ "extends": [ "plugin:@nrwl/nx/typescript", "plugin:@nrwl/nx/angular", - "plugin:@angular-eslint/template/process-inline-templates", "plugin:@cspell/recommended" ], "plugins": [ @@ -315,10 +323,12 @@ "*.html" ], "extends": ["plugin:@nrwl/nx/angular-template", "plugin:@angular-eslint/template/accessibility"], + "parser": "@angular-eslint/template-parser", "rules": { "@angular-eslint/template/no-negated-async": "off", "@angular-eslint/template/no-positive-tabindex": "error", - "@angular-eslint/template/eqeqeq": "error" + "@angular-eslint/template/eqeqeq": "error", + "@angular-eslint/template/no-call-expression": "warn" } }, { diff --git a/.github/actions/publish-libs/npm-publish.sh b/.github/actions/publish-libs/npm-publish.sh index 65627e1ad..49b97a232 100755 --- a/.github/actions/publish-libs/npm-publish.sh +++ b/.github/actions/publish-libs/npm-publish.sh @@ -12,7 +12,6 @@ fi export PROJECTS=( 'aca-content' - 'aca-folder-rules' 'aca-preview' 'aca-shared' 'aca-viewer' diff --git a/.github/actions/run-e2e-playwright/action.yml b/.github/actions/run-e2e-playwright/action.yml new file mode 100644 index 000000000..b0364c946 --- /dev/null +++ b/.github/actions/run-e2e-playwright/action.yml @@ -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/ diff --git a/.github/actions/run-e2e/action.yml b/.github/actions/run-e2e/action.yml index 4725b49ab..5e52b0669 100644 --- a/.github/actions/run-e2e/action.yml +++ b/.github/actions/run-e2e/action.yml @@ -22,7 +22,7 @@ runs: - name: Setup and run with options shell: bash 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 &\ { @@ -48,7 +48,7 @@ runs: if [ ${{ inputs.test-runner }} == "playwright" ]; then echo "Running playwright tests with options ${{ inputs.options }}" sleep 90 - npx playwright test --config ${{ inputs.options }} + npx nx run ${{ inputs.options }}-e2e:e2e else echo "Running protractor tests with options ${{ inputs.options }}" echo "./node_modules/.bin/protractor \"./protractor.conf.js\" ${{ inputs.options }} || exit 1" diff --git a/.github/actions/update-library-versions/update-lib-versions.sh b/.github/actions/update-library-versions/update-lib-versions.sh index b570e6036..5b983fabc 100755 --- a/.github/actions/update-library-versions/update-lib-versions.sh +++ b/.github/actions/update-library-versions/update-lib-versions.sh @@ -11,7 +11,6 @@ fi export PROJECTS=( 'aca-content' - 'aca-folder-rules' 'aca-preview' 'aca-shared' 'aca-viewer' diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4b65f5bea..82846abc7 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,6 +13,14 @@ env: APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }} ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }} 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_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}} AWS_REGION: "eu-west-2" @@ -96,7 +104,6 @@ jobs: unit-tests: - name: "aca-content" - name: "aca-shared" - - name: "aca-folder-rules" - name: "aca-preview" steps: - name: Checkout @@ -178,8 +185,16 @@ jobs: e2es-playwright: needs: [lint, build, unit-tests] - name: 'E2e test suites: Folder Rules - Playwright' + name: 'E2e test suites: Playwright' runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + e2e-suites: + - name: "actions" + id: 1 + - name: "folder-rules" + id: 2 steps: - name: Checkout uses: actions/checkout@v3 @@ -204,10 +219,10 @@ jobs: - name: before playwright shell: bash run: npx playwright install chromium - - uses: ./.github/actions/run-e2e + - uses: ./.github/actions/run-e2e-playwright with: - options: "e2e/playwright/tests/folder-rules/playwright.config.ts" - artifact-name: folder-rules + options: "${{ matrix.e2e-suites.name }}" + artifact-name: ${{ matrix.e2e-suites.name }} test-runner: playwright - uses: ./.github/actions/after-e2e diff --git a/README.md b/README.md index ac47e9862..e8c41747c 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,14 @@ Please refer to the public [documentation](https://alfresco-content-app.netlify. ## Compatibility -| ACA | ACS | Node | ADF | Angular | -| --- | --- | --- | --- | --- | -| 4.1 | 7.4 | 18.x | 6.1.0 | 14.x | -| 4.0 | 7.4 | 14.x | 6.0.0 | 14.x | +| ACA | ADF | ACS | Node | Angular | +| ---- | --- | --- | ---- | ------- | +| 4.1 | 6.1 | 7.4 | 18.x | 14.x | +| 4.0 | 6.1 | 7.4 | 14.x | 14.x | +| 3.1 | 5.1 | 7.3 | | | +| 3.0 | 5.0 | 7.3 | | | + +> See for more details on Angular and Node.js compatibility ## Running @@ -48,7 +52,6 @@ APP_CONFIG_DOWNLOAD_PROMPT_DELAY=