Skip to content

Commit

Permalink
[ACS-9154] Final tests stabilization (for this pr)
Browse files Browse the repository at this point in the history
  • Loading branch information
datguychen committed Jan 27, 2025
1 parent 4931dd1 commit 15f80bf
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
8 changes: 0 additions & 8 deletions .github/actions/run-e2e-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,3 @@ runs:
echo "Running playwright tests with options ${{ inputs.options }}"
npx nx run ${{ inputs.options }}-e2e:e2e
- name: Upload E2Es results
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
test-results/
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ test.describe('Info Drawer - File Folder Properties', () => {
test('[XAT-17240] Remove a tag from a node', async ({ personalFiles }) => {
await fileActionsApi.waitForNodes(Folder17240, { expect: 1 });
await tagsApi.assignTagToNode(Folder17240Id, tagBody);
await expect(async () => {
expect((await tagsApi.listTagsForNode(Folder17240Id)).list.entries.length).toEqual(1);
}).toPass({
intervals: [1_000],
timeout: 10_000
});
await personalFiles.navigate();
await Utils.reloadPageIfRowNotVisible(personalFiles, Folder17240);
await expect(personalFiles.dataTable.getRowByName(Folder17240)).toBeVisible();
Expand Down
25 changes: 23 additions & 2 deletions e2e/playwright/info-drawer/src/tests/library-properties.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,35 @@
import { expect } from '@playwright/test';
import { ApiClientFactory, Utils, test, SitesApi, QueriesApi, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-playwright-shared';

async function expectSiteToBeDefined(siteName: string, queriesApi: QueriesApi) {
await expect(async () => {
expect(await queriesApi.waitForSites(siteName, { expect: 1 })).toEqual(1);
}).toPass({
intervals: [1_000],
timeout: 10_000
});
}

test.describe('Library properties', () => {
let sitesApi: SitesApi;
let queriesApi: QueriesApi;

const username = `user1-${Utils.random()}`;

const site = {
name: `site1-${Utils.random()}`,
id: `site-id-${Utils.random()}`,
visibility: SITE_VISIBILITY.MODERATED,
description: 'my site description'
};

const siteForUpdate = {
name: `site2-${Utils.random()}`,
id: `site-id-${Utils.random()}`,
visibility: SITE_VISIBILITY.MODERATED,
description: 'my initial description'
};

const siteDup = `site3-${Utils.random()}`;

test.beforeAll(async () => {
Expand All @@ -50,6 +63,7 @@ test.describe('Library properties', () => {
await apiClientFactory.createUser({ username });

sitesApi = await SitesApi.initialize(username, username);
queriesApi = await QueriesApi.initialize(username, username);
await sitesApi.createSite(site.name, site.visibility, site.description, site.id);
await sitesApi.createSite(siteForUpdate.name, siteForUpdate.visibility, siteForUpdate.description, siteForUpdate.id);
await sitesApi.createSite(siteDup);
Expand All @@ -68,6 +82,7 @@ test.describe('Library properties', () => {
});

test('[C289336] Info drawer opens for a library', async ({ myLibrariesPage }) => {
await expectSiteToBeDefined(site.name, queriesApi);
await expect(myLibrariesPage.dataTable.getRowByName(site.name)).toBeVisible();
await myLibrariesPage.dataTable.getRowByName(site.name).click();
await myLibrariesPage.acaHeader.viewDetails.click();
Expand All @@ -88,6 +103,7 @@ test.describe('Library properties', () => {
});

test('[C289338] Editable properties', async ({ myLibrariesPage }) => {
await expectSiteToBeDefined(site.name, queriesApi);
await myLibrariesPage.dataTable.getRowByName(site.name).click();
await myLibrariesPage.acaHeader.viewDetails.click();
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
Expand All @@ -110,6 +126,7 @@ test.describe('Library properties', () => {
visibility: SITE_VISIBILITY.PRIVATE,
description: 'new description'
};
await expectSiteToBeDefined(siteForUpdate.name, queriesApi);

await myLibrariesPage.dataTable.getRowByName(siteForUpdate.name).click();
await myLibrariesPage.acaHeader.viewDetails.click();
Expand All @@ -133,6 +150,7 @@ test.describe('Library properties', () => {
});

test('[C289340] Cancel editing a site', async ({ myLibrariesPage }) => {
await expectSiteToBeDefined(site.name, queriesApi);
const newName = `new-name-${Utils.random}`;
const newDesc = `new desc ${Utils.random}`;

Expand All @@ -155,9 +173,8 @@ test.describe('Library properties', () => {
});

test('[C289341] Warning appears when editing the name of the library by entering an existing name', async ({ myLibrariesPage }) => {
const queriesApi = await QueriesApi.initialize(username, username);
await expectSiteToBeDefined(siteDup, queriesApi);

await queriesApi.waitForSites(site.name, { expect: 1 });
await myLibrariesPage.dataTable.getRowByName(siteDup).click();
await myLibrariesPage.acaHeader.viewDetails.click();
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
Expand All @@ -170,6 +187,8 @@ test.describe('Library properties', () => {
});

test('[C289342] Site name too long', async ({ myLibrariesPage }) => {
await expectSiteToBeDefined(site.name, queriesApi);

await myLibrariesPage.dataTable.getRowByName(site.name).click();
await myLibrariesPage.acaHeader.viewDetails.click();
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
Expand All @@ -182,6 +201,8 @@ test.describe('Library properties', () => {
});

test('[C289343] Site description too long', async ({ myLibrariesPage }) => {
await expectSiteToBeDefined(site.name, queriesApi);

await Utils.reloadPageIfRowNotVisible(myLibrariesPage, site.name);
await myLibrariesPage.dataTable.getRowByName(site.name).click();
await myLibrariesPage.acaHeader.viewDetails.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ContentNodeSelectorDialog extends BaseComponent {
await row.click();
await expect(this.selectedRow).toBeVisible();
}).toPass({
intervals: [2_000, 2_000, 2_000, 2_000, 2_000, 2_000, 2_000],
intervals: [2_000],
timeout: 20_000
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class LinkRulesDialog extends BaseComponent {
await row.click();
await expect(this.selectFolderButton).toBeEnabled();
}).toPass({
intervals: [2_000, 2_000, 2_000, 2_000, 2_000, 2_000, 2_000],
intervals: [2_000],
timeout: 20_000
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ManageRules extends BaseComponent {
await this.ruleToggle.click();
await expect(this.ruleToggleFalse).toBeVisible();
}).toPass({
intervals: [2_000, 2_000, 2_000, 2_000, 2_000, 2_000, 2_000],
intervals: [2_000],
timeout: 20_000
});
}
Expand Down

0 comments on commit 15f80bf

Please sign in to comment.