mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-11417] lint enable angular eslint prefer inject rule default in ng20 for alfresco apps (#5111)
* [ACS-11417] Enable inject prefer eslint rule * [ACS-11417] Added eslint rule for prefer readonly * [ACS-11417] Fixed unit tests * [ACS-11417] Addressed copilot comments
This commit is contained in:
@@ -26,7 +26,7 @@ import { ApiClientFactory } from './api-client-factory';
|
||||
import { CategoryEntry, CategoryBody, CategoryQuery, CategoryPaging, CategoryLinkBody } from '@alfresco/js-api';
|
||||
|
||||
export class CategoriesApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -27,7 +27,7 @@ import { FavoriteEntry, FavoritePaging } from '@alfresco/js-api';
|
||||
import { Utils } from '../utils';
|
||||
|
||||
export class FavoritesPageApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -28,7 +28,7 @@ import { Utils, waitForApi } from '../utils';
|
||||
import { NodeBodyCreate, NodeEntry, ResultSetPaging, SearchRequest } from '@alfresco/js-api';
|
||||
|
||||
export class FileActionsApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -27,7 +27,7 @@ import { NodeChildAssociationPaging, NodeEntry, NodePaging, NodesIncludeQuery, N
|
||||
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
|
||||
|
||||
export class NodesApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -27,7 +27,7 @@ import { Utils } from '../utils';
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
|
||||
export class QueriesApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -26,7 +26,7 @@ import { ApiClientFactory } from './api-client-factory';
|
||||
import * as crypto from 'crypto';
|
||||
|
||||
export class RulesApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -27,7 +27,7 @@ import { Utils } from '../utils';
|
||||
import { ResultSetPaging } from '@alfresco/js-api';
|
||||
|
||||
export class SearchPageApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -27,7 +27,7 @@ import { SharedLinkEntry, SharedLinkPaging } from '@alfresco/js-api';
|
||||
import { Utils } from '../utils';
|
||||
|
||||
export class SharedLinksApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
} from '@alfresco/js-api';
|
||||
|
||||
export class SitesApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -26,7 +26,7 @@ import { TagBody, TagEntry, TagPaging } from '@alfresco/js-api';
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
|
||||
export class TagsApi {
|
||||
private apiService: ApiClientFactory;
|
||||
private readonly apiService: ApiClientFactory;
|
||||
|
||||
constructor() {
|
||||
this.apiService = new ApiClientFactory();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
|
||||
export class TrashcanApi {
|
||||
private apiService = new ApiClientFactory();
|
||||
private readonly apiService = new ApiClientFactory();
|
||||
|
||||
static async initialize(userName: string, password?: string): Promise<TrashcanApi> {
|
||||
const classObj = new TrashcanApi();
|
||||
|
||||
@@ -27,9 +27,9 @@ import { MatMenuComponent } from './dataTable';
|
||||
import { BaseComponent } from './base.component';
|
||||
|
||||
export class AcaHeader extends BaseComponent {
|
||||
private static rootElement = 'aca-toolbar';
|
||||
private moreActionsButton = this.getChild('button[id="app.viewer.toolbar.more"]');
|
||||
private toolbarMoreActions = this.getChild('button[id="app.toolbar.more"]');
|
||||
private static readonly rootElement = 'aca-toolbar';
|
||||
private readonly moreActionsButton = this.getChild('button[id="app.viewer.toolbar.more"]');
|
||||
private readonly toolbarMoreActions = this.getChild('button[id="app.toolbar.more"]');
|
||||
public createButton = this.getChild('[id="app.toolbar.create"]');
|
||||
public viewDetails = this.getChild('[title="View Details"]');
|
||||
public viewButton = this.getChild('button[title="View"]');
|
||||
|
||||
+13
-12
@@ -60,19 +60,20 @@ export enum MimeType {
|
||||
}
|
||||
|
||||
export class ActionsDropdownComponent extends BaseComponent {
|
||||
private static rootElement = 'aca-edit-rule-dialog aca-rule-action-list';
|
||||
private static readonly rootElement = 'aca-edit-rule-dialog aca-rule-action-list';
|
||||
|
||||
private getOptionLocator = (optionName: string): Locator => this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first();
|
||||
private ruleActionLocator = this.getChild('aca-rule-action');
|
||||
private addActionButtonLocator = this.getChild('[data-automation-id="rule-action-list-add-action-button"]');
|
||||
private actionDropdownLocator = this.getChild('[data-automation-id="rule-action-select"]');
|
||||
private actionAspectNameLocator = '[data-automation-id="header-aspect-name"] .adf-property-field';
|
||||
private actionCheckInInputLocator = '[data-automation-id="header-description"] input';
|
||||
private actionSimpleWorkflowStepInputLocator = '[data-automation-id="header-approve-step"] input';
|
||||
private actionSimpleWorkflowActionChoiceLocator = '[data-automation-id="content-node-selector-actions-choose"]';
|
||||
private actionSimpleWorkflowLabelApproveLocator = `[data-automation-id="card-boolean-label-approve-move"]`;
|
||||
private actionSimpleWorkflowSRejectStepLocator = '[data-automation-id="header-reject-step"] input';
|
||||
private actionSimpleWorkflowRejectFolderLocator = `[data-automation-id="header-reject-folder"] input`;
|
||||
private readonly getOptionLocator = (optionName: string): Locator =>
|
||||
this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first();
|
||||
private readonly ruleActionLocator = this.getChild('aca-rule-action');
|
||||
private readonly addActionButtonLocator = this.getChild('[data-automation-id="rule-action-list-add-action-button"]');
|
||||
private readonly actionDropdownLocator = this.getChild('[data-automation-id="rule-action-select"]');
|
||||
private readonly actionAspectNameLocator = '[data-automation-id="header-aspect-name"] .adf-property-field';
|
||||
private readonly actionCheckInInputLocator = '[data-automation-id="header-description"] input';
|
||||
private readonly actionSimpleWorkflowStepInputLocator = '[data-automation-id="header-approve-step"] input';
|
||||
private readonly actionSimpleWorkflowActionChoiceLocator = '[data-automation-id="content-node-selector-actions-choose"]';
|
||||
private readonly actionSimpleWorkflowLabelApproveLocator = `[data-automation-id="card-boolean-label-approve-move"]`;
|
||||
private readonly actionSimpleWorkflowSRejectStepLocator = '[data-automation-id="header-reject-step"] input';
|
||||
private readonly actionSimpleWorkflowRejectFolderLocator = `[data-automation-id="header-reject-folder"] input`;
|
||||
private readonly actionSimpleWorkflowApproveFolderLocator = `[data-automation-id="header-approve-folder"] [role="img"]`;
|
||||
private readonly actionSpecialiseTypeLocator = '[data-automation-id="header-type-name"] [role="combobox"]';
|
||||
private readonly mimeTypeDropdownLocator = this.getChild('[data-automation-id="select-box"][aria-label="Mimetype *"]');
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { BaseComponent } from './base.component';
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
|
||||
export class AdfInfoDrawerComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-info-drawer';
|
||||
private static readonly rootElement = 'adf-info-drawer';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, AdfInfoDrawerComponent.rootElement);
|
||||
|
||||
@@ -28,7 +28,7 @@ import { timeouts } from '../../utils';
|
||||
|
||||
export abstract class BaseComponent extends PlaywrightBase {
|
||||
private readonly rootElement: string;
|
||||
private progressBar = this.page.locator('[role="progressbar"]');
|
||||
private readonly progressBar = this.page.locator('[role="progressbar"]');
|
||||
|
||||
protected constructor(page: Page, rootElement: string) {
|
||||
super(page);
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
import { BaseComponent } from '.././base.component';
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
export class Breadcrumb extends BaseComponent {
|
||||
private static rootElement = 'adf-breadcrumb';
|
||||
private static readonly rootElement = 'adf-breadcrumb';
|
||||
public items = this.getChild('.adf-breadcrumb-item');
|
||||
public currentItem = this.getChild('.adf-breadcrumb-item-current');
|
||||
getItemByTitle = (name: string): Locator => this.getChild(`.adf-breadcrumb-item[title=${name}]`);
|
||||
|
||||
@@ -43,7 +43,8 @@ export enum Comparator {
|
||||
}
|
||||
|
||||
export class ConditionComponent extends ManageRulesDialogComponent {
|
||||
private getOptionLocator = (optionName: string): Locator => this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first();
|
||||
private readonly getOptionLocator = (optionName: string): Locator =>
|
||||
this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first();
|
||||
|
||||
private async selectField(fields: Partial<Field>, index: number): Promise<void> {
|
||||
await this.fieldDropDown.nth(index).click();
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import { PaginationActionsType, PaginationComponent } from '../pagination.compon
|
||||
import { timeouts } from '../../../utils';
|
||||
|
||||
export class DataTableComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-datatable';
|
||||
private static readonly rootElement = 'adf-datatable';
|
||||
contextMenuActions = new MatMenuComponent(this.page);
|
||||
|
||||
constructor(page: Page, rootElement = DataTableComponent.rootElement) {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { expect, Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class MatMenuComponent extends BaseComponent {
|
||||
private static rootElement = '[role="menu"]';
|
||||
private static readonly rootElement = '[role="menu"]';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, MatMenuComponent.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class DateTimePicker extends BaseComponent {
|
||||
private static rootElement = '[role="dialog"]';
|
||||
private static readonly rootElement = '[role="dialog"]';
|
||||
dayPicker = this.getChild('[role="grid"]');
|
||||
nextMonthBtn = this.getChild('[aria-label="Next month"]');
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class AdfConfirmDialogComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-confirm-dialog';
|
||||
private static readonly rootElement = 'adf-confirm-dialog';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, AdfConfirmDialogComponent.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class AdfFolderDialogComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-folder-dialog';
|
||||
private static readonly rootElement = 'adf-folder-dialog';
|
||||
|
||||
public folderNameInputLocator = this.getChild('[id="adf-folder-name-input"]');
|
||||
public folderNameInputHint = this.getChild('[aria-atomic="true"] span');
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
|
||||
export class AdfLibraryDialogComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-library-dialog';
|
||||
private static readonly rootElement = 'adf-library-dialog';
|
||||
|
||||
public createButton = this.getChild('[data-automation-id="create-library-id"]');
|
||||
public cancelButton = this.getChild('[data-automation-id="cancel-library-id"]');
|
||||
|
||||
+3
-3
@@ -26,9 +26,9 @@ import { Locator, Page, expect } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class ContentNodeSelectorDialog extends BaseComponent {
|
||||
private static rootElement = 'adf-content-node-selector';
|
||||
private selectedRow = this.getChild('.adf-is-selected');
|
||||
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
|
||||
private static readonly rootElement = 'adf-content-node-selector';
|
||||
private readonly selectedRow = this.getChild('.adf-is-selected');
|
||||
private readonly getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
|
||||
|
||||
public cancelButton = this.getChild('[data-automation-id="content-node-selector-actions-cancel"]');
|
||||
public actionButton = this.getChild('[data-automation-id="content-node-selector-actions-choose"]');
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { timeouts } from '../../../utils';
|
||||
|
||||
export class CreateFromTemplateDialogComponent extends BaseComponent {
|
||||
private static rootElement = '.aca-create-from-template-dialog';
|
||||
private static readonly rootElement = '.aca-create-from-template-dialog';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, CreateFromTemplateDialogComponent.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class AdfDeleteTrashComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-confirm-dialog';
|
||||
private static readonly rootElement = 'adf-confirm-dialog';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, AdfDeleteTrashComponent.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class EditDialog extends BaseComponent {
|
||||
private static rootElement = 'adf-folder-dialog';
|
||||
private static readonly rootElement = 'adf-folder-dialog';
|
||||
|
||||
public editDialog = this.page.locator(EditDialog.rootElement);
|
||||
public titleInput = this.getChild('[data-automation-id="adf-folder-dialog-title"]');
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ import { Locator, Page, expect } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class LinkRulesDialog extends BaseComponent {
|
||||
private static rootElement = 'aca-rule-set-picker';
|
||||
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
|
||||
private static readonly rootElement = 'aca-rule-set-picker';
|
||||
private readonly getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
|
||||
|
||||
selectFolderButton = this.getChild('button', { hasText: ' Select folder ' });
|
||||
getOptionLocator = (optionName: string): Locator => this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first();
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class ManageVersionsDialog extends BaseComponent {
|
||||
private static rootElement = '.adf-new-version-uploader-dialog';
|
||||
private static readonly rootElement = '.adf-new-version-uploader-dialog';
|
||||
|
||||
async viewFileVersion(version: string): Promise<void> {
|
||||
const versionActionsButton = this.getChild(`[id="adf-version-list-action-menu-button-${version}"]`);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { timeouts } from '../../../utils';
|
||||
|
||||
export class PasswordOverlayDialogComponent extends BaseComponent {
|
||||
private static rootElement = '.cdk-overlay-pane';
|
||||
private static readonly rootElement = '.cdk-overlay-pane';
|
||||
|
||||
public closeButton = this.getChild('[data-automation-id="adf-password-dialog-close"]');
|
||||
public submitButton = this.getChild('[data-automation-id="adf-password-dialog-submit"]');
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import { timeouts } from '../../../utils';
|
||||
import { DateTimePicker } from '../datetime-picker/datetime-picker.component';
|
||||
|
||||
export class ShareDialogComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-share-dialog';
|
||||
private static readonly rootElement = 'adf-share-dialog';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, ShareDialogComponent.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class UploadDialog extends BaseComponent {
|
||||
private static rootElement = 'aca-upload-files-dialog';
|
||||
private static readonly rootElement = 'aca-upload-files-dialog';
|
||||
|
||||
public uploadDialogContent = this.getChild('.adf-upload-dialog__content');
|
||||
public closeButton = this.getChild('#adf-upload-dialog-close');
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class UploadNewVersionDialog extends BaseComponent {
|
||||
private static rootElement = 'adf-new-version-uploader-dialog';
|
||||
private static readonly rootElement = 'adf-new-version-uploader-dialog';
|
||||
|
||||
public cancelButton = this.getChild('#adf-new-version-cancel');
|
||||
public uploadButton = this.getChild('[data-automation-id="adf-new-version-file-upload"]');
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { timeouts } from '../../../utils';
|
||||
|
||||
export class ViewerOverlayDialogComponent extends BaseComponent {
|
||||
private static rootElement = '.cdk-overlay-pane';
|
||||
private static readonly rootElement = '.cdk-overlay-pane';
|
||||
|
||||
public copyDialog = this.getChild('[data-automation-id="content-node-selector-title"]');
|
||||
public copyMenuButton = this.getChild('[id="app.viewer.copy"]');
|
||||
|
||||
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from './base.component';
|
||||
|
||||
export class ErrorComponent extends BaseComponent {
|
||||
private static rootElement = 'aca-page-layout';
|
||||
private static readonly rootElement = 'aca-page-layout';
|
||||
genericError = this.getChild('aca-generic-error');
|
||||
genericErrorTitle = this.getChild('.generic-error__title');
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class ManageRulesDialogComponent extends BaseComponent {
|
||||
private static rootElement = 'aca-edit-rule-dialog';
|
||||
private static readonly rootElement = 'aca-edit-rule-dialog';
|
||||
|
||||
public createRuleButton = this.getChild('[data-automation-id="edit-rule-dialog-submit"]');
|
||||
public cancelRuleButton = this.getChild('.aca-edit-rule-dialog__footer button').filter({ hasText: 'Cancel' });
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Locator, Page, expect } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class ManageRules extends BaseComponent {
|
||||
private static rootElement = '.aca-manage-rules';
|
||||
private static readonly rootElement = '.aca-manage-rules';
|
||||
|
||||
public getGroupsList = (optionName: string): Locator => this.getChild('.aca-rule-list-item__header', { hasText: optionName });
|
||||
public ruleToggle = this.getChild('.aca-manage-rules__container [role="switch"]').first();
|
||||
|
||||
@@ -33,19 +33,19 @@ export enum PaginationActionsType {
|
||||
}
|
||||
|
||||
export class PaginationComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-pagination';
|
||||
private static readonly rootElement = 'adf-pagination';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, PaginationComponent.rootElement);
|
||||
}
|
||||
|
||||
private range = this.getChild('.adf-pagination__range');
|
||||
private maxItems = this.getChild('.adf-pagination__max-items');
|
||||
private currentPage = this.getChild('.adf-pagination__current-page');
|
||||
private totalPages = this.getChild('.adf-pagination__total-pages');
|
||||
private previousButton = this.getChild('.adf-pagination__previous-button');
|
||||
private nextButton = this.getChild('.adf-pagination__next-button');
|
||||
private maxItemsButton = this.getChild('.adf-pagination__max-items + button[mat-icon-button]');
|
||||
private readonly range = this.getChild('.adf-pagination__range');
|
||||
private readonly maxItems = this.getChild('.adf-pagination__max-items');
|
||||
private readonly currentPage = this.getChild('.adf-pagination__current-page');
|
||||
private readonly totalPages = this.getChild('.adf-pagination__total-pages');
|
||||
private readonly previousButton = this.getChild('.adf-pagination__previous-button');
|
||||
private readonly nextButton = this.getChild('.adf-pagination__next-button');
|
||||
private readonly maxItemsButton = this.getChild('.adf-pagination__max-items + button[mat-icon-button]');
|
||||
|
||||
public currentPageLocator = this.getChild('.adf-pagination__current-page');
|
||||
public totalPageLocator = this.getChild('.adf-pagination__total-pages');
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { BaseComponent } from '../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class SearchFilters extends BaseComponent {
|
||||
private static rootElement = '.aca-content__advanced-filters';
|
||||
private static readonly rootElement = '.aca-content__advanced-filters';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFilters.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { BaseComponent } from '../../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class SearchFiltersCategories extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
private static readonly rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFiltersCategories.rootElement);
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import { SearchPage } from '../../../pages';
|
||||
type FilterTab = 'Created' | 'Modified';
|
||||
|
||||
export class SearchFiltersDate extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
private static readonly rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFiltersDate.rootElement);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../../base.component';
|
||||
import { Page, Locator } from '@playwright/test';
|
||||
|
||||
export class SearchFiltersLocation extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
private static readonly rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFiltersLocation.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { BaseComponent } from '../../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class SearchFiltersLogic extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
private static readonly rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFiltersLogic.rootElement);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../../base.component';
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class SearchFiltersProperties extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
private static readonly rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFiltersProperties.rootElement);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import { BaseComponent } from '../../base.component';
|
||||
import { Page, Locator } from '@playwright/test';
|
||||
|
||||
export class SearchFiltersTags extends BaseComponent {
|
||||
private static rootElement = '.adf-search-filter-menu-card';
|
||||
private static readonly rootElement = '.adf-search-filter-menu-card';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchFiltersTags.rootElement);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Locator, Page } from '@playwright/test';
|
||||
import { BaseComponent } from '.././base.component';
|
||||
|
||||
export class SearchInputComponent extends BaseComponent {
|
||||
private static rootElement = 'aca-page-layout';
|
||||
private static readonly rootElement = 'aca-page-layout';
|
||||
public searchInput = this.getChild('aca-search-input input');
|
||||
public searchButton = this.page.locator('.aca-search-input--search-button');
|
||||
public searchCloseButton = this.page.locator('.aca-search-input--close-button');
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ export type SortByType = 'Relevance' | 'Title' | 'Filename' | 'Modified date' |
|
||||
export type SortByDirection = 'asc' | 'desc';
|
||||
|
||||
export class SearchSortingPicker extends BaseComponent {
|
||||
private static rootElement = '#aca-button-action-menu';
|
||||
private static readonly rootElement = '#aca-button-action-menu';
|
||||
|
||||
public actionMenu = this.page.locator('[data-automation-id="auto_header_content_id_$thumbnail"]');
|
||||
public sortOrderButton = this.page.locator('#aca-button-sorting-menu');
|
||||
|
||||
@@ -27,17 +27,17 @@ import { BaseComponent } from './base.component';
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
|
||||
export class SidenavComponent extends BaseComponent {
|
||||
private static rootElement = '.adf-layout-container-sidenav';
|
||||
private static readonly rootElement = '.adf-layout-container-sidenav';
|
||||
|
||||
private personalFiles = this.getChild(`[data-automation-id='app.navbar.personalFiles']`);
|
||||
private myLibraries = this.getChild(`[data-automation-id='app.navbar.libraries.files']`);
|
||||
private favoriteLibraries = this.getChild(`[data-automation-id='app.navbar.libraries.favorite']`);
|
||||
private shared = this.getChild(`[data-automation-id='app.navbar.shared']`);
|
||||
private recentFiles = this.getChild(`[data-automation-id='app.navbar.recentFiles']`);
|
||||
private favorites = this.getChild(`[data-automation-id='app.navbar.favorites']`);
|
||||
private trash = this.getChild(`[data-automation-id='app.navbar.trashcan']`);
|
||||
private sidenavToggle = this.getChild(`.aca-sidenav-header-title-logo`);
|
||||
private sidenavExpand = this.page.locator(`[title='Expand navigation menu']`);
|
||||
private readonly personalFiles = this.getChild(`[data-automation-id='app.navbar.personalFiles']`);
|
||||
private readonly myLibraries = this.getChild(`[data-automation-id='app.navbar.libraries.files']`);
|
||||
private readonly favoriteLibraries = this.getChild(`[data-automation-id='app.navbar.libraries.favorite']`);
|
||||
private readonly shared = this.getChild(`[data-automation-id='app.navbar.shared']`);
|
||||
private readonly recentFiles = this.getChild(`[data-automation-id='app.navbar.recentFiles']`);
|
||||
private readonly favorites = this.getChild(`[data-automation-id='app.navbar.favorites']`);
|
||||
private readonly trash = this.getChild(`[data-automation-id='app.navbar.trashcan']`);
|
||||
private readonly sidenavToggle = this.getChild(`.aca-sidenav-header-title-logo`);
|
||||
private readonly sidenavExpand = this.page.locator(`[title='Expand navigation menu']`);
|
||||
public expandedSidenav = this.getChild(`[data-automation-id='expanded']`);
|
||||
|
||||
constructor(page: Page) {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { Page, expect } from '@playwright/test';
|
||||
import { BaseComponent } from '../base.component';
|
||||
|
||||
export class SnackBarComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-snackbar-content';
|
||||
private static readonly rootElement = 'adf-snackbar-content';
|
||||
|
||||
public message = this.getChild('[data-automation-id="adf-snackbar-message-content"]').first();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import { Page } from '@playwright/test';
|
||||
import { BaseComponent } from './base.component';
|
||||
|
||||
export class SpinnerComponent extends BaseComponent {
|
||||
private static rootElement = '[role="progressbar"]';
|
||||
private static readonly rootElement = '[role="progressbar"]';
|
||||
|
||||
constructor(page: Page, rootElement = SpinnerComponent.rootElement) {
|
||||
super(page, rootElement);
|
||||
|
||||
@@ -28,7 +28,7 @@ import { AcaHeader } from './aca-header.component';
|
||||
import { timeouts } from '../../utils';
|
||||
|
||||
export class ViewerComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-viewer';
|
||||
private static readonly rootElement = 'adf-viewer';
|
||||
|
||||
public viewerLocator = this.getChild('adf-viewer-render');
|
||||
public closeButtonLocator = this.getChild('.adf-viewer-close-button');
|
||||
|
||||
@@ -29,7 +29,7 @@ import { AcaHeader } from '../components/aca-header.component';
|
||||
import { AdfConfirmDialogComponent, AdfFolderDialogComponent, ViewerOverlayDialogComponent } from '../components/dialogs';
|
||||
|
||||
export class FavoritesLibrariesPage extends BasePage {
|
||||
private static pageUrl = 'favorite/libraries';
|
||||
private static readonly pageUrl = 'favorite/libraries';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, FavoritesLibrariesPage.pageUrl);
|
||||
|
||||
@@ -37,7 +37,7 @@ import { AcaHeader } from '../components/aca-header.component';
|
||||
import { AdfFolderDialogComponent, ViewerOverlayDialogComponent, ManageVersionsDialog } from '../components/dialogs';
|
||||
|
||||
export class FavoritesPage extends BasePage {
|
||||
private static pageUrl = 'favorites';
|
||||
private static readonly pageUrl = 'favorites';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, FavoritesPage.pageUrl);
|
||||
|
||||
@@ -31,7 +31,7 @@ interface LoginOptions {
|
||||
withNavigation?: boolean;
|
||||
}
|
||||
export class LoginPage extends BasePage {
|
||||
private static pageUrl = 'login';
|
||||
private static readonly pageUrl = 'login';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, LoginPage.pageUrl);
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
} from '../components';
|
||||
|
||||
export class MyLibrariesPage extends BasePage {
|
||||
private static pageUrl = 'libraries';
|
||||
private static readonly pageUrl = 'libraries';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, MyLibrariesPage.pageUrl);
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
import { BasePage } from './base.page';
|
||||
|
||||
export class NodesPage extends BasePage {
|
||||
private static pageUrl = 'nodes';
|
||||
private static readonly pageUrl = 'nodes';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, NodesPage.pageUrl);
|
||||
|
||||
@@ -50,7 +50,7 @@ import {
|
||||
} from '../components';
|
||||
|
||||
export class PersonalFilesPage extends BasePage {
|
||||
private static pageUrl = 'personal-files';
|
||||
private static readonly pageUrl = 'personal-files';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, PersonalFilesPage.pageUrl);
|
||||
|
||||
@@ -29,7 +29,7 @@ import { AcaHeader } from '../components/aca-header.component';
|
||||
import { AdfFolderDialogComponent, ContentNodeSelectorDialog, ManageVersionsDialog } from '../components/dialogs';
|
||||
|
||||
export class RecentFilesPage extends BasePage {
|
||||
private static pageUrl = 'recent-files';
|
||||
private static readonly pageUrl = 'recent-files';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, RecentFilesPage.pageUrl);
|
||||
|
||||
@@ -48,7 +48,7 @@ import { SearchInDialogComponent } from '../components/search/search-in-dialog.c
|
||||
export type SearchType = 'files' | 'folders' | 'filesAndFolders' | 'libraries';
|
||||
|
||||
export class SearchPage extends BasePage {
|
||||
private static pageUrl = 'search';
|
||||
private static readonly pageUrl = 'search';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SearchPage.pageUrl);
|
||||
|
||||
@@ -29,7 +29,7 @@ import { AcaHeader } from '../components/aca-header.component';
|
||||
import { AdfFolderDialogComponent, ViewerOverlayDialogComponent, ManageVersionsDialog } from '../components/dialogs';
|
||||
|
||||
export class SharedPage extends BasePage {
|
||||
private static pageUrl = 'shared';
|
||||
private static readonly pageUrl = 'shared';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, SharedPage.pageUrl);
|
||||
|
||||
@@ -29,7 +29,7 @@ import { AcaHeader } from '../components/aca-header.component';
|
||||
import { AdfFolderDialogComponent, ViewerOverlayDialogComponent, AdfDeleteTrashComponent } from '../components/dialogs';
|
||||
|
||||
export class TrashPage extends BasePage {
|
||||
private static pageUrl = 'trashcan';
|
||||
private static readonly pageUrl = 'trashcan';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, TrashPage.pageUrl);
|
||||
|
||||
Reference in New Issue
Block a user