mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-11446] Automated last test cases from ACA test execution & various refactoring (#5134)
* [ACS-11446] Automated last test cases from ACA test execution & various refactoring * [ACS-11446] sonar cloud fix 1 * [ACS-11446] spinner changes reverted & spinner component added to the base component * [ACS-11446] sonar fix 2 * [ACS-11446] copilot review fixes 1 * [ACS-11446] copilot review fixes 2 * [ACS-11446] copilot review fixes 3 * [ACS=11446] review fixes 1 * [ACS-11446] excluded upload dialog tests
This commit is contained in:
@@ -89,7 +89,7 @@ test.describe('Search - Filters - General', () => {
|
||||
await searchPage.searchFilters.propertiesFilter.click();
|
||||
await searchPage.searchFiltersProperties.fileSizeInput.fill('1000');
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
const filterTextAfter = await searchPage.searchFilters.propertiesFilter.textContent();
|
||||
|
||||
await searchPage.searchFilters.propertiesFilter.click();
|
||||
@@ -106,14 +106,14 @@ test.describe('Search - Filters - General', () => {
|
||||
await searchPage.searchFilters.propertiesFilter.click();
|
||||
await searchPage.searchFiltersProperties.fileSizeInput.fill('1000');
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
const propertiesFilterTextAfter = await searchPage.searchFilters.propertiesFilter.textContent();
|
||||
|
||||
const logicFilterTextBefore = await searchPage.searchFilters.logicFilter.textContent();
|
||||
await searchPage.searchFilters.logicFilter.click();
|
||||
await searchPage.searchFiltersLogic.matchAllInput.fill('test');
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
const logicFilterTextAfter = await searchPage.searchFilters.logicFilter.textContent();
|
||||
|
||||
await searchPage.searchFilters.resetButton.click();
|
||||
|
||||
@@ -81,7 +81,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
`${logicFile1NameSplit[0]} ${logicFile1NameSplit[1]} ${logicFile1TitleSplit[1]} ${logicFile1DescriptionSplit[1]}`
|
||||
);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile1.name)).toBeVisible();
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile2.name)).toBeHidden();
|
||||
@@ -93,7 +93,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
`${logicFile1NameSplit[2]}-${logicFile1NameSplit[3]} ${logicFile1TitleSplit[0]} ${logicFile1DescriptionSplit[0]}`
|
||||
);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.getRowsCount()).toBe(2);
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile1.name)).toBeVisible();
|
||||
@@ -107,7 +107,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
);
|
||||
await searchPage.searchFiltersLogic.excludeInput.fill(`${logicFile1DescriptionSplit[1]}`);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.getRowsCount()).toBe(1);
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile1.name)).toBeHidden();
|
||||
@@ -118,7 +118,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
await searchPage.searchFilters.logicFilter.click();
|
||||
await searchPage.searchFiltersLogic.matchExactInput.fill(logicFile1.name);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.getRowsCount()).toBe(1);
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile2.name)).toBeHidden();
|
||||
@@ -127,7 +127,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
await searchPage.searchFilters.logicFilter.click();
|
||||
await searchPage.searchFiltersLogic.matchExactInput.fill(logicFile1.title);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.getRowsCount()).toBe(1);
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile2.name)).toBeHidden();
|
||||
@@ -136,7 +136,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
await searchPage.searchFilters.logicFilter.click();
|
||||
await searchPage.searchFiltersLogic.matchExactInput.fill(logicFile1.description);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.getRowsCount()).toBe(1);
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile2.name)).toBeHidden();
|
||||
@@ -152,7 +152,7 @@ test.describe('Search - Filters - Logic', () => {
|
||||
await searchPage.searchFiltersLogic.excludeInput.fill(`${logicFile1NameSplit[3]}`);
|
||||
await searchPage.searchFiltersLogic.matchExactInput.fill(`${logicFile2NameSplit[1]}-${logicFile2NameSplit[2]}-${logicFile2NameSplit[3]}`);
|
||||
await searchPage.searchMenuCard.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.getRowsCount()).toBe(1);
|
||||
await expect(searchPage.dataTable.getRowByName(logicFile1.name)).toBeHidden();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
import { ApiClientFactory, Utils, test, NodesApi, TrashcanApi, TagsApi, FileActionsApi } from '@alfresco/aca-playwright-shared';
|
||||
import { TagPaging } from '@alfresco/js-api';
|
||||
import { TagEntry } from '@alfresco/js-api';
|
||||
|
||||
test.describe('Search - Filters - Tags', () => {
|
||||
let nodesApi: NodesApi;
|
||||
@@ -33,7 +33,7 @@ test.describe('Search - Filters - Tags', () => {
|
||||
let fileActionsApi: FileActionsApi;
|
||||
let file1Id: string;
|
||||
let file2Id: string;
|
||||
let tagPaging: TagPaging;
|
||||
let createdTags: TagEntry[];
|
||||
|
||||
const random = Utils.random();
|
||||
const username = `user1-${random}`;
|
||||
@@ -60,7 +60,7 @@ test.describe('Search - Filters - Tags', () => {
|
||||
file2Id = node2.entry.id;
|
||||
await fileActionsApi.waitForNodes(file1, { expect: 1 });
|
||||
await fileActionsApi.waitForNodes(file2, { expect: 1 });
|
||||
tagPaging = (await tagsApiAdmin.createTags(tags)) as TagPaging;
|
||||
createdTags = await tagsApiAdmin.createTags(...tags.map((t) => t.tag));
|
||||
await tagsApiAdmin.assignTagToNode(file1Id, tags[0]);
|
||||
await tagsApiAdmin.assignTagToNode(file2Id, tags[1]);
|
||||
} catch (error) {
|
||||
@@ -70,19 +70,19 @@ test.describe('Search - Filters - Tags', () => {
|
||||
|
||||
test.afterAll(async () => {
|
||||
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed');
|
||||
await tagsApiAdmin.deleteTags([`${tagPaging.list.entries[0].entry.id}`]);
|
||||
await tagsApiAdmin.deleteTags([`${tagPaging.list.entries[1].entry.id}`]);
|
||||
await tagsApiAdmin.deleteTags({ id: createdTags[0].entry.id, tag: createdTags[0].entry.tag });
|
||||
await tagsApiAdmin.deleteTags({ id: createdTags[1].entry.id, tag: createdTags[1].entry.tag });
|
||||
});
|
||||
|
||||
test('[XAT-5581] user able to search with tags facet', async ({ searchPage }) => {
|
||||
await searchPage.searchWithin(random, 'files');
|
||||
await searchPage.searchFiltersTags.filterByTag(searchPage, `${tagPaging.list.entries[0].entry.tag}`);
|
||||
await searchPage.searchFiltersTags.filterByTag(searchPage, createdTags[0].entry.tag);
|
||||
|
||||
await expect(searchPage.dataTable.getRowByName(file1)).toBeVisible();
|
||||
await expect(searchPage.dataTable.getRowByName(file2)).toBeHidden();
|
||||
|
||||
await searchPage.searchFiltersTags.clearTagFilter(searchPage);
|
||||
await searchPage.searchFiltersTags.filterByTag(searchPage, `${tagPaging.list.entries[1].entry.tag}`);
|
||||
await searchPage.searchFiltersTags.filterByTag(searchPage, createdTags[1].entry.tag);
|
||||
|
||||
await expect(searchPage.dataTable.getRowByName(file1)).toBeHidden();
|
||||
await expect(searchPage.dataTable.getRowByName(file2)).toBeVisible();
|
||||
|
||||
@@ -67,13 +67,13 @@ test.describe('Search Highlighting', () => {
|
||||
|
||||
test('[XAT-17119] Matching phrases should be highlighted in the file name for search results', async ({ searchPage }) => {
|
||||
await searchPage.searchWithin(fileNameHighlight, 'files');
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(true);
|
||||
});
|
||||
|
||||
test('[XAT-17120] Matching phrases should be highlighted in the file description for search results', async ({ searchPage }) => {
|
||||
await searchPage.searchWithin(fileDescription, 'files');
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('description')).toBe(true);
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
|
||||
});
|
||||
@@ -81,7 +81,7 @@ test.describe('Search Highlighting', () => {
|
||||
test('[XAT-17121] Matching phrases should be highlighted in the file content for search results', async ({ searchPage, personalFiles }) => {
|
||||
await personalFiles.navigate();
|
||||
await searchPage.searchWithin(fileContent, 'files');
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('content')).toBe(true);
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
|
||||
});
|
||||
|
||||
@@ -97,7 +97,7 @@ test.describe('Search Results - General', () => {
|
||||
|
||||
await personalFiles.navigate();
|
||||
await personalFiles.page.goto(url);
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
|
||||
expect(await searchPage.dataTable.isItemPresent(site)).toBe(true);
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ test.describe('Search sorting', () => {
|
||||
await searchPage.searchWithin(`*${random}*`, 'files');
|
||||
}
|
||||
await searchPage.searchSortingPicker.sortBy(sortBy, sortOrder);
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.dataTable.spinnerWaitForReload();
|
||||
expect(await searchPage.dataTable.getNthRow(0).textContent()).toContain(expectedFirstFile);
|
||||
expect(await searchPage.dataTable.getNthRow(1).textContent()).toContain(expectedSecondFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user