Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACS-9201 create smoke test suite #4361

Merged
merged 15 commits into from
Feb 18, 2025
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/actions/run-e2e-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -9,6 +9,10 @@ inputs:
description: 'Test runner'
required: false
default: 'Playwright'
test-smoke:
description: 'Test smoke'
required: false
default: false
artifact-name:
description: Name of the artifact cache
required: true
@@ -29,5 +33,10 @@ runs:
done
printf "\nApplication is ready.\n"

echo "Running playwright tests with options ${{ inputs.options }}"
npx nx run ${{ inputs.options }}-e2e:e2e
if [ "${{ inputs.test-smoke }}" == "true" ]; then
echo "Running smoke tests with options ${{ inputs.options }}"
npx nx run ${{ inputs.options }}-e2e:e2e --grep @smoke
else
echo "Running all tests with options ${{ inputs.options }}"
npx nx run ${{ inputs.options }}-e2e:e2e
fi
163 changes: 163 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: "Smoke Test"

on:
push:
branches:
- master
- acs-9201-create-smoke-test-suite
workflow_dispatch:
inputs:
dry-run-release:
description: 'enable dry-run'
required: false
type: boolean
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
BASE_URL: https://acadev.envalfresco.com
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
HR_USER: ${{ secrets.HR_USER }}
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }}
SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}}
PLAYWRIGHT_E2E_HOST: https://acadev.envalfresco.com/aca/#/personal-files
GH_BUILD_NUMBER: ${{ github.run_id }}
REPORT_PORTAL_URL: ${{ secrets.REPORT_PORTAL_URL }}
REPORT_PORTAL_TOKEN: ${{ secrets.REPORT_PORTAL_TOKEN }}
MAXINSTANCES: 2
RETRY_COUNT: 2

jobs:
build:
name: 'build'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- uses: ./.github/actions/before-install
- run: npm ci
- run: npx nx build aca-playwright-shared
- run: npm run build -- $BUILD_OPTS

- name: dist cache
if: ${{ success() }}
uses: actions/cache/save@v4
with:
path: ./dist/content-ce
key: cache-dist-${{ github.run_id }}

e2es-playwright:
needs: [ build]
name: 'E2E Playwright - ${{ matrix.e2e-suites.name }}'
runs-on: ubuntu-24.04
env:
NODE_OPTIONS: --dns-result-order=ipv4first
strategy:
fail-fast: false
matrix:
e2e-suites:
- name: "create-actions"
id: 1
- name: "viewer"
id: 3
- name: "authentication"
id: 4
- name: "navigation"
id: 5
- name: "list-views"
id: 6
- name: "share-action"
id: 7
- name: "copy-move-actions"
id: 8
- name: "library-actions"
id: 9
- name: "info-drawer"
id: 10
- name: "search"
id: 11
- name: "upload-download-actions"
id: 12
- name: "delete-actions"
id: 13
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- uses: ./.github/actions/before-install
- run: npm ci

- uses: actions/cache/restore@v4
id: cache
with:
path: ./dist/content-ce
key: cache-dist-${{ github.run_id }}

- name: Before e2e
uses: ./.github/actions/before-e2e

- name: Before playwright
shell: bash
run: npx playwright install chromium

- name: Run playwright tests
uses: ./.github/actions/run-e2e-playwright
with:
options: "${{ matrix.e2e-suites.name }}"
test-smoke: true
artifact-name: ${{ matrix.e2e-suites.name }}
test-runner: playwright

finalize:
if: ${{ always() }}
needs: [ build, e2es-playwright]
name: 'Finalize'
runs-on: ubuntu-latest
steps:
- name: Check previous jobs status
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
run: exit 1

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Extract commit message
uses: Alfresco/alfresco-build-tools/.github/actions/get-commit-message@v8.8.0

- name: Check ADF link
shell: bash
run: |
if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
echo -e "\e[31mPRs are not mergeable with conditional build. This build was run with custom ADF branch: $BRANCH \e[0m"
exit 1
fi;

2 changes: 1 addition & 1 deletion e2e/playwright/authentication/src/tests/general.e2e.ts
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ test.describe('Create folders', () => {
await apiClientFactory.loginUser(sessionTestUser);
});

test('[C286473] should close opened dialogs on session expire', async ({ loginPage, personalFiles }) => {
test('[C286473] should close opened dialogs on session expire @smoke', async ({ loginPage, personalFiles }) => {
await loginPage.navigate();
await loginPage.loginUser({ username: sessionTestUser.username, password: sessionTestUser.password });
const folderDialog = personalFiles.folderDialog;
2 changes: 1 addition & 1 deletion e2e/playwright/copy-move-actions/src/tests/copy.e2e.ts
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ test.describe('Copy actions', () => {
}
};

test('[C217135] Copy a file', async ({ personalFiles }) => {
test('[C217135] Copy a file @smoke', async ({ personalFiles }) => {
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
2 changes: 1 addition & 1 deletion e2e/playwright/copy-move-actions/src/tests/move.e2e.ts
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ test.describe('Move actions', () => {
expect(await personalFiles.dataTable.isItemPresent(expectedNameForCopiedFile)).toBeFalsy();
});

test('[C217320] Move locked file', async ({ personalFiles }) => {
test('[C217320] Move locked file @smoke', async ({ personalFiles }) => {
const lockType = 'ALLOW_OWNER_CHANGES';
await nodesApi.lockNodes([sourceFileId], lockType);
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ test.describe('Create folders', () => {
folderTable = personalFiles.dataTable;
});

test('[C216341] Create a folder with name only', async () => {
test('[C216341] Create a folder with name only @smoke', async () => {
await folderDialog.createNewFolderDialog(randomFolderName);

await expect(folderTable.getRowByName(randomFolderName)).toBeVisible();
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ test.describe('Create Libraries ', () => {
libraryBreadcrumb = myLibrariesPage.breadcrumb;
});

test('[C280025] Create a public library', async ({ myLibrariesPage }) => {
test('[C280025] Create a public library @smoke', async ({ myLibrariesPage }) => {
await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName);
await expect(libraryDialog.getLabelText(libraryNameLabel)).toHaveValue(randomLibraryName);
await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(randomLibraryName);
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ test.describe('Delete and undo delete', () => {
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed');
});

test('[C217125] delete a file and check notification', async ({ personalFiles, trashPage }) => {
test('[C217125] delete a file and check notification @smoke', async ({ personalFiles, trashPage }) => {
let items = await personalFiles.dataTable.getRowsCount();
await personalFiles.dataTable.selectItems(file1);
await personalFiles.acaHeader.clickMoreActions();
2 changes: 1 addition & 1 deletion e2e/playwright/info-drawer/src/tests/comments.e2e.ts
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ test.describe('Info Drawer - Comments', () => {
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed');
});

test('[C299173] from Personal Files - Comments tab default fields', async ({ personalFiles }) => {
test('[C299173] from Personal Files - Comments tab default fields @smoke', async ({ personalFiles }) => {
const personalFolderName = `personalFolder-e2e-${Utils.random()}`;
await nodesApi.createFolder(personalFolderName);
await fileActionsApi.waitForNodes(personalFolderName, { expect: 1 });
2 changes: 1 addition & 1 deletion e2e/playwright/info-drawer/src/tests/file-preview.e2e.ts
Original file line number Diff line number Diff line change
@@ -62,10 +62,10 @@
await expect(allPages).toBeVisible();
await expect(pageLoaded).toBeVisible();
await expect(textLayerLoaded).toBeVisible();
expect(await specificText).toContain(text);

Check failure on line 65 in e2e/playwright/info-drawer/src/tests/file-preview.e2e.ts

GitHub Actions / E2E Playwright - info-drawer

[Info Drawer] › src/tests/file-preview.e2e.ts:68:7 › File preview › [C595967] Should preview document from the info drawer @smoke

1) [Info Drawer] › src/tests/file-preview.e2e.ts:68:7 › File preview › [C595967] Should preview document from the info drawer @smoke Error: expect(received).toContain(expected) // indexOf Expected substring: "This is a small demonstration" Received string: "" 63 | await expect(pageLoaded).toBeVisible(); 64 | await expect(textLayerLoaded).toBeVisible(); > 65 | expect(await specificText).toContain(text); | ^ 66 | } 67 | 68 | test('[C595967] Should preview document from the info drawer @smoke', async ({ personalFiles }) => { at checkFileContent (/home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/info-drawer/src/tests/file-preview.e2e.ts:65:32) at /home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/info-drawer/src/tests/file-preview.e2e.ts:76:5
}

test('[C595967] Should preview document from the info drawer', async ({ personalFiles }) => {
test('[C595967] Should preview document from the info drawer @smoke', async ({ personalFiles }) => {
const fileName = `file1-${timestamp}.pdf`;
await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileName, '-my-');
await fileActionsApi.waitForNodes(fileName, { expect: 1 });
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!

Check failure on line 1 in e2e/playwright/info-drawer/src/tests/library-properties.e2e.ts

GitHub Actions / E2E Playwright - info-drawer

[Info Drawer] › src/tests/library-properties.e2e.ts:184:7 › Library properties › [C289343] Site description too long

2) [Info Drawer] › src/tests/library-properties.e2e.ts:184:7 › Library properties › [C289343] Site description too long Test timeout of 85000ms exceeded.
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
@@ -67,7 +67,7 @@
await Utils.deleteNodesSitesEmptyTrashcan(undefined, undefined, 'afterAll failed', sitesApi, [site.id, siteForUpdate.id, siteDup]);
});

test('[C289336] Info drawer opens for a library', async ({ myLibrariesPage }) => {
test('[C289336] Info drawer opens for a library @smoke', async ({ myLibrariesPage }) => {
await expect(myLibrariesPage.dataTable.getRowByName(site.name)).toBeVisible();
await myLibrariesPage.dataTable.getRowByName(site.name).click();
await myLibrariesPage.acaHeader.viewDetails.click();
@@ -183,7 +183,7 @@

test('[C289343] Site description too long', async ({ myLibrariesPage }) => {
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, site.name);
await myLibrariesPage.dataTable.getRowByName(site.name).click();

Check failure on line 186 in e2e/playwright/info-drawer/src/tests/library-properties.e2e.ts

GitHub Actions / E2E Playwright - info-drawer

[Info Drawer] › src/tests/library-properties.e2e.ts:184:7 › Library properties › [C289343] Site description too long

2) [Info Drawer] › src/tests/library-properties.e2e.ts:184:7 › Library properties › [C289343] Site description too long Error: locator.click: Test timeout of 85000ms exceeded. Call log: - waiting for locator('adf-datatable adf-datatable-row').filter({ hasText: 'site1-8emwt' }) 184 | test('[C289343] Site description too long', async ({ myLibrariesPage }) => { 185 | await Utils.reloadPageIfRowNotVisible(myLibrariesPage, site.name); > 186 | await myLibrariesPage.dataTable.getRowByName(site.name).click(); | ^ 187 | await myLibrariesPage.acaHeader.viewDetails.click(); 188 | await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible(); 189 | at /home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/info-drawer/src/tests/library-properties.e2e.ts:186:61
await myLibrariesPage.acaHeader.viewDetails.click();
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();

Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ test.describe('Library actions ', () => {
expect(await libraryMenu.isMenuItemVisible(favoriteButton)).toBe(true);
});

test('[C289988] Delete a library from My Libraries', async ({ trashPage }) => {
test('[C289988] Delete a library from My Libraries @smoke', async ({ trashPage }) => {
const trashTable = trashPage.dataTable;
await expect(libraryTable.getRowByName(user2Library5Delete)).toBeVisible();
await libraryTable.getRowByName(user2Library5Delete).click();
@@ -335,7 +335,7 @@ test.describe('Library actions ', () => {
}
});

test('[C306959] Join a public library from Search Results', async ({ searchPage }) => {
test('[C306959] Join a public library from Search Results @smoke', async ({ searchPage }) => {
await searchPage.searchWithin(adminLibrary2, 'libraries');
await searchPage.reload({ waitUntil: loadString });
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, notMemberString)).toBeVisible();
2 changes: 1 addition & 1 deletion e2e/playwright/list-views/src/tests/empty-list.e2e.ts
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ test.describe('Empty list views', () => {
await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed');
});

test('[C217099] empty My Libraries', async ({ myLibrariesPage }) => {
test('[C217099] empty My Libraries @smoke', async ({ myLibrariesPage }) => {
await myLibrariesPage.navigate();
expect(await myLibrariesPage.dataTable.isEmpty(), 'list is not empty').toBe(true);
expect(await myLibrariesPage.dataTable.getEmptyStateTitle()).toContain(`You aren't a member of any File Libraries yet`);
2 changes: 1 addition & 1 deletion e2e/playwright/list-views/src/tests/favorites.e2e.ts
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ test.describe('Favorites Files', () => {
expect(await favoritePage.breadcrumb.getAllItems()).toEqual(['Personal Files']);
});

test('[C280484] Location column redirect - file in folder', async ({ favoritePage }) => {
test('[C280484] Location column redirect - file in folder @smoke', async ({ favoritePage }) => {
await favoritePage.dataTable.clickItemLocation(fileName2);
await favoritePage.dataTable.spinnerWaitForReload();
expect(await favoritePage.breadcrumb.getAllItems()).toEqual(['Personal Files', parentFolder]);
4 changes: 2 additions & 2 deletions e2e/playwright/list-views/src/tests/generic-errors.e2e.ts
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ test.describe('Generic errors', () => {
await trashcanApi.emptyTrashcan();
});

test('[C217313] File / folder not found', async ({ personalFiles }) => {
test('[C217313] File / folder not found @smoke', async ({ personalFiles }) => {
await actionUser.deleteNodeById(file1Id, false);
await personalFiles.navigate({ remoteUrl: `#/personal-files/${file1Id}` });

@@ -73,7 +73,7 @@ test.describe('Generic errors', () => {
);
});

test('[C217314] Permission denied', async ({ personalFiles, loginPage }) => {
test('[C217314] Permission denied @smoke', async ({ personalFiles, loginPage }) => {
await loginPage.logoutUser();
await loginPage.loginUser(
{ username: username2, password: username2 },
2 changes: 1 addition & 1 deletion e2e/playwright/list-views/src/tests/sort-list.e2e.ts
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ test.describe('Remember sorting', () => {
await nodeActionUser2.deleteCurrentUserNodes();
});

test('[C261136] Sort order is retained when navigating to another part of the app', async ({ personalFiles, favoritePage }) => {
test('[C261136] Sort order is retained when navigating to another part of the app @smoke', async ({ personalFiles, favoritePage }) => {
await personalFiles.dataTable.sortBy('Name', 'desc');
await personalFiles.dataTable.spinnerWaitForReload();

2 changes: 1 addition & 1 deletion e2e/playwright/list-views/src/tests/trash.e2e.ts
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ test.describe('Trash', () => {
expect(await trashPage.dataTable.getItemLocationText(fileDeleted)).toEqual('');
});

test('[C217144] Location column redirect - file in user Home', async ({ trashPage }) => {
test('[C217144] Location column redirect - file in user Home @smoke', async ({ trashPage }) => {
await trashPage.dataTable.clickItemLocation(fileUser);
await trashPage.dataTable.spinnerWaitForReload();
expect(await trashPage.breadcrumb.getAllItems()).toEqual(['Personal Files']);
2 changes: 1 addition & 1 deletion e2e/playwright/navigation/src/tests/breadcrumb.e2e.ts
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ test.describe('viewer action file', () => {
await expect(personalFiles.breadcrumb.currentItem).toHaveText('Personal Files');
});

test('[C260965] Personal Files breadcrumb for a folder hierarchy', async ({ personalFiles }) => {
test('[C260965] Personal Files breadcrumb for a folder hierarchy @smoke', async ({ personalFiles }) => {
await personalFiles.navigate({ remoteUrl: `#/personal-files/${subFolder2Id}` });
const expectedBreadcrumb = ['Personal Files', parent, subFolder1, subFolder2];
expect(await personalFiles.breadcrumb.getAllItems()).toEqual(expectedBreadcrumb);
2 changes: 1 addition & 1 deletion e2e/playwright/navigation/src/tests/single-click.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!

Check failure on line 1 in e2e/playwright/navigation/src/tests/single-click.e2e.ts

GitHub Actions / E2E Playwright - navigation

[Navigation] › src/tests/single-click.e2e.ts:83:7 › Single click on item name › [C284902] Navigate inside the library when clicking the hyperlink on File Libraries

1) [Navigation] › src/tests/single-click.e2e.ts:83:7 › Single click on item name › [C284902] Navigate inside the library when clicking the hyperlink on File Libraries Error: {"error":{"errorKey":"Person 'user-1cy5l' already exists.","statusCode":409,"briefSummary":"00310024 Person 'user-1cy5l' already exists.","stackTrace":"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL":"https://api-explorer.alfresco.com","logId":"b8b4ab43-0c65-4262-b4ab-430c65f26221"}} at Request.callback (/home/runner/work/alfresco-content-app/alfresco-content-app/node_modules/superagent/src/node/index.js:875:17) at fn (/home/runner/work/alfresco-content-app/alfresco-content-app/node_modules/superagent/src/node/index.js:1165:18) at IncomingMessage.<anonymous> (/home/runner/work/alfresco-content-app/alfresco-content-app/node_modules/superagent/src/node/parsers/json.js:19:7)
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
@@ -69,7 +69,7 @@
await expect(trashPage.dataTable.getCellLinkByName(deletedFolder1), 'Link on name is present').toBeHidden();
});

test('[C280034] Navigate inside the folder when clicking the hyperlink on Personal Files', async ({ personalFiles }) => {
test('[C280034] Navigate inside the folder when clicking the hyperlink on Personal Files @smoke', async ({ personalFiles }) => {
await personalFiles.navigate();
await personalFiles.dataTable.setPaginationTo50();
await personalFiles.dataTable.getCellLinkByName(folder1).click();
2 changes: 1 addition & 1 deletion e2e/playwright/search/src/tests/search-highlighting.e2e.ts
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ test.describe('Search Highlighting', () => {
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed');
});

test('[XAT-17119] Matching phrases should be highlighted in the file name for search results', async ({ searchPage }) => {
test('[XAT-17119] Matching phrases should be highlighted in the file name for search results @smoke', async ({ searchPage }) => {
await searchPage.searchWithin(fileNameHighlight, 'files');
expect(await searchPage.dataTable.hasHighlightedText('name')).toBeTruthy();
});
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ test.describe('Share a file', () => {
expect(await personalFiles.shareDialog.isCloseEnabled()).toBe(true);
});

test('[C286329] Share a file', async ({ personalFiles, nodesApiAction }) => {
test('[C286329] Share a file @smoke', async ({ personalFiles, nodesApiAction }) => {
await personalFiles.dataTable.performActionFromExpandableMenu(file3, 'Share');

const url = await personalFiles.shareDialog.getLinkUrl();
Loading
Loading