[ACS-6140] reduce access to internal material classes (#9053)

* cleanup login (demo shell)

* cleanup e2e from useless calls

* [ci:force] cleanup e2e from useless calls

* [ci:force] cleanup e2e from useless calls

* [ci:force] improved uploader selectors

* [ci:force] remove useless selectors when automation id provided

* [ci:force] improved tests and selectors

* [ci:force] improved tests and selectors

* [ci:force] improved tests and selectors

* [ci:force] improved tests and selectors

* [ci:force] improved tests and selectors

* [ci:force] improved tests and selectors

* [ci:force] switch edit task filter to angular harness

* [ci:force] switch edit process filter to angular harness

* [ci:force] switch search chip list to angular harness

* [ci:force] switch search panel to angular harness

* [ci:force] switch search radio to angular harness

* [ci:force] switch search text to angular harness

* [ci:force] search logical filter

* [ci:force] search form component

* [ci:force] search filter container

* [ci:force] fix viewer test

* [ci:force] search facet chip harness

* [ci:force] search facet chip harness

* [ci:force] dropdown breadcrumb

* [ci:force] search check list

* [ci:force] folder dialog

* [ci:force] search filter component

* [ci:force] json cell

* [ci:force] amount widget

* [ci:force] checkbox widget

* [ci:force] multiline-text widget

* [ci:force] number widget

* [ci:force] text widget

* [ci:force] card view array item

* add permission dialog

* permission container component

* permission list component

* card view components

* search widget chip

* search facet chip

* edit service task filter

* card view components

* sites dropdown

* share dialog

* header component

* datetime widget

* remove comments
This commit is contained in:
Denys Vuika
2023-11-03 10:05:34 +00:00
committed by GitHub
parent 9278d9296f
commit 93fd0bec6c
62 changed files with 2335 additions and 2660 deletions

View File

@@ -139,7 +139,6 @@ describe('Upload component', () => {
it('[C260172] Should be possible to enable versioning', async () => {
await uploadToggles.enableVersioning();
await uploadToggles.checkVersioningToggleIsEnabled();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
@@ -164,7 +163,6 @@ describe('Upload component', () => {
await contentServicesPage.goToDocumentList();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('400');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
@@ -190,7 +188,6 @@ describe('Upload component', () => {
it('[C272796] Should be possible to set max size to 0', async () => {
await contentServicesPage.goToDocumentList();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('0');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
@@ -207,7 +204,6 @@ describe('Upload component', () => {
it('[C272797] Should be possible to set max size to 1', async () => {
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await browser.sleep(1000);
await uploadToggles.addMaxSize('1');
await uploadToggles.disableMaxSize();

View File

@@ -19,21 +19,19 @@ import { by, browser, ElementFinder, $, $$ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class UploadDialogPage {
closeButton = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]');
closeButton = $('#adf-upload-dialog-close');
dialog = $('div[id="upload-dialog"]');
minimizedDialog = $('div[class*="upload-dialog--minimized"]');
uploadedStatusIcon = 'mat-icon[class*="status--done"]';
uploadedStatusIcon = '.adf-file-uploading-row__status--done';
cancelledStatusIcon = 'div[class*="status--cancelled"]';
errorStatusIcon = 'div[class*="status--error"] mat-icon';
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
title = $('span[class*="upload-dialog__title"]');
minimizeButton = $('mat-icon[title="Minimize"]');
maximizeButton = $('mat-icon[title="Maximize"]');
toggleMinimizeButton = $(`[data-automation-id='adf-upload-dialog__toggle-minimize']`);
async clickOnCloseButton(): Promise<void> {
await this.checkCloseButtonIsDisplayed();
await BrowserActions.clickExecuteScript('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]');
await BrowserActions.click(this.closeButton);
}
async checkCloseButtonIsDisplayed(): Promise<void> {
@@ -107,11 +105,11 @@ export class UploadDialogPage {
}
async minimizeUploadDialog(): Promise<void> {
await BrowserActions.click(this.minimizeButton);
await BrowserActions.click(this.toggleMinimizeButton);
}
async maximizeUploadDialog(): Promise<void> {
await BrowserActions.click(this.maximizeButton);
await BrowserActions.click(this.toggleMinimizeButton);
}
async displayTooltip(): Promise<void> {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { $, browser } from 'protractor';
import { $ } from 'protractor';
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
export class UploadTogglesPage {
@@ -25,16 +25,14 @@ export class UploadTogglesPage {
extensionFilterToggle = $('#adf-extension-filter-upload-switch');
maxSizeToggle = $('#adf-max-size-filter-upload-switch');
versioningToggle = $('#adf-version-upload-switch');
extensionAcceptedField = $('input[data-automation-id="accepted-files-type"]');
maxSizeField = $('input[data-automation-id="max-files-size"]');
extensionAcceptedField = $('[data-automation-id="accepted-files-type"]');
maxSizeField = $('[data-automation-id="max-files-size"]');
async enableMultipleFileUpload(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
await this.togglePage.enableToggle(this.multipleFileUploadToggle);
}
async disableMultipleFileUpload(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
await this.togglePage.disableToggle(this.multipleFileUploadToggle);
}
@@ -42,23 +40,11 @@ export class UploadTogglesPage {
await this.togglePage.enableToggle(this.uploadFolderToggle);
}
async checkMaxSizeToggleIsEnabled(): Promise<void> {
const enabledToggle = $('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]');
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
}
async checkVersioningToggleIsEnabled(): Promise<void> {
const enabledToggle = $('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]');
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
}
async enableExtensionFilter(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
await this.togglePage.enableToggle(this.extensionFilterToggle);
}
async disableExtensionFilter(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
await this.togglePage.disableToggle(this.extensionFilterToggle);
}

View File

@@ -46,9 +46,9 @@ export class MetadataViewPage {
resetMetadataButton = $(`[data-automation-id='reset-metadata']`);
private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> =>
$(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"]`);
$(`[data-automation-id="adf-metadata-group-${groupName}"]`);
private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> =>
$(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"] > mat-expansion-panel-header`);
$(`[data-automation-id="adf-metadata-group-${groupName}"] > mat-expansion-panel-header`);
async getTitle(): Promise<string> {
return BrowserActions.getText(this.title);

View File

@@ -73,7 +73,7 @@ export class TaskDetailsPage {
}
async checkDueDatePickerButtonIsNotDisplayed(): Promise<void> {
const dueDatePickerButton = $('mat-datetimepicker-toggle[data-automation-id="datepickertoggle-dueDate"]');
const dueDatePickerButton = $('[data-automation-id="datepickertoggle-dueDate"]');
await BrowserVisibility.waitUntilElementIsNotVisible(dueDatePickerButton);
}

View File

@@ -19,7 +19,6 @@ import { ElementFinder, protractor, $ } from 'protractor';
import { BrowserVisibility, BrowserActions, TestElement } from '@alfresco/adf-testing';
export class SearchBarPage {
searchIcon = $(`button[class*='adf-search-button']`);
searchBar = $(`adf-search-control input`);
searchBarExpanded: TestElement = TestElement.byCss(`adf-search-control mat-form-field[class*="mat-focused"] input`);
@@ -29,7 +28,7 @@ export class SearchBarPage {
highlightName = `.adf-highlight`;
searchBarPage = $(`mat-list[id='autocomplete-search-result-list']`);
getRowByRowName = (name: string): ElementFinder => $(`mat-list-item[data-automation-id='autocomplete_for_${name}']`);
getRowByRowName = (name: string): ElementFinder => $(`[data-automation-id='autocomplete_for_${name}']`);
async clickOnSearchIcon(): Promise<void> {
await BrowserActions.click(this.searchIcon);

View File

@@ -15,29 +15,38 @@
* limitations under the License.
*/
import { BrowserVisibility, DateRangeFilterPage, NumberRangeFilterPage, SearchCategoriesPage, SearchCheckListPage, SearchRadioPage, SearchSliderPage, SearchTextPage } from '@alfresco/adf-testing';
import {
BrowserVisibility,
DateRangeFilterPage,
NumberRangeFilterPage,
SearchCategoriesPage,
SearchCheckListPage,
SearchRadioPage,
SearchSliderPage,
SearchTextPage
} from '@alfresco/adf-testing';
import { $, by } from 'protractor';
export class SearchFiltersPage {
searchCategoriesPage: SearchCategoriesPage = new SearchCategoriesPage();
searchFilters = $('adf-search-filter');
fileTypeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.TYPE"]');
creatorFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FILTER.PEOPLE"]');
fileSizeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.SIZE"]');
nameFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Name"]');
checkListFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Check List"]');
createdDateRangeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Created Date (range)"]');
typeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Type"]');
sizeRangeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Content Size (range)"]');
sizeSliderFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Content Size"]');
facetQueriesDefaultGroup = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_QUERIES.MY_FACET_QUERIES"],' +
'mat-expansion-panel[data-automation-id="expansion-panel-My facet queries"]');
facetQueriesTypeGroup = $('mat-expansion-panel[data-automation-id="expansion-panel-Type facet queries"]');
facetQueriesSizeGroup = $('mat-expansion-panel[data-automation-id="expansion-panel-Size facet queries"]');
facetIntervalsByCreated = $('mat-expansion-panel[data-automation-id="expansion-panel-The Created"]');
facetIntervalsByModified = $('mat-expansion-panel[data-automation-id="expansion-panel-TheModified"]');
fileTypeFilter = $('[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.TYPE"]');
creatorFilter = $('[data-automation-id="expansion-panel-SEARCH.FILTER.PEOPLE"]');
fileSizeFilter = $('[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.SIZE"]');
nameFilter = $('[data-automation-id="expansion-panel-Name"]');
checkListFilter = $('[data-automation-id="expansion-panel-Check List"]');
createdDateRangeFilter = $('[data-automation-id="expansion-panel-Created Date (range)"]');
typeFilter = $('[data-automation-id="expansion-panel-Type"]');
sizeRangeFilter = $('[data-automation-id="expansion-panel-Content Size (range)"]');
sizeSliderFilter = $('[data-automation-id="expansion-panel-Content Size"]');
facetQueriesDefaultGroup = $(
'[data-automation-id="expansion-panel-SEARCH.FACET_QUERIES.MY_FACET_QUERIES"],' + '[data-automation-id="expansion-panel-My facet queries"]'
);
facetQueriesTypeGroup = $('[data-automation-id="expansion-panel-Type facet queries"]');
facetQueriesSizeGroup = $('[data-automation-id="expansion-panel-Size facet queries"]');
facetIntervalsByCreated = $('[data-automation-id="expansion-panel-The Created"]');
facetIntervalsByModified = $('[data-automation-id="expansion-panel-TheModified"]');
async checkSearchFiltersIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchFilters);
@@ -72,7 +81,7 @@ export class SearchFiltersPage {
}
async checkCustomFacetFieldLabelIsDisplayed(fieldLabel: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible($(`mat-expansion-panel[data-automation-id="expansion-panel-${fieldLabel}"]`));
await BrowserVisibility.waitUntilElementIsVisible($(`[data-automation-id="expansion-panel-${fieldLabel}"]`));
}
sizeSliderFilterPage(): SearchSliderPage {
@@ -234,5 +243,4 @@ export class SearchFiltersPage {
async checkFileTypeFacetLabelIsNotDisplayed(fileType: string | RegExp): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.fileTypeFilter.element(by.cssContainingText('.adf-facet-label', fileType)));
}
}