mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -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');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user