diff --git a/e2e/playwright/tests/folder-rules/tests/actions.spec.ts b/e2e/playwright/tests/folder-rules/tests/actions.spec.ts index 01a6039b70..eaa125516b 100644 --- a/e2e/playwright/tests/folder-rules/tests/actions.spec.ts +++ b/e2e/playwright/tests/folder-rules/tests/actions.spec.ts @@ -23,7 +23,6 @@ */ import { test } from '../fixtures/page-initialization'; -import { NodeBodyCreate } from '@alfresco/aca-testing-shared'; import { ActionType } from '../page-objects/components/actions-dropdown.component'; import { expect } from '@playwright/test'; @@ -34,7 +33,8 @@ test.describe('Folder Rules Actions', () => { let folderId: string; test.beforeAll(async ({ apiClient }) => { - folderId = (await apiClient.nodes.createNode('-my-', new NodeBodyCreate(randomFolderName, 'cm:folder'))).entry.id; + const node = await apiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' }); + folderId = node.entry.id; }); test.beforeEach(async ({ personalFiles }) => { diff --git a/e2e/playwright/tests/folder-rules/tests/conditions.spec.ts b/e2e/playwright/tests/folder-rules/tests/conditions.spec.ts index d534bb28e5..ac1f6e0222 100644 --- a/e2e/playwright/tests/folder-rules/tests/conditions.spec.ts +++ b/e2e/playwright/tests/folder-rules/tests/conditions.spec.ts @@ -23,7 +23,6 @@ */ import { test } from '../fixtures/page-initialization'; -import { NodeBodyCreate } from '@alfresco/aca-testing-shared'; import { ActionType } from '../page-objects/components/actions-dropdown.component'; import { Comparator, Field } from '../page-objects/components/conditions.component'; import { expect } from '@playwright/test'; @@ -36,7 +35,8 @@ test.describe('Folder Rules Conditions', () => { let folderId: string; test.beforeAll(async ({ apiClient }) => { - folderId = (await apiClient.nodes.createNode('-my-', new NodeBodyCreate(randomFolderName, 'cm:folder'))).entry.id; + const node = await apiClient.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' }); + folderId = node.entry.id; }); test.beforeEach(async ({ personalFiles }) => { diff --git a/e2e/playwright/tests/folder-rules/tests/manage-rules.spec.ts b/e2e/playwright/tests/folder-rules/tests/manage-rules.spec.ts index 5736b07bed..0c18c6106d 100644 --- a/e2e/playwright/tests/folder-rules/tests/manage-rules.spec.ts +++ b/e2e/playwright/tests/folder-rules/tests/manage-rules.spec.ts @@ -23,7 +23,6 @@ */ import { test } from '../fixtures/page-initialization'; -import { NodeBodyCreate } from '@alfresco/aca-testing-shared'; test.describe('Rules - Manage Rules', () => { const randomName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`; @@ -32,7 +31,8 @@ test.describe('Rules - Manage Rules', () => { let folderId: string; test.beforeAll(async ({ apiClient }) => { - folderId = (await apiClient.nodes.createNode('-my-', new NodeBodyCreate(randomName, 'cm:folder'))).entry.id; + const node = await apiClient.nodes.createNode('-my-', { name: randomName, nodeType: 'cm:folder', relativePath: '/' }); + folderId = node.entry.id; await apiClient.createRandomRule(folderId, randomRuleName); }); diff --git a/e2e/suites/viewer/viewer-actions.test.ts b/e2e/suites/viewer/viewer-actions.test.ts index a9e4898762..6fdfbafd5a 100755 --- a/e2e/suites/viewer/viewer-actions.test.ts +++ b/e2e/suites/viewer/viewer-actions.test.ts @@ -220,13 +220,9 @@ describe('Viewer actions', () => { it('[C279282] Full screen action', async () => { await dataTable.doubleClickOnRowByName(docxPersonalFiles); await viewer.waitForViewerToOpen(); - await Utils.getBrowserLog(); await toolbar.fullScreenButton.click(); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is closed after pressing Full screen'); - const browserLogAfter = await Utils.getBrowserLog(); - - expect(browserLogAfter.length).toBe(0, browserLogAfter.entries); }); it('[C286314] Pressing ESC in the viewer closes only the action dialog', async () => { diff --git a/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts b/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts index 4b87e4de82..7dff4b064b 100755 --- a/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts +++ b/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts @@ -24,7 +24,7 @@ import { browser, by } from 'protractor'; import { Component } from '../component'; -import { waitForPresence, waitForStaleness } from '../../utilities/utils'; +import { waitForPresence } from '../../utilities/utils'; import { BrowserActions } from '@alfresco/adf-testing'; export class DropDownBreadcrumb extends Component { @@ -42,10 +42,6 @@ export class DropDownBreadcrumb extends Component { return waitForPresence(this.pathItemsContainer, 'Timeout waiting for breadcrumb dropdown to open'); } - async waitForPathListDropdownToClose(): Promise { - return waitForStaleness(browser.$(this.pathOptionCss), 'Timeout waiting for breadcrumb dropdown to close'); - } - async openPath(): Promise { await BrowserActions.click(this.trigger); await this.waitForPathListDropdownToOpen(); diff --git a/projects/aca-testing-shared/src/components/components.ts b/projects/aca-testing-shared/src/components/components.ts index 27d85f0ada..494a2774ea 100755 --- a/projects/aca-testing-shared/src/components/components.ts +++ b/projects/aca-testing-shared/src/components/components.ts @@ -25,7 +25,6 @@ export * from './login/login'; export * from './header/header'; export * from './pageLayoutHeader/pageLayoutHeader'; -export * from './header/user-info'; export * from './data-table/data-table'; export * from './dialog/confirm-dialog'; export * from './dialog/create-edit-folder-dialog'; diff --git a/projects/aca-testing-shared/src/components/data-table/data-table.ts b/projects/aca-testing-shared/src/components/data-table/data-table.ts index a21db0d09e..558f16391c 100755 --- a/projects/aca-testing-shared/src/components/data-table/data-table.ts +++ b/projects/aca-testing-shared/src/components/data-table/data-table.ts @@ -23,7 +23,7 @@ */ import { browser, by, ElementArrayFinder, ElementFinder, protractor } from 'protractor'; -import { BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing'; +import { BrowserVisibility, Logger } from '@alfresco/adf-testing'; import { BROWSER_WAIT_TIMEOUT } from '../../configs'; import { Component } from '../component'; import { Menu } from '../menu/menu'; @@ -218,14 +218,6 @@ export class DataTable extends Component { return ''; } - async getLockOwnerToolTip(itemName: string, location: string = ''): Promise { - if (await this.hasLockIcon(itemName, location)) { - const row = this.getRowByName(itemName, location); - return BrowserActions.getAttribute(row.element(by.css('img[src*="lock"]')), 'alt'); - } - return ''; - } - private getNameLink(itemName: string): ElementFinder { return this.getRowNameCell(itemName).$('.adf-datatable-link [role="link"]'); } diff --git a/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts b/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts index d33e11a726..011658a99f 100755 --- a/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts +++ b/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts @@ -33,7 +33,6 @@ export class CreateOrEditFolderDialog extends GenericDialog { updateButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Update')); nameInput = this.rootElem.element(by.id('adf-folder-name-input')); - titleInput = this.rootElem.element(by.id('adf-folder-title-input')); descriptionTextArea = this.rootElem.element(by.id('adf-folder-description-input')); validationMessage = this.rootElem.element(by.css('.mat-hint span')); diff --git a/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts b/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts index fab9bfdc62..8c68319166 100755 --- a/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts +++ b/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts @@ -64,14 +64,6 @@ export class CreateFromTemplateDialog extends GenericDialog { return BrowserActions.getInputValue(this.nameInput); } - async getDescriptionValue(): Promise { - return BrowserActions.getInputValue(this.descriptionTextArea); - } - - async getTitleInputValue(): Promise { - return BrowserActions.getInputValue(this.titleInput); - } - async enterName(name: string): Promise { await typeText(this.nameInput, name); } diff --git a/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts b/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts index f3518e9918..ef6d9036d6 100755 --- a/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts +++ b/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts @@ -89,12 +89,4 @@ export class CreateLibraryDialog extends GenericDialog { async isPublicChecked(): Promise { return this.isChecked(this.visibilityPublic); } - - async isModeratedChecked(): Promise { - return this.isChecked(this.visibilityModerated); - } - - async isPrivateChecked(): Promise { - return this.isChecked(this.visibilityPrivate); - } } diff --git a/projects/aca-testing-shared/src/components/dialog/manage-versions-dialog.ts b/projects/aca-testing-shared/src/components/dialog/manage-versions-dialog.ts index 8ba05f2f3b..01f16dc030 100755 --- a/projects/aca-testing-shared/src/components/dialog/manage-versions-dialog.ts +++ b/projects/aca-testing-shared/src/components/dialog/manage-versions-dialog.ts @@ -28,19 +28,12 @@ import { BrowserActions } from '@alfresco/adf-testing'; import { Menu } from '../menu/menu'; export class ManageVersionsDialog extends GenericDialog { - closeButton = this.childElement(by.cssContainingText('.mat-button', 'Close')); - menu = new Menu(); constructor() { super('.adf-new-version-uploader-dialog'); } - async clickClose(): Promise { - await BrowserActions.click(this.closeButton); - await this.waitForDialogToClose(); - } - async clickActionButton(version: string): Promise { await BrowserActions.click(this.childElement(by.id(`adf-version-list-action-menu-button-${version}`))); await this.menu.waitForMenuToOpen(); diff --git a/projects/aca-testing-shared/src/components/dialog/share-dialog.ts b/projects/aca-testing-shared/src/components/dialog/share-dialog.ts index 8e5b111790..140622cae4 100755 --- a/projects/aca-testing-shared/src/components/dialog/share-dialog.ts +++ b/projects/aca-testing-shared/src/components/dialog/share-dialog.ts @@ -88,12 +88,6 @@ export class ShareDialog extends GenericDialog { return toggleClass.includes('checked'); } - async closeDatetimePicker(): Promise { - if (await this.dateTimePicker.isCalendarOpen()) { - await BrowserActions.click(this.datetimePickerButton); - } - } - async getExpireDate(): Promise { return BrowserActions.getInputValue(this.expireInput); } diff --git a/projects/aca-testing-shared/src/components/header/header.ts b/projects/aca-testing-shared/src/components/header/header.ts index b7394da566..1e27fe283b 100755 --- a/projects/aca-testing-shared/src/components/header/header.ts +++ b/projects/aca-testing-shared/src/components/header/header.ts @@ -24,7 +24,6 @@ import { by, browser } from 'protractor'; import { Component } from '../component'; -import { UserInfo } from './user-info'; import { Menu } from '../menu/menu'; import { Toolbar } from './../toolbar/toolbar'; import { SearchInput } from '../search/search-input'; @@ -32,11 +31,9 @@ import { waitElement } from '../../utilities/utils'; import { BrowserActions } from '@alfresco/adf-testing'; export class Header extends Component { - logoLink = this.byCss('.app-menu__title'); userMenuButton = this.byCss(`.aca-user-menu-button`); sidenavToggle = this.byCss(`.sidenav-header-title-logo`); - userInfo = new UserInfo(); menu = new Menu(); toolbar = new Toolbar(); searchInput = new SearchInput(); @@ -66,12 +63,4 @@ export class Header extends Component { await waitElement(`[data-automation-id='expanded']`); } } - - async collapseSideNav(): Promise { - const expanded = await this.isSidenavExpanded(); - if (expanded) { - await BrowserActions.click(this.sidenavToggle); - await waitElement(`[data-automation-id='collapsed']`); - } - } } diff --git a/projects/aca-testing-shared/src/components/header/user-info.ts b/projects/aca-testing-shared/src/components/header/user-info.ts deleted file mode 100755 index 087ca659a7..0000000000 --- a/projects/aca-testing-shared/src/components/header/user-info.ts +++ /dev/null @@ -1,50 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { Menu } from '../menu/menu'; -import { Component } from '../component'; -import { BrowserActions } from '@alfresco/adf-testing'; - -export class UserInfo extends Component { - fullName = this.byCss('.current-user__full-name'); - avatar = this.byCss('.current-user__avatar'); - - menu = new Menu(); - - constructor(ancestor?: string) { - super('aca-current-user', ancestor); - } - - async openMenu(): Promise { - await BrowserActions.click(this.avatar); - await this.menu.wait(); - - return this.menu; - } - - async signOut(): Promise { - const menu = await this.openMenu(); - await menu.clickMenuItem('Sign out'); - } -} diff --git a/projects/aca-testing-shared/src/components/index.ts b/projects/aca-testing-shared/src/components/index.ts index b8124952d8..29d6ac7c1f 100644 --- a/projects/aca-testing-shared/src/components/index.ts +++ b/projects/aca-testing-shared/src/components/index.ts @@ -28,7 +28,6 @@ export * from './data-table/data-table'; export * from './datetime-picker/datetime-picker'; export * from './dialog'; export * from './header/header'; -export * from './header/user-info'; export * from './info-drawer'; export * from './login/login'; export * from './menu/menu'; diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts index c7429829c5..8ffd74ee7b 100755 --- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts +++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts @@ -29,9 +29,6 @@ import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing'; export class ContentMetadata extends Component { expandedPanel = this.byCss('.mat-expansion-panel.mat-expanded'); - propertyList = this.byCss('.adf-property-list'); - propertyListElements = this.allByCss('.adf-property'); - propertyValue = this.byCss('.adf-property-value'); editPropertiesButton = this.byCss(`button[title='Edit']`); lessInfoButton = this.byCssText(`[data-automation-id='meta-data-card-toggle-expand']`, 'Less information'); moreInfoButton = this.byCssText(`[data-automation-id='meta-data-card-toggle-expand']`, 'More information'); diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts index ae3e298185..158e2256b1 100755 --- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts +++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts @@ -28,10 +28,6 @@ import { Component } from '../component'; import { waitForPresence, waitForStaleness, typeText } from '../../utilities/utils'; export class LibraryMetadata extends Component { - metadataTabContent = this.byCss('.mat-card-content'); - metadataTabAction = this.byCss('.mat-card-actions .mat-button'); - fieldLabelWrapper = this.byCss('.mat-form-field-label-wrapper'); - fieldInput = this.byCss('.mat-input-element'); visibilityDropDown = this.component.element(by.css('.mat-select')); visibilityPublic = this.byCssText('.mat-option .mat-option-text', 'Public', browser); visibilityPrivate = this.byCssText('.mat-option .mat-option-text', 'Private', browser); diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts index 270677eef2..052768a945 100755 --- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts +++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts @@ -36,12 +36,9 @@ export class InfoDrawer extends Component { propertiesTab = new ContentMetadata('adf-info-drawer'); header = this.byCss('.adf-info-drawer-layout-header'); headerTitle = this.byCss('.adf-info-drawer-layout-header-title'); - tabLabel = this.byCss('.mat-tab-label-content'); tabLabelsList = this.allByCss('.mat-tab-label-content'); tabActiveLabel = this.byCss('.mat-tab-label-active'); tabActiveContent = this.byCss('.mat-tab-body-active .mat-tab-body-content adf-dynamic-tab'); - nextButton = this.byCss('.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron'); - previousButton = this.byCss('.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron'); expandDetailsButton = TestElement.byCss(`button[title='Expand']`); selectedTab = TestElement.byCss(`.mat-tab-list [aria-selected='true'] div`); expandedDetailsPermissionsTab = TestElement.byText('.acs-details-container .mat-tab-label-content', 'Permissions'); @@ -104,18 +101,10 @@ export class InfoDrawer extends Component { return this.headerTitle.getText(); } - async isAboutTabDisplayed() { - return this.isTabDisplayed('About'); - } - async isPropertiesTabDisplayed() { return this.isTabDisplayed('Properties'); } - async isPropertiesTabActive() { - return (await this.getActiveTabTitle()) === 'PROPERTIES'; - } - async isCommentsTabDisplayed() { return this.isTabDisplayed('Comments'); } diff --git a/projects/aca-testing-shared/src/components/login/login.ts b/projects/aca-testing-shared/src/components/login/login.ts index 41df58ccc7..dddb2df33a 100755 --- a/projects/aca-testing-shared/src/components/login/login.ts +++ b/projects/aca-testing-shared/src/components/login/login.ts @@ -29,7 +29,6 @@ export class LoginComponent extends Component { usernameInput = this.byCss('input#username'); passwordInput = this.byCss('input#password'); submitButton = this.byCss('button#login-button'); - errorMessage = this.byCss('.adf-login-error-message'); copyright = this.byCss('.adf-copyright'); passwordVisibility = this.byCss('.adf-login-password-icon'); diff --git a/projects/aca-testing-shared/src/components/menu/menu.ts b/projects/aca-testing-shared/src/components/menu/menu.ts index ec4d4f19db..3d420291d4 100755 --- a/projects/aca-testing-shared/src/components/menu/menu.ts +++ b/projects/aca-testing-shared/src/components/menu/menu.ts @@ -32,24 +32,16 @@ export class Menu extends Component { uploadFilesInput = this.byId('app-upload-files', browser); submenus = browser.element.all(by.css('app-context-menu-item .mat-menu-item')); - - uploadFileAction = this.byId('app.create.uploadFile'); - uploadFolderAction = this.byId('app.create.uploadFolder'); createFolderAction = this.byId('app.create.folder'); createLibraryAction = this.byId('app.create.library'); createFileFromTemplateAction = this.byId('app.create.fileFromTemplate'); createFolderFromTemplateAction = this.byId('app.create.folderFromTemplate'); cancelEditingAction = this.byCss(`.mat-menu-item[title='Cancel Editing']`); - cancelJoinAction = this.byCssText('.mat-menu-item', 'Cancel Join'); copyAction = this.byTitleAttr('Copy'); - downloadAction = this.byCssText('.mat-menu-item', 'Download'); editFolderAction = this.byCss(`.mat-menu-item[id$='editFolder']`); editOfflineAction = this.byCss(`.mat-menu-item[title='Edit Offline']`); - joinAction = this.byCssText('.mat-menu-item', 'Join'); - leaveAction = this.byCssText('.mat-menu-item', 'Leave'); managePermissionsAction = this.byCssText('.mat-menu-item', 'Permissions'); - restoreAction = this.byCssText('.mat-menu-item', 'Restore'); shareAction = this.byCssText('.mat-menu-item', 'Share'); shareEditAction = this.byCssText('.mat-menu-item', 'Shared Link Settings'); @@ -79,10 +71,6 @@ export class Menu extends Component { return this.byCssText('.mat-menu-item', menuItem); } - private getSubItemByLabel(subMenuItem: string): ElementFinder { - return this.byCssText('app-context-menu-item .mat-menu-item', subMenuItem); - } - getItemById(id: string): ElementFinder { return this.byId(id); } @@ -154,15 +142,6 @@ export class Menu extends Component { } } - async clickSubMenuItem(subMenuItem: string): Promise { - try { - const elem = this.getSubItemByLabel(subMenuItem); - await BrowserActions.click(elem); - } catch (e) { - Logger.error('___click submenu item catch___', e); - } - } - async isMenuItemPresent(title: string): Promise { return browser.element(by.cssContainingText('.mat-menu-item', title)).isPresent(); } @@ -193,14 +172,6 @@ export class Menu extends Component { return isPresentAndEnabled(this.createLibraryAction); } - async isUploadFileEnabled(): Promise { - return isPresentAndEnabled(this.uploadFileAction); - } - - async isUploadFolderEnabled(): Promise { - return isPresentAndEnabled(this.uploadFolderAction); - } - async isCreateFileFromTemplateEnabled(): Promise { return isPresentAndEnabled(this.createFileFromTemplateAction); } diff --git a/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts b/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts index 1a7e622567..288d936833 100644 --- a/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts +++ b/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts @@ -26,7 +26,6 @@ import { Component } from '../component'; import { waitForPresence } from '../../utilities/utils'; export class MetadataCard extends Component { - footer = this.byCss('.adf-content-metadata-card-footer'); expandButton = this.byCss('[data-automation-id="meta-data-card-toggle-expand"]'); expansionPanels = this.allByCss('.adf-metadata-grouped-properties-container mat-expansion-panel'); @@ -34,10 +33,6 @@ export class MetadataCard extends Component { super('adf-content-metadata-card', ancestor); } - async isExpandPresent() { - return this.expandButton.isPresent(); - } - async waitForFirstExpansionPanel() { await waitForPresence(this.expansionPanels.get(0)); } diff --git a/projects/aca-testing-shared/src/components/pageLayoutHeader/pageLayoutHeader.ts b/projects/aca-testing-shared/src/components/pageLayoutHeader/pageLayoutHeader.ts index 98c51b39d7..0505595684 100644 --- a/projects/aca-testing-shared/src/components/pageLayoutHeader/pageLayoutHeader.ts +++ b/projects/aca-testing-shared/src/components/pageLayoutHeader/pageLayoutHeader.ts @@ -23,19 +23,12 @@ * along with Alfresco. If not, see . */ -import { by, browser } from 'protractor'; import { Component } from '../component'; import { Menu } from '../menu/menu'; import { Toolbar } from '../toolbar/toolbar'; import { SearchInput } from '../search/search-input'; -import { waitElement } from '../../utilities/utils'; -import { BrowserActions } from '@alfresco/adf-testing'; export class PageLayoutHeader extends Component { - logoLink = this.byCss('.app-menu__title'); - moreActions = browser.element(by.id('app.header.more')); - sidenavToggle = this.byCss(`.sidenav-header-title-logo`); - menu = new Menu(); toolbar = new Toolbar(); searchInput = new SearchInput(); @@ -43,34 +36,4 @@ export class PageLayoutHeader extends Component { constructor(ancestor?: string) { super('aca-page-layout', ancestor); } - - async openMoreMenu(): Promise { - await BrowserActions.click(this.moreActions); - await this.menu.waitForMenuToOpen(); - } - - async closeMoreMenu(): Promise { - await BrowserActions.click(this.moreActions); - await this.menu.waitForMenuToClose(); - } - - async isSidenavExpanded(): Promise { - return browser.isElementPresent(by.css(`[data-automation-id='expanded']`)); - } - - async expandSideNav(): Promise { - const expanded = await this.isSidenavExpanded(); - if (!expanded) { - await BrowserActions.click(this.sidenavToggle); - await waitElement(`[data-automation-id='expanded']`); - } - } - - async collapseSideNav(): Promise { - const expanded = await this.isSidenavExpanded(); - if (expanded) { - await BrowserActions.click(this.sidenavToggle); - await waitElement(`[data-automation-id='collapsed']`); - } - } } diff --git a/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts b/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts index bc39c3d04c..c5f5f9dd21 100755 --- a/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts +++ b/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts @@ -38,19 +38,9 @@ export class CreatedDateFilter extends GenericFilter { toField: ElementFinder = this.filterDialogOpened.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'To')); toInput: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-input']`)); toFieldError: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-error']`)); - - async isFromFieldDisplayed(): Promise { - return isPresentAndDisplayed(this.fromField); - } - async isFromErrorDisplayed(): Promise { return isPresentAndDisplayed(this.fromFieldError); } - - async isToFieldDisplayed(): Promise { - return isPresentAndDisplayed(this.toField); - } - async isToErrorDisplayed(): Promise { return isPresentAndDisplayed(this.toFieldError); } @@ -78,17 +68,6 @@ export class CreatedDateFilter extends GenericFilter { return ''; } } - - async resetPanel(): Promise { - const fromValue = await this.getFromValue(); - const toValue = await this.getToValue(); - if (fromValue.length > 0 || toValue.length > 0) { - await this.openDialog(); - await this.clickResetButton(); - await this.closeDialog(); - } - } - async enterFromDate(date: string): Promise { await this.openDialog(); await BrowserActions.clearWithBackSpace(this.fromInput); diff --git a/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts b/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts index 7547d041a7..bff974dd22 100755 --- a/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts +++ b/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts @@ -24,7 +24,6 @@ import { ElementFinder, ElementArrayFinder, by, browser } from 'protractor'; import { GenericFilter } from './generic-filter'; -import { BrowserActions } from '@alfresco/adf-testing'; export class FacetFilter extends GenericFilter { private readonly locators = { @@ -58,21 +57,6 @@ export class FacetFilter extends GenericFilter { return option.getText(); }); } - - async resetPanel(): Promise { - if ((await this.selectedFacets.count()) > 0) { - await this.openDialog(); - await this.selectedFacets.each(async (elem) => { - await BrowserActions.click(elem); - }); - } - await this.openDialog(); - } - - async isFilterFacetsDisplayed(): Promise { - return this.facetsFilter.isDisplayed(); - } - async isFilterCategoryInputDisplayed(): Promise { return this.filterCategoryInput.isDisplayed(); } diff --git a/projects/aca-testing-shared/src/components/search/search-filters.ts b/projects/aca-testing-shared/src/components/search/search-filters.ts index dd723a821d..a86f719dc1 100755 --- a/projects/aca-testing-shared/src/components/search/search-filters.ts +++ b/projects/aca-testing-shared/src/components/search/search-filters.ts @@ -27,10 +27,8 @@ import { Component } from '../component'; import { SizeFilter } from './filters/size-filter'; import { CreatedDateFilter } from './filters/created-date-filter'; import { FacetFilter } from './filters/facet-filter'; -import { isPresentAndDisplayed } from '../../utilities/utils'; export class SearchFilters extends Component { - mainPanel = browser.element(by.css('adf-search-filter')); resetAllButton = browser.element(by.css('button[adf-reset-search]')); size = new SizeFilter(); @@ -44,8 +42,4 @@ export class SearchFilters extends Component { constructor(ancestor?: string) { super('adf-search-filter', ancestor); } - - async isSearchFiltersPanelDisplayed(): Promise { - return isPresentAndDisplayed(this.mainPanel); - } } diff --git a/projects/aca-testing-shared/src/components/search/search-input.ts b/projects/aca-testing-shared/src/components/search/search-input.ts index abd360ee9c..6e7adb143b 100755 --- a/projects/aca-testing-shared/src/components/search/search-input.ts +++ b/projects/aca-testing-shared/src/components/search/search-input.ts @@ -42,8 +42,6 @@ export class SearchInput extends Component { searchFilesOption = this.searchOptionsArea.element(by.cssContainingText('.mat-checkbox', 'Files')); searchFoldersOption = this.searchOptionsArea.element(by.cssContainingText('.mat-checkbox', 'Folders')); searchLibrariesOption = this.searchOptionsArea.element(by.cssContainingText('.mat-checkbox', 'Libraries')); - clearSearchButton = this.searchContainer.$('.app-clear-icon'); - constructor(ancestor?: string) { super('aca-search-input', ancestor); } @@ -123,17 +121,6 @@ export class SearchInput extends Component { await this.clickLibrariesOption(); } } - - async isClearSearchButtonPresent() { - return browser.isElementPresent(this.clearSearchButton); - } - - async clickClearSearchButton() { - if (await this.isClearSearchButtonPresent()) { - await BrowserActions.click(this.clearSearchButton); - } - } - async checkOnlyFiles() { await this.clearOptions(); await this.clickFilesOption(); diff --git a/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts b/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts index 0c28001296..df69ede211 100755 --- a/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts +++ b/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts @@ -28,8 +28,6 @@ import { isPresentAndDisplayed } from '../../utilities/utils'; import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing'; export type SortByType = 'Relevance' | 'Title' | 'Filename' | 'Modified date' | 'Modifier' | 'Created date' | 'Size' | 'Type'; -export type SortOrderType = 'ASC' | 'DESC' | ''; - export class SearchSortingPicker extends Component { actionMenu = browser.element(by.css('aca-search-action-menu > button')); sortOrderButton = browser.element(by.css('#aca-button-sorting-menu')); @@ -51,11 +49,6 @@ export class SearchSortingPicker extends Component { async isSortOrderButtonDisplayed(): Promise { return isPresentAndDisplayed(this.actionMenu); } - - async isSortByOptionDisplayed(): Promise { - return isPresentAndDisplayed(this.sortOrderButton); - } - async isSortByDropdownExpanded(): Promise { return isPresentAndDisplayed(this.sortByDropdownExpanded); } diff --git a/projects/aca-testing-shared/src/components/sidenav/sidenav.ts b/projects/aca-testing-shared/src/components/sidenav/sidenav.ts index 91f469a35d..28cf8fcfeb 100755 --- a/projects/aca-testing-shared/src/components/sidenav/sidenav.ts +++ b/projects/aca-testing-shared/src/components/sidenav/sidenav.ts @@ -30,7 +30,6 @@ import { waitElement } from '../../utilities'; export class Sidenav extends Component { links = this.component.all(by.css('.item')); - activeLink = this.byCss('.action-button--active'); newButton = element(By.css('[id="app.toolbar.create"]')); personalFiles = this.byCss(`[data-automation-id='app.navbar.personalFiles']`); fileLibraries = this.byCss(`[data-automation-id='app.navbar.libraries.menu']`); @@ -82,36 +81,10 @@ export class Sidenav extends Component { await this.openNewMenu(); await BrowserActions.click(this.menu.createFolderAction); } - - async openCreateLibraryDialog(): Promise { - await this.openNewMenu(); - await BrowserActions.click(this.menu.createLibraryAction); - } - - async openCreateFileFromTemplateDialog(): Promise { - await this.openNewMenu(); - await BrowserActions.click(this.menu.createFileFromTemplateAction); - } - - async openCreateFolderFromTemplateDialog(): Promise { - await this.openNewMenu(); - await BrowserActions.click(this.menu.createFolderFromTemplateAction); - } - async isActive(name: string): Promise { const cssClass = await this.getLinkLabel(name).getAttribute('class'); return cssClass.includes('action-button--active'); } - - async childIsActive(name: string): Promise { - const childClass = await this.getLinkLabel(name).element(by.css('span')).getAttribute('class'); - return childClass.includes('action-button--active'); - } - - getLink(name: string): ElementFinder { - return this.getLinkLabel(name).element(by.xpath('..')); - } - private getLinkLabel(name: string): ElementFinder { switch (name) { case 'Personal Files': diff --git a/projects/aca-testing-shared/src/components/toolbar/toolbar.ts b/projects/aca-testing-shared/src/components/toolbar/toolbar.ts index e65d4b2c3c..55e15c543a 100755 --- a/projects/aca-testing-shared/src/components/toolbar/toolbar.ts +++ b/projects/aca-testing-shared/src/components/toolbar/toolbar.ts @@ -137,12 +137,6 @@ export class Toolbar extends Component { await BrowserActions.click(this.createButton); await this.menu.waitForMenuToOpen(); } - - async closeCreateMenu(): Promise { - await BrowserActions.click(element(by.css('button[id="app.toolbar.create"]'))); - await this.menu.waitForMenuToClose(); - } - async openUploadMenu(): Promise { await BrowserActions.click(this.uploadButton); await this.menu.waitForMenuToOpen(); diff --git a/projects/aca-testing-shared/src/pages/login-page.ts b/projects/aca-testing-shared/src/pages/login-page.ts index 49bfd396da..94f13dd95d 100755 --- a/projects/aca-testing-shared/src/pages/login-page.ts +++ b/projects/aca-testing-shared/src/pages/login-page.ts @@ -63,12 +63,4 @@ export class LoginPage extends Page { async loginWithAdmin() { await this.loginWith(browser.params.ADMIN_USERNAME, browser.params.ADMIN_PASSWORD); } - - async tryLoginWith(username: string, password?: string) { - const pass = password || username; - await this.load(); - await this.login.enterCredentials(username, pass); - await BrowserActions.click(this.login.submitButton); - await waitForPresence(this.login.errorMessage); - } } diff --git a/projects/aca-testing-shared/src/pages/page.ts b/projects/aca-testing-shared/src/pages/page.ts index 9d3edb0df4..665e2ef31d 100755 --- a/projects/aca-testing-shared/src/pages/page.ts +++ b/projects/aca-testing-shared/src/pages/page.ts @@ -36,10 +36,7 @@ export abstract class Page { overlay = this.byCss('.cdk-overlay-container'); snackBar = this.byCss(`[data-automation-id='adf-snackbar-message-content-action-button']`); dialogContainer = this.byCss('.mat-dialog-container'); - snackBarContainer = this.byCss('.mat-snack-bar-container'); - snackBarAction = this.byCss(`[data-automation-id='adf-snackbar-message-content-action-button']`); genericError = this.byCss('aca-generic-error'); - genericErrorIcon = this.byCss('aca-generic-error .mat-icon'); genericErrorTitle = this.byCss('.generic-error__title'); uploadFilesDialog = new UploadFilesDialog(); diff --git a/projects/aca-testing-shared/src/pages/search-results-page.ts b/projects/aca-testing-shared/src/pages/search-results-page.ts index 6d90600204..566d291480 100755 --- a/projects/aca-testing-shared/src/pages/search-results-page.ts +++ b/projects/aca-testing-shared/src/pages/search-results-page.ts @@ -22,7 +22,7 @@ * along with Alfresco. If not, see . */ -import { browser, by, By } from 'protractor'; +import { by } from 'protractor'; import { BrowsingPage } from './browsing-page'; import { SearchSortingPicker } from '../components/search/search-sorting-picker'; import { SearchFilters } from '../components/search/search-filters'; @@ -30,9 +30,6 @@ import { BrowserActions } from '@alfresco/adf-testing'; export class SearchResultsPage extends BrowsingPage { root = this.byCss('aca-search-results'); - chipList = this.root.element(by.css('.adf-search-chip-list')); - infoText = this.root.element(by.css('.adf-search-results--info-text')); - sortingPicker = new SearchSortingPicker('aca-search-results'); filters = new SearchFilters('aca-search-results'); @@ -40,10 +37,6 @@ export class SearchResultsPage extends BrowsingPage { await this.dataTable.waitForBody(); } - async getResultsFoundText(): Promise { - return this.infoText.getText(); - } - async getName(name: string): Promise { return this.dataTable.getRowByName(name).element(by.css('[title="Name"] div.search-file-name')).getText(); } @@ -67,17 +60,4 @@ export class SearchResultsPage extends BrowsingPage { async getLocation(name: string): Promise { return this.dataTable.getRowByName(name).element(by.css('[title="Name"] a')).getText(); } - - async getResultsChipsValues(): Promise { - const chips = this.chipList.all(by.css('.mat-chip')); - return chips.map(async (elem) => { - return (await elem.getText()).replace(`\ncancel`, ''); - }); - } - - async removeChip(chipName: string): Promise { - const chip = browser.element(By.cssContainingText('.mat-chip', chipName)); - const closeChip = chip.element(by.css('.mat-chip-remove')); - await BrowserActions.click(closeChip); - } } diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/index.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/index.ts index 5ecf4a83eb..8163e1be34 100644 --- a/projects/aca-testing-shared/src/utilities/repo-client/apis/index.ts +++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/index.ts @@ -23,7 +23,6 @@ */ export * from './favorites/favorites-api'; -export * from './nodes/node-body-create'; export * from './nodes/node-content-tree'; export * from './nodes/nodes-api'; export * from './people/people-api-models'; diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-body-create.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-body-create.ts deleted file mode 100755 index c91db5c05a..0000000000 --- a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-body-create.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -export const NODE_TYPE_FILE = 'cm:content'; -export const NODE_TYPE_FOLDER = 'cm:folder'; -export const NODE_TITLE = 'cm:title'; -export const NODE_DESCRIPTION = 'cm:description'; - -export class NodeBodyCreate { - constructor( - public name: string, - public nodeType: string, - public relativePath: string = '/', - public aspectNames?: string[], - public properties?: any[] - ) {} -} diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts index ccf06b2055..2b744beb27 100755 --- a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts +++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts @@ -22,7 +22,10 @@ * along with Alfresco. If not, see . */ -import { NodeBodyCreate, NODE_TYPE_FILE, NODE_TYPE_FOLDER, NODE_TITLE, NODE_DESCRIPTION } from './node-body-create'; +const NODE_TYPE_FILE = 'cm:content'; +const NODE_TYPE_FOLDER = 'cm:folder'; +const NODE_TITLE = 'cm:title'; +const NODE_DESCRIPTION = 'cm:description'; export interface NodeContentTree { name?: string; @@ -32,6 +35,14 @@ export interface NodeContentTree { description?: string; } +export interface NodeBodyCreate { + name: string; + nodeType: string; + relativePath: string; + aspectNames?: string[]; + properties?: any[]; +} + export function flattenNodeContentTree(content: NodeContentTree, relativePath: string = '/'): NodeBodyCreate[] { const { name, files, folders, title, description } = content; const aspectNames: string[] = ['cm:versionable']; diff --git a/projects/aca-testing-shared/src/utilities/utils.ts b/projects/aca-testing-shared/src/utilities/utils.ts index f2a5f79f25..f1982364ca 100644 --- a/projects/aca-testing-shared/src/utilities/utils.ts +++ b/projects/aca-testing-shared/src/utilities/utils.ts @@ -22,7 +22,7 @@ * along with Alfresco. If not, see . */ -import { browser, protractor, ElementFinder, ExpectedConditions as EC, by, logging, until, WebElement } from 'protractor'; +import { browser, protractor, ElementFinder, ExpectedConditions as EC, by, until, WebElement } from 'protractor'; import { BrowserVisibility, Logger } from '@alfresco/adf-testing'; import { BROWSER_WAIT_TIMEOUT } from '../configs'; import * as path from 'path'; @@ -187,10 +187,6 @@ export class Utils { await browser.actions().sendKeys(protractor.Key.NULL).perform(); } - static async getBrowserLog(): Promise { - return browser.manage().logs().get('browser'); - } - static formatDate(date: string): string { return new Date(date).toLocaleDateString('en-US'); }