mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
@@ -21,12 +21,10 @@ import {
|
||||
BrowserVisibility,
|
||||
DateUtil,
|
||||
DocumentListPage,
|
||||
TogglePage,
|
||||
DropdownPage,
|
||||
Logger
|
||||
} from '@alfresco/adf-testing';
|
||||
import { $$, browser, by, element, ElementFinder, protractor, $ } from 'protractor';
|
||||
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
||||
import { $$, browser, by, element, protractor, $ } from 'protractor';
|
||||
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
||||
import { NavigationBarPage } from './navigation-bar.page';
|
||||
|
||||
@@ -43,18 +41,10 @@ export class ContentServicesPage {
|
||||
};
|
||||
|
||||
contentList = new DocumentListPage($$('adf-upload-drag-area adf-document-list').first());
|
||||
togglePage = new TogglePage();
|
||||
createFolderDialog = new FolderDialogPage();
|
||||
createLibraryDialog = new CreateLibraryDialogPage();
|
||||
|
||||
multipleFileUploadToggle = $('#adf-document-list-enable-drop-files');
|
||||
uploadBorder = $('#document-list-container');
|
||||
currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div');
|
||||
createFolderButton = $('button[data-automation-id="create-new-folder"]');
|
||||
editFolderButton = $('button[data-automation-id="edit-folder"]');
|
||||
deleteNodesButton = $('button[data-automation-id="delete-toolbar-button"]');
|
||||
createLibraryButton = $('button[data-automation-id="create-new-library"]');
|
||||
activeBreadcrumb = $('div[class*="active"]');
|
||||
uploadFileButton = $('.adf-upload-button-file-container button');
|
||||
uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]');
|
||||
uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]');
|
||||
@@ -69,21 +59,14 @@ export class ContentServicesPage {
|
||||
emptyFolderImage = $('.adf-empty-folder-image');
|
||||
gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
|
||||
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', 'share'));
|
||||
nameColumnHeader = 'name';
|
||||
createdByColumnHeader = 'createdByUser.displayName';
|
||||
createdColumnHeader = 'createdAt';
|
||||
deleteContentElement = $('button[data-automation-id="Delete"]');
|
||||
metadataAction = $('button[data-automation-id="Info"]');
|
||||
versionManagerAction = $('button[data-automation-id="Manage versions"]');
|
||||
moveContentElement = $('button[data-automation-id="Move"]');
|
||||
copyContentElement = $('button[data-automation-id="Copy"]');
|
||||
lockContentElement = $('button[data-automation-id="Lock"]');
|
||||
downloadContent = $('button[data-automation-id="Download"]');
|
||||
downloadButton = $('button[title="Download"]');
|
||||
favoriteButton = $('button[data-automation-id="favorite"]');
|
||||
markedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
|
||||
notMarkedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
|
||||
multiSelectToggle = $('[data-automation-id="multiSelectToggle"]');
|
||||
selectAllCheckbox = $$('.adf-checkbox-sr-only').first();
|
||||
selectionModeDropdown = $('.mat-select[placeholder="Selection Mode"]');
|
||||
@@ -95,11 +78,6 @@ export class ContentServicesPage {
|
||||
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||
}
|
||||
|
||||
async checkContextActionIsVisible(actionName) {
|
||||
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
}
|
||||
|
||||
async isContextActionEnabled(actionName): Promise<boolean> {
|
||||
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
@@ -110,18 +88,6 @@ export class ContentServicesPage {
|
||||
return this.contentList;
|
||||
}
|
||||
|
||||
async closeActionContext(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
}
|
||||
|
||||
async checkLockedIcon(content): Promise<void> {
|
||||
return this.contentList.checkLockedIcon(content);
|
||||
}
|
||||
|
||||
async checkUnlockedIcon(content): Promise<void> {
|
||||
return this.contentList.checkUnlockedIcon(content);
|
||||
}
|
||||
|
||||
async checkDeleteIsDisabled(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`);
|
||||
@@ -134,14 +100,6 @@ export class ContentServicesPage {
|
||||
await this.checkContentIsNotDisplayed(content);
|
||||
}
|
||||
|
||||
async clickDeleteOnToolbar(): Promise<void> {
|
||||
await BrowserActions.click(this.deleteNodesButton);
|
||||
}
|
||||
|
||||
async checkToolbarDeleteIsDisabled(): Promise<boolean> {
|
||||
return !(await this.deleteNodesButton.isEnabled());
|
||||
}
|
||||
|
||||
async metadataContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await BrowserActions.click(this.metadataAction);
|
||||
@@ -152,21 +110,6 @@ export class ContentServicesPage {
|
||||
await BrowserActions.click(this.versionManagerAction);
|
||||
}
|
||||
|
||||
async copyContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await BrowserActions.click(this.copyContentElement);
|
||||
}
|
||||
|
||||
async moveContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await BrowserActions.click(this.moveContentElement);
|
||||
}
|
||||
|
||||
async lockContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await BrowserActions.click(this.lockContentElement);
|
||||
}
|
||||
|
||||
async clickFileHyperlink(fileName): Promise<void> {
|
||||
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
|
||||
await BrowserActions.click(hyperlink);
|
||||
@@ -182,15 +125,6 @@ export class ContentServicesPage {
|
||||
await BrowserActions.click(hyperlinkToggle);
|
||||
}
|
||||
|
||||
async enableDropFilesInAFolder(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.multipleFileUploadToggle);
|
||||
}
|
||||
|
||||
async disableDropFilesInAFolder(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
await this.togglePage.disableToggle(this.multipleFileUploadToggle);
|
||||
}
|
||||
|
||||
async getElementsDisplayedId() {
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
|
||||
}
|
||||
@@ -313,31 +247,6 @@ export class ContentServicesPage {
|
||||
await BrowserActions.click(this.createFolderButton);
|
||||
}
|
||||
|
||||
async clickOnFavoriteButton(): Promise<void> {
|
||||
await BrowserActions.click(this.favoriteButton);
|
||||
}
|
||||
|
||||
async checkIsMarkedFavorite(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite);
|
||||
}
|
||||
|
||||
async checkIsNotMarkedFavorite(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite);
|
||||
}
|
||||
|
||||
async clickOnEditFolder(): Promise<void> {
|
||||
await BrowserActions.click(this.editFolderButton);
|
||||
}
|
||||
|
||||
async isEditFolderButtonEnabled(): Promise<boolean> {
|
||||
return this.editFolderButton.isEnabled();
|
||||
}
|
||||
|
||||
async openCreateLibraryDialog(): Promise<void> {
|
||||
await BrowserActions.click(this.createLibraryButton);
|
||||
await this.createLibraryDialog.libraryDialog.waitVisible();
|
||||
}
|
||||
|
||||
async createNewFolder(folderName: string): Promise<void> {
|
||||
await this.clickOnCreateNewFolder();
|
||||
await this.createFolderDialog.addFolderName(folderName);
|
||||
@@ -355,17 +264,17 @@ export class ContentServicesPage {
|
||||
await this.contentList.dataTablePage().waitTillContentLoaded();
|
||||
}
|
||||
|
||||
async checkContentIsDisplayed(content): Promise<void> {
|
||||
async checkContentIsDisplayed(content: string): Promise<void> {
|
||||
await this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
|
||||
}
|
||||
|
||||
async checkContentsAreDisplayed(content): Promise<void> {
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
await this.checkContentIsDisplayed(content[i]);
|
||||
async checkContentsAreDisplayed(content: string[]): Promise<void> {
|
||||
for (const item of content) {
|
||||
await this.checkContentIsDisplayed(item);
|
||||
}
|
||||
}
|
||||
|
||||
async checkContentIsNotDisplayed(content): Promise<void> {
|
||||
async checkContentIsNotDisplayed(content: string): Promise<void> {
|
||||
await this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
|
||||
}
|
||||
|
||||
@@ -380,17 +289,13 @@ export class ContentServicesPage {
|
||||
await this.deleteAndCheckFolderNotDisplayed(subFolderName);
|
||||
}
|
||||
|
||||
async getActiveBreadcrumb(): Promise<string> {
|
||||
return BrowserActions.getAttribute(this.activeBreadcrumb, 'title');
|
||||
}
|
||||
|
||||
async uploadFile(fileLocation): Promise<void> {
|
||||
async uploadFile(fileLocation: string): Promise<void> {
|
||||
await this.checkUploadButton();
|
||||
await this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
|
||||
await this.checkUploadButton();
|
||||
}
|
||||
|
||||
async uploadMultipleFile(files): Promise<void> {
|
||||
async uploadMultipleFile(files: string[]): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||
let allFiles = path.resolve(path.join(browser.params.testConfig.main.rootPath, files[0]));
|
||||
for (let i = 1; i < files.length; i++) {
|
||||
@@ -405,16 +310,6 @@ export class ContentServicesPage {
|
||||
await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folderLocation)));
|
||||
}
|
||||
|
||||
async getSingleFileButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
|
||||
return BrowserActions.getAttribute(this.uploadFileButtonInput, 'title');
|
||||
}
|
||||
|
||||
async getMultipleFileButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||
return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title');
|
||||
}
|
||||
|
||||
async checkUploadButton(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
|
||||
}
|
||||
@@ -514,27 +409,27 @@ export class ContentServicesPage {
|
||||
return $$('div.app-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
|
||||
}
|
||||
|
||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||
async getDocumentCardIconForElement(elementName: string): Promise<string> {
|
||||
const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`);
|
||||
return BrowserActions.getAttribute(elementIcon, 'src');
|
||||
}
|
||||
|
||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||
async checkDocumentCardPropertyIsShowed(elementName: string, propertyName: string): Promise<void> {
|
||||
const elementProperty = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||
}
|
||||
|
||||
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
|
||||
async getAttributeValueForElement(elementName: string, propertyName: string): Promise<string> {
|
||||
const elementSize = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`);
|
||||
return BrowserActions.getText(elementSize);
|
||||
}
|
||||
|
||||
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
|
||||
async checkMenuIsShowedForElementIndex(elementIndex: number): Promise<void> {
|
||||
const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||
}
|
||||
|
||||
async navigateToCardFolder(folderName): Promise<void> {
|
||||
async navigateToCardFolder(folderName: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const folderCard = $(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`);
|
||||
await BrowserActions.click(folderCard);
|
||||
@@ -543,22 +438,16 @@ export class ContentServicesPage {
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
async selectGridSortingFromDropdown(sortingOption): Promise<void> {
|
||||
async selectGridSortingFromDropdown(sortingOption: string): Promise<void> {
|
||||
await this.sortingDropdown.selectDropdownOption(sortingOption);
|
||||
}
|
||||
|
||||
async checkRowIsDisplayed(rowName): Promise<void> {
|
||||
async checkRowIsDisplayed(rowName: string): Promise<void> {
|
||||
const row = this.contentList.dataTablePage().getCellElementByValue(this.columns.name, rowName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
}
|
||||
|
||||
async clickShareButton(): Promise<void> {
|
||||
await browser.sleep(2000);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.shareNodeButton);
|
||||
}
|
||||
|
||||
async checkSelectedSiteIsDisplayed(siteName): Promise<void> {
|
||||
async checkSelectedSiteIsDisplayed(siteName: string): Promise<void> {
|
||||
await this.siteListDropdown.checkOptionIsSelected(siteName);
|
||||
}
|
||||
|
||||
@@ -580,10 +469,6 @@ export class ContentServicesPage {
|
||||
await BrowserActions.click(this.selectAllCheckbox);
|
||||
}
|
||||
|
||||
getRowByName(rowName: string): ElementFinder {
|
||||
return this.contentList.dataTable.getRow(this.columns.name, rowName);
|
||||
}
|
||||
|
||||
async selectFolder(folderName: string): Promise<void> {
|
||||
const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { $ } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
const source = {
|
||||
favorites: 'Favorites',
|
||||
recent: 'Recent',
|
||||
sharedLinks: 'Shared Links',
|
||||
sites: 'Sites',
|
||||
mySites: 'My Sites',
|
||||
trashcan: 'Trashcan',
|
||||
root: 'Root',
|
||||
my: 'My',
|
||||
shared: 'Shared'
|
||||
};
|
||||
|
||||
const column = {
|
||||
status: 'Status'
|
||||
};
|
||||
|
||||
export class CustomSourcesPage {
|
||||
dataTable = new DataTableComponentPage();
|
||||
navigationBarPage = new NavigationBarPage();
|
||||
|
||||
toolbar = $('app-custom-sources .adf-toolbar-title');
|
||||
selectModeDropdown = new DropdownPage($('mat-select[data-automation-id="custom-sources-select"]'));
|
||||
|
||||
async waitForToolbarToBeVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
|
||||
}
|
||||
|
||||
async navigateToCustomSources(): Promise<void> {
|
||||
await this.navigationBarPage.clickCustomSources();
|
||||
await this.waitForToolbarToBeVisible();
|
||||
}
|
||||
|
||||
async selectMySitesSourceType(): Promise<void> {
|
||||
await this.selectModeDropdown.selectDropdownOption(source.mySites);
|
||||
}
|
||||
|
||||
async selectFavoritesSourceType(): Promise<void> {
|
||||
await this.selectModeDropdown.selectDropdownOption(source.favorites);
|
||||
}
|
||||
|
||||
async selectSharedLinksSourceType(): Promise<void> {
|
||||
await this.selectModeDropdown.selectDropdownOption(source.sharedLinks);
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName: string): Promise<void> {
|
||||
return this.dataTable.checkContentIsDisplayed('Name', rowName);
|
||||
}
|
||||
|
||||
checkRowIsNotDisplayed(rowName: string): Promise<void> {
|
||||
return this.dataTable.checkContentIsNotDisplayed('Name', rowName);
|
||||
}
|
||||
|
||||
async getStatusCell(rowName: string): Promise<string> {
|
||||
const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status);
|
||||
return BrowserActions.getText(cell);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { $, $$ } from 'protractor';
|
||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateLibraryDialogPage {
|
||||
libraryDialog = TestElement.byCss('[role="dialog"]');
|
||||
libraryTitle = TestElement.byCss('.adf-library-dialog>h2');
|
||||
libraryNameField = TestElement.byCss('input[formcontrolname="title"]');
|
||||
libraryIdField = TestElement.byCss('input[formcontrolname="id"]');
|
||||
libraryDescriptionField = TestElement.byCss('textarea[formcontrolname="description"]');
|
||||
publicRadioButton = TestElement.byCss('[data-automation-id="PUBLIC"]>label');
|
||||
privateRadioButton = TestElement.byCss('[data-automation-id="PRIVATE"]>label');
|
||||
moderatedRadioButton = TestElement.byCss('[data-automation-id="MODERATED"]>label');
|
||||
cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]');
|
||||
createButton = TestElement.byCss('button[data-automation-id="create-library-id"]');
|
||||
errorMessage = TestElement.byCss('.mat-dialog-content .mat-error');
|
||||
errorMessages = $$('.mat-dialog-content .mat-error');
|
||||
libraryNameHint = TestElement.byCss('adf-library-dialog .mat-hint');
|
||||
|
||||
async getSelectedRadio(): Promise<string> {
|
||||
const radio = $('.mat-radio-button[class*="checked"]');
|
||||
return BrowserActions.getText(radio);
|
||||
}
|
||||
|
||||
async getErrorMessages(position: number): Promise<string> {
|
||||
return BrowserActions.getText(this.errorMessages.get(position));
|
||||
}
|
||||
}
|
||||
@@ -15,73 +15,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { $$, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { $$ } from 'protractor';
|
||||
import { BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class FolderDialogPage {
|
||||
|
||||
folderDialog = $$('adf-folder-dialog').first();
|
||||
folderNameField = this.folderDialog.$('#adf-folder-name-input');
|
||||
folderDescriptionField = this.folderDialog.$('#adf-folder-description-input');
|
||||
createUpdateButton = this.folderDialog.$('#adf-folder-create-button');
|
||||
cancelButton = this.folderDialog.$('#adf-folder-cancel-button');
|
||||
folderTitle = this.folderDialog.$('h2.mat-dialog-title');
|
||||
validationMessage = this.folderDialog.$('div.mat-form-field-subscript-wrapper mat-hint span');
|
||||
|
||||
async getDialogTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.folderTitle);
|
||||
}
|
||||
|
||||
async checkFolderDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.folderDialog);
|
||||
}
|
||||
|
||||
async checkFolderDialogIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog);
|
||||
}
|
||||
|
||||
async clickOnCreateUpdateButton(): Promise<void> {
|
||||
await BrowserActions.click(this.createUpdateButton);
|
||||
}
|
||||
|
||||
async clickOnCancelButton(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
async addFolderName(folderName): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.folderNameField, folderName);
|
||||
}
|
||||
|
||||
async addFolderDescription(folderDescription): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
|
||||
}
|
||||
|
||||
async getFolderName(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.folderNameField);
|
||||
}
|
||||
|
||||
async getValidationMessage(): Promise<string> {
|
||||
return BrowserActions.getText(this.validationMessage);
|
||||
}
|
||||
|
||||
async checkValidationMessageIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage);
|
||||
}
|
||||
|
||||
getFolderNameField(): ElementFinder {
|
||||
return this.folderNameField;
|
||||
}
|
||||
|
||||
getFolderDescriptionField(): ElementFinder {
|
||||
return this.folderDescriptionField;
|
||||
}
|
||||
|
||||
async checkCreateUpdateBtnIsEnabled(): Promise<boolean> {
|
||||
return this.createUpdateButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkCancelBtnIsEnabled(): Promise<void> {
|
||||
await this.cancelButton.isEnabled();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { $$, $ } from 'protractor';
|
||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||
import { format, add } from 'date-fns';
|
||||
export class ShareDialogPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
dateTimePickerPage = new DateTimePickerPage();
|
||||
shareDialog = $('adf-share-dialog');
|
||||
dialogTitle = $$('[data-automation-id="adf-share-dialog-title"]').first();
|
||||
shareToggle = $('[data-automation-id="adf-share-toggle"] label');
|
||||
expireToggle = $(`[data-automation-id="adf-expire-toggle"] label`);
|
||||
shareToggleChecked = $('mat-dialog-container mat-slide-toggle.mat-checked');
|
||||
shareLink = $('[data-automation-id="adf-share-link"]');
|
||||
closeButton = $('button[data-automation-id="adf-share-dialog-close"]');
|
||||
copySharedLinkButton = $('.adf-input-action');
|
||||
expirationDateInput = $('input[formcontrolname="time"]');
|
||||
confirmationDialog = $('adf-confirm-dialog');
|
||||
confirmationCancelButton = $('#adf-confirm-cancel');
|
||||
confirmationRemoveButton = $('#adf-confirm-accept');
|
||||
|
||||
async checkDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
||||
}
|
||||
|
||||
async clickUnShareFile() {
|
||||
await this.togglePage.enableToggle(this.shareToggle);
|
||||
}
|
||||
|
||||
async clickExpireToggle() {
|
||||
await this.togglePage.enableToggle(this.expireToggle);
|
||||
}
|
||||
|
||||
async clickConfirmationDialogCancelButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationCancelButton);
|
||||
}
|
||||
|
||||
async clickConfirmationDialogRemoveButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationRemoveButton);
|
||||
}
|
||||
|
||||
async checkShareLinkIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.shareLink);
|
||||
}
|
||||
|
||||
async getShareLink(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.shareLink);
|
||||
}
|
||||
|
||||
async clickCloseButton(): Promise<void> {
|
||||
await BrowserActions.click(this.closeButton);
|
||||
}
|
||||
|
||||
async clickShareLinkButton(): Promise<void> {
|
||||
await BrowserActions.click(this.copySharedLinkButton);
|
||||
}
|
||||
|
||||
async shareToggleButtonIsChecked(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.shareToggleChecked);
|
||||
}
|
||||
|
||||
async dialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale(this.shareDialog);
|
||||
}
|
||||
|
||||
async clickDateTimePickerButton(): Promise<void> {
|
||||
await this.dateTimePickerPage.clickDateTimePicker();
|
||||
}
|
||||
|
||||
async calendarTodayDayIsDisabled(): Promise<void> {
|
||||
const tomorrow = format(add(new Date(), {days: 1}), 'd');
|
||||
|
||||
if (tomorrow !== '1') {
|
||||
await this.dateTimePickerPage.checkCalendarTodayDayIsDisabled();
|
||||
}
|
||||
}
|
||||
|
||||
async setDefaultDay(): Promise<void> {
|
||||
const tomorrow = format(add(new Date(), {days: 1}), 'd');
|
||||
await this.dateTimePickerPage.setDate(tomorrow);
|
||||
}
|
||||
|
||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
|
||||
}
|
||||
|
||||
async getExpirationDate(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.expirationDateInput);
|
||||
}
|
||||
|
||||
async expirationDateInputHasValue(value): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasValue(this.expirationDateInput, value);
|
||||
}
|
||||
|
||||
async confirmationDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.confirmationDialog);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@ export class UploadDialogPage {
|
||||
uploadedStatusIcon = 'mat-icon[class*="status--done"]';
|
||||
cancelledStatusIcon = 'div[class*="status--cancelled"]';
|
||||
errorStatusIcon = 'div[class*="status--error"] mat-icon';
|
||||
errorTooltip = $('div.mat-tooltip');
|
||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||
title = $('span[class*="upload-dialog__title"]');
|
||||
minimizeButton = $('mat-icon[title="Minimize"]');
|
||||
@@ -121,6 +120,6 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async getTooltip(): Promise<string> {
|
||||
return BrowserActions.getText(this.errorTooltip);
|
||||
return BrowserActions.getAttribute($(this.errorStatusIcon), 'title');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,18 +90,6 @@ export class NavigationBarPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async clickTrashcanButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Trashcan');
|
||||
}
|
||||
|
||||
async clickCustomSources(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Custom Sources');
|
||||
}
|
||||
|
||||
async clickOverlayViewerButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Overlay Viewer');
|
||||
}
|
||||
|
||||
async clickTreeViewButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Tree View');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user