mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-9756] Tests 5571, 17700, 17120, 5567 fixed and included (#4648)
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
"XAT-5601": "https://hyland.atlassian.net/browse/ACS-6928",
|
||||
"XAT-5600": "https://hyland.atlassian.net/browse/ACS-6928",
|
||||
"XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464",
|
||||
"XAT-5571": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-17700": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-17120": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-5567": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-17121": "https://hyland.atlassian.net/browse/ACS-9795",
|
||||
"XAT-17702": "https://hyland.atlassian.net/browse/ACS-9795"
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { ApiClientFactory, Utils, test, NodesApi, TrashcanApi, FileActionsApi, TEST_FILES } from '@alfresco/aca-playwright-shared';
|
||||
|
||||
test.use({ launchOptions: { slowMo: 500 } });
|
||||
test.describe('Search - Filters - Date', () => {
|
||||
let nodesApi: NodesApi;
|
||||
let trashcanApi: TrashcanApi;
|
||||
|
@@ -25,6 +25,7 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { ApiClientFactory, Utils, test, NodesApi, TrashcanApi, TEST_FILES, FileActionsApi } from '@alfresco/aca-playwright-shared';
|
||||
|
||||
test.use({ launchOptions: { slowMo: 500 } });
|
||||
test.describe('Search Highlighting', () => {
|
||||
let nodesApi: NodesApi;
|
||||
let trashcanApi: TrashcanApi;
|
||||
@@ -63,18 +64,21 @@ 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');
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBeTruthy();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
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');
|
||||
expect(await searchPage.dataTable.hasHighlightedText('description')).toBeTruthy();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBeFalsy();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('description')).toBe(true);
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
|
||||
});
|
||||
|
||||
test('[XAT-17121] Matching phrases should be highlighted in the file content for search results', async ({ searchPage }) => {
|
||||
await searchPage.searchWithin(fileContent, 'files');
|
||||
expect(await searchPage.dataTable.hasHighlightedText('content')).toBeTruthy();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBeFalsy();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
expect(await searchPage.dataTable.hasHighlightedText('content')).toBe(true);
|
||||
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
@@ -36,6 +36,7 @@ import {
|
||||
SortByType
|
||||
} from '@alfresco/aca-playwright-shared';
|
||||
|
||||
test.use({ launchOptions: { slowMo: 500 } });
|
||||
test.describe('Search sorting', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
@@ -57,6 +58,11 @@ test.describe('Search sorting', () => {
|
||||
source: TEST_FILES.PDF.path
|
||||
};
|
||||
|
||||
const fileJpgBudget = {
|
||||
name: `budget.xls`,
|
||||
source: TEST_FILES.XLSX.path
|
||||
};
|
||||
|
||||
let nodesApi1: NodesApi;
|
||||
let trashcanApi1: TrashcanApi;
|
||||
let fileActionsApi1: FileActionsApi;
|
||||
@@ -86,6 +92,7 @@ test.describe('Search sorting', () => {
|
||||
|
||||
await fileActionsApi1.uploadFileWithRename(fileJpg.source, fileJpg.name, parentId);
|
||||
await fileActionsApi2.uploadFileWithRename(filePdf.source, filePdf.name, parentId, filePdf.title, filePdf.description);
|
||||
await fileActionsApi1.uploadFileWithRename(fileJpgBudget.source, fileJpgBudget.name, parentId);
|
||||
|
||||
await fileActionsApi1.waitForNodes(fileJpg.name, { expect: 1 });
|
||||
await fileActionsApi2.waitForNodes(filePdf.name, { expect: 1 });
|
||||
@@ -105,10 +112,16 @@ test.describe('Search sorting', () => {
|
||||
sortBy: SortByType,
|
||||
sortOrder: SortByDirection,
|
||||
expectedFirstFile: string,
|
||||
expectedSecondFile: string
|
||||
expectedSecondFile: string,
|
||||
searchTerm?: string
|
||||
) {
|
||||
await searchPage.searchWithin(`*${random}*`, 'files');
|
||||
if (searchTerm) {
|
||||
await searchPage.searchWithin(searchTerm, 'files');
|
||||
} else {
|
||||
await searchPage.searchWithin(`*${random}*`, 'files');
|
||||
}
|
||||
await searchPage.searchSortingPicker.sortBy(sortBy, sortOrder);
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
expect(await searchPage.dataTable.getNthRow(0).textContent()).toContain(expectedFirstFile);
|
||||
expect(await searchPage.dataTable.getNthRow(1).textContent()).toContain(expectedSecondFile);
|
||||
}
|
||||
@@ -130,7 +143,9 @@ test.describe('Search sorting', () => {
|
||||
});
|
||||
|
||||
test(`[XAT-5571] Sort by Modified date`, async ({ searchPage }) => {
|
||||
await testSearchSorting(searchPage, 'Modified date' as SortByType, 'asc', fileJpg.name, filePdf.name);
|
||||
const budgetFileOld = 'budget.xls ( Web Site Design - Budget )';
|
||||
const budgetFileNew = 'budget.xls';
|
||||
await testSearchSorting(searchPage, 'Modified date' as SortByType, 'asc', budgetFileOld, budgetFileNew, budgetFileNew);
|
||||
});
|
||||
|
||||
test(`[XAT-5567] Sort by Relevance`, async ({ searchPage }) => {
|
||||
|
Reference in New Issue
Block a user