mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[MNT-25478] Add Information dialog for nodes and dialog for additional location references (#5041)
* [MNT-25478] Add Information dialog for nodes and dialog for additional location references * [MNT-25478] CR fixes * [MNT-25478] CR fixes * [MNT-25478] Unit test fix * [MNT-25478] E2E locator fixes * [MNT-25478] E2E locator fixes * [MMNT-25478] Add cm:contains to secondary parents API call * [MMNT-25478] Small fix * [MNT-25478] First e2e fixes * more fixes for e2es * last e2e fixes --------- Co-authored-by: Adam Świderski <adam.tomasz.swiderski@gmail.com>
This commit is contained in:
co-authored by
Adam Świderski
parent
0f7bd89263
commit
4204745227
+1
-1
@@ -253,7 +253,7 @@ export class DataTableComponent extends BaseComponent {
|
||||
}
|
||||
|
||||
async getItemLocationText(name: string): Promise<string> {
|
||||
await this.getItemLocationEl(name).locator('a').waitFor({ state: 'attached' });
|
||||
await this.getItemLocationEl(name).waitFor({ state: 'attached' });
|
||||
return this.getItemLocationEl(name).innerText();
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -32,19 +32,19 @@ export class FolderInformationDialogComponent extends BaseComponent {
|
||||
super(page, FolderInformationDialogComponent.rootElement);
|
||||
}
|
||||
|
||||
folderName = this.getChild('.aca-folder-info-header');
|
||||
folderName = this.getChild('.aca-node-info-header');
|
||||
doneButton = this.getChild('[data-automation-id="adf-dialog-actions-confirm"]');
|
||||
folderNumberOfFiles = this.getChild('[data-automation-id="folder-info-number-of-files"]');
|
||||
folderSize = this.getChild('[data-automation-id="folder-info-size"]');
|
||||
folderLocation = this.getChild('[data-automation-id="folder-info-location"]');
|
||||
folderCreationDate = this.getChild('[data-automation-id="folder-info-creation-date"]');
|
||||
folderModifiedDate = this.getChild('[data-automation-id="folder-info-modify-date"]');
|
||||
folderNumberOfFiles = this.getChild('[data-automation-id="node-info-number-of-files"]');
|
||||
folderSize = this.getChild('[data-automation-id="node-info-size"]');
|
||||
folderLocation = this.getChild('[data-automation-id="node-info-location"]');
|
||||
folderCreationDate = this.getChild('[data-automation-id="node-info-creation-date"]');
|
||||
folderModifiedDate = this.getChild('[data-automation-id="node-info-modify-date"]');
|
||||
|
||||
async getFolderSizeNumber(): Promise<number> {
|
||||
const textContent = await this.folderSize.textContent();
|
||||
if (!textContent) {
|
||||
throw new Error('Folder size text content is null or undefined');
|
||||
}
|
||||
return parseInt(textContent.split(' ')[0].replace(/,/g, ''), 10);
|
||||
return parseFloat(textContent.trim().split(/\s+/)[0].replace(/,/g, ''));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-70
@@ -23,23 +23,11 @@
|
||||
*/
|
||||
|
||||
import { BaseComponent } from '../../base.component';
|
||||
import { Page, expect } from '@playwright/test';
|
||||
import { SearchPage, SearchType } from '../../../pages';
|
||||
import { Page } from '@playwright/test';
|
||||
import { SearchPage } from '../../../pages';
|
||||
|
||||
type FilterTab = 'Created' | 'Modified';
|
||||
|
||||
interface FilterFilesByDateParams {
|
||||
searchPage: SearchPage;
|
||||
filterType: 'anytime' | 'inTheLast' | 'between';
|
||||
dateFilterTab: FilterTab;
|
||||
searchPhrase: string;
|
||||
searchType: SearchType;
|
||||
expectSearchResults: number;
|
||||
inTheLastInputValue?: string;
|
||||
startDay?: string;
|
||||
endDay?: string;
|
||||
}
|
||||
|
||||
export class SearchFiltersDate extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
@@ -75,62 +63,6 @@ export class SearchFiltersDate extends BaseComponent {
|
||||
await page.page.waitForTimeout(2000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used in cases where we want to filter search results by Date
|
||||
*
|
||||
* @param searchPage page context for the test
|
||||
* @param filterType filter type for the Date filter
|
||||
* @param dateFilterTab tab in Date filter. Either Created or Modified
|
||||
* @param searchPhrase search phrase for the search
|
||||
* @param searchType type of items we want in search results e.g. files or folders
|
||||
* @param expectSearchResults expect a number of search results
|
||||
* @param inTheLastInputValue a value for 'in the last' input. e.g. in the last X days
|
||||
* @param startDay start day for time-frame search. DD-MMMM-YY
|
||||
* @param endDay end day for time-frame search. DD-MMMM-YY
|
||||
*/
|
||||
async filterFilesByDate(params: FilterFilesByDateParams) {
|
||||
const { searchPage, filterType, dateFilterTab, searchPhrase, searchType, expectSearchResults, inTheLastInputValue, startDay, endDay } = params;
|
||||
|
||||
await searchPage.searchWithin(searchPhrase, searchType);
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
await searchPage.searchFilters.dateFilter.click();
|
||||
|
||||
if (dateFilterTab === 'Modified') {
|
||||
await searchPage.searchFiltersDate.openCreatedModifiedTab(searchPage, 'Modified');
|
||||
}
|
||||
|
||||
switch (filterType) {
|
||||
case 'anytime':
|
||||
await searchPage.searchFiltersDate.anytimeButton.click();
|
||||
break;
|
||||
case 'inTheLast':
|
||||
await searchPage.searchFiltersDate.inTheLastButton.click();
|
||||
await searchPage.searchFiltersDate.inTheLastInput.fill(inTheLastInputValue);
|
||||
break;
|
||||
case 'between':
|
||||
await searchPage.searchFiltersDate.betweenButton.click();
|
||||
await searchPage.searchFiltersDate.betweenStartDate.fill(startDay);
|
||||
await searchPage.searchFiltersDate.betweenEndDate.fill(endDay);
|
||||
break;
|
||||
default:
|
||||
throw new Error('Invalid filter type');
|
||||
}
|
||||
|
||||
await searchPage.searchFilters.menuCardApply.click();
|
||||
await searchPage.dataTable.progressBarWaitForReload();
|
||||
expect(await searchPage.dataTable.getRowsCount()).toEqual(expectSearchResults);
|
||||
|
||||
let dateText: string;
|
||||
if (filterType === 'between') {
|
||||
if (dateFilterTab === 'Modified') {
|
||||
dateText = `Modified: ${startDay} - ${endDay}`;
|
||||
} else {
|
||||
dateText = `Created: ${startDay} - ${endDay}`;
|
||||
}
|
||||
await expect(searchPage.searchFilters.dateFilter).toContainText(dateText, { ignoreCase: true });
|
||||
}
|
||||
}
|
||||
|
||||
async isModifiedTabSelected(): Promise<string> {
|
||||
return this.modifiedTab.getAttribute('aria-selected');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user