eliminate dead code in e2e tests (#3220)

* reduce shared testing dependency

* dead code cleanup

* eliminate dead code

* fix export
This commit is contained in:
Denys Vuika 2023-05-23 09:27:08 +01:00 committed by GitHub
parent 51a8908ecc
commit def6ddeaa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 22 additions and 380 deletions

View File

@ -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 }) => {

View File

@ -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 }) => {

View File

@ -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);
});

View File

@ -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 () => {

View File

@ -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<void> {
return waitForStaleness(browser.$(this.pathOptionCss), 'Timeout waiting for breadcrumb dropdown to close');
}
async openPath(): Promise<void> {
await BrowserActions.click(this.trigger);
await this.waitForPathListDropdownToOpen();

View File

@ -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';

View File

@ -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<string> {
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"]');
}

View File

@ -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'));

View File

@ -64,14 +64,6 @@ export class CreateFromTemplateDialog extends GenericDialog {
return BrowserActions.getInputValue(this.nameInput);
}
async getDescriptionValue(): Promise<string> {
return BrowserActions.getInputValue(this.descriptionTextArea);
}
async getTitleInputValue(): Promise<string> {
return BrowserActions.getInputValue(this.titleInput);
}
async enterName(name: string): Promise<void> {
await typeText(this.nameInput, name);
}

View File

@ -89,12 +89,4 @@ export class CreateLibraryDialog extends GenericDialog {
async isPublicChecked(): Promise<boolean> {
return this.isChecked(this.visibilityPublic);
}
async isModeratedChecked(): Promise<boolean> {
return this.isChecked(this.visibilityModerated);
}
async isPrivateChecked(): Promise<boolean> {
return this.isChecked(this.visibilityPrivate);
}
}

View File

@ -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<void> {
await BrowserActions.click(this.closeButton);
await this.waitForDialogToClose();
}
async clickActionButton(version: string): Promise<void> {
await BrowserActions.click(this.childElement(by.id(`adf-version-list-action-menu-button-${version}`)));
await this.menu.waitForMenuToOpen();

View File

@ -88,12 +88,6 @@ export class ShareDialog extends GenericDialog {
return toggleClass.includes('checked');
}
async closeDatetimePicker(): Promise<void> {
if (await this.dateTimePicker.isCalendarOpen()) {
await BrowserActions.click(this.datetimePickerButton);
}
}
async getExpireDate(): Promise<string> {
return BrowserActions.getInputValue(this.expireInput);
}

View File

@ -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<void> {
const expanded = await this.isSidenavExpanded();
if (expanded) {
await BrowserActions.click(this.sidenavToggle);
await waitElement(`[data-automation-id='collapsed']`);
}
}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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<Menu> {
await BrowserActions.click(this.avatar);
await this.menu.wait();
return this.menu;
}
async signOut(): Promise<void> {
const menu = await this.openMenu();
await menu.clickMenuItem('Sign out');
}
}

View File

@ -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';

View File

@ -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');

View File

@ -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);

View File

@ -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');
}

View File

@ -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');

View File

@ -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<void> {
try {
const elem = this.getSubItemByLabel(subMenuItem);
await BrowserActions.click(elem);
} catch (e) {
Logger.error('___click submenu item catch___', e);
}
}
async isMenuItemPresent(title: string): Promise<boolean> {
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<boolean> {
return isPresentAndEnabled(this.uploadFileAction);
}
async isUploadFolderEnabled(): Promise<boolean> {
return isPresentAndEnabled(this.uploadFolderAction);
}
async isCreateFileFromTemplateEnabled(): Promise<boolean> {
return isPresentAndEnabled(this.createFileFromTemplateAction);
}

View File

@ -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));
}

View File

@ -23,19 +23,12 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
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<void> {
await BrowserActions.click(this.moreActions);
await this.menu.waitForMenuToOpen();
}
async closeMoreMenu(): Promise<void> {
await BrowserActions.click(this.moreActions);
await this.menu.waitForMenuToClose();
}
async isSidenavExpanded(): Promise<boolean> {
return browser.isElementPresent(by.css(`[data-automation-id='expanded']`));
}
async expandSideNav(): Promise<void> {
const expanded = await this.isSidenavExpanded();
if (!expanded) {
await BrowserActions.click(this.sidenavToggle);
await waitElement(`[data-automation-id='expanded']`);
}
}
async collapseSideNav(): Promise<void> {
const expanded = await this.isSidenavExpanded();
if (expanded) {
await BrowserActions.click(this.sidenavToggle);
await waitElement(`[data-automation-id='collapsed']`);
}
}
}

View File

@ -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<boolean> {
return isPresentAndDisplayed(this.fromField);
}
async isFromErrorDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.fromFieldError);
}
async isToFieldDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.toField);
}
async isToErrorDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.toFieldError);
}
@ -78,17 +68,6 @@ export class CreatedDateFilter extends GenericFilter {
return '';
}
}
async resetPanel(): Promise<void> {
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<void> {
await this.openDialog();
await BrowserActions.clearWithBackSpace(this.fromInput);

View File

@ -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<void> {
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<boolean> {
return this.facetsFilter.isDisplayed();
}
async isFilterCategoryInputDisplayed(): Promise<boolean> {
return this.filterCategoryInput.isDisplayed();
}

View File

@ -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<boolean> {
return isPresentAndDisplayed(this.mainPanel);
}
}

View File

@ -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();

View File

@ -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<boolean> {
return isPresentAndDisplayed(this.actionMenu);
}
async isSortByOptionDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.sortOrderButton);
}
async isSortByDropdownExpanded(): Promise<boolean> {
return isPresentAndDisplayed(this.sortByDropdownExpanded);
}

View File

@ -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<void> {
await this.openNewMenu();
await BrowserActions.click(this.menu.createLibraryAction);
}
async openCreateFileFromTemplateDialog(): Promise<void> {
await this.openNewMenu();
await BrowserActions.click(this.menu.createFileFromTemplateAction);
}
async openCreateFolderFromTemplateDialog(): Promise<void> {
await this.openNewMenu();
await BrowserActions.click(this.menu.createFolderFromTemplateAction);
}
async isActive(name: string): Promise<boolean> {
const cssClass = await this.getLinkLabel(name).getAttribute('class');
return cssClass.includes('action-button--active');
}
async childIsActive(name: string): Promise<boolean> {
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':

View File

@ -137,12 +137,6 @@ export class Toolbar extends Component {
await BrowserActions.click(this.createButton);
await this.menu.waitForMenuToOpen();
}
async closeCreateMenu(): Promise<void> {
await BrowserActions.click(element(by.css('button[id="app.toolbar.create"]')));
await this.menu.waitForMenuToClose();
}
async openUploadMenu(): Promise<void> {
await BrowserActions.click(this.uploadButton);
await this.menu.waitForMenuToOpen();

View File

@ -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);
}
}

View File

@ -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();

View File

@ -22,7 +22,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
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<string> {
return this.infoText.getText();
}
async getName(name: string): Promise<string> {
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<string> {
return this.dataTable.getRowByName(name).element(by.css('[title="Name"] a')).getText();
}
async getResultsChipsValues(): Promise<string[]> {
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<void> {
const chip = browser.element(By.cssContainingText('.mat-chip', chipName));
const closeChip = chip.element(by.css('.mat-chip-remove'));
await BrowserActions.click(closeChip);
}
}

View File

@ -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';

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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[]
) {}
}

View File

@ -22,7 +22,10 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
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'];

View File

@ -22,7 +22,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
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<logging.Entry[]> {
return browser.manage().logs().get('browser');
}
static formatDate(date: string): string {
return new Date(date).toLocaleDateString('en-US');
}