mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5761] Demo Shell pages cleanup (#8802)
remove the content that is not covered by e2e testing, preparation steps for the demo shell decommissioning
This commit is contained in:
@@ -1,252 +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 { $, by, element } from 'protractor';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
CardTextItemPage,
|
||||
DropdownPage,
|
||||
CardBooleanItemPage
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class CardViewComponentPage {
|
||||
|
||||
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
nameCardTextItem = new CardTextItemPage('name');
|
||||
booleanCardBooleanItem = new CardBooleanItemPage('boolean');
|
||||
intField = $(`input[data-automation-id='card-textitem-editinput-int']`);
|
||||
floatField = $(`input[data-automation-id='card-textitem-editinput-float']`);
|
||||
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||
consoleLog = element(by.className('app-console'));
|
||||
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
resetButton = $(`#adf-reset-card-log`);
|
||||
editableSwitch = $('#app-toggle-editable');
|
||||
clearDateSwitch = $('#app-toggle-clear-date');
|
||||
noneOptionSwitch = $('#app-toggle-none-option');
|
||||
clickableField = $(`[data-automation-id="card-textitem-toggle-click"]`);
|
||||
|
||||
selectDropdown = new DropdownPage($('mat-select[data-automation-class="select-box"]'));
|
||||
|
||||
async clickOnAddButton(): Promise<void> {
|
||||
await BrowserActions.click(this.addButton);
|
||||
}
|
||||
|
||||
async checkNameTextLabelIsPresent(): Promise<void> {
|
||||
await this.nameCardTextItem.checkLabelIsPresent();
|
||||
}
|
||||
|
||||
async getNameTextFieldText(): Promise<string> {
|
||||
return this.nameCardTextItem.getFieldValue();
|
||||
}
|
||||
|
||||
async enterNameTextField(text: string): Promise<void> {
|
||||
await this.nameCardTextItem.enterTextField(text);
|
||||
}
|
||||
|
||||
async clickOnNameTextSaveIcon(): Promise<void> {
|
||||
await this.nameCardTextItem.clickOnSaveButton();
|
||||
}
|
||||
|
||||
async clickOnNameTextClearIcon(): Promise<void> {
|
||||
await this.nameCardTextItem.clickOnClearButton();
|
||||
}
|
||||
|
||||
async clickOnResetButton(): Promise<void> {
|
||||
await BrowserActions.click(this.resetButton);
|
||||
}
|
||||
|
||||
async clickOnIntField(): Promise<void> {
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-int"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
}
|
||||
|
||||
async clickOnIntClearIcon(): Promise<void> {
|
||||
const clearIcon = $('button[data-automation-id="card-textitem-reset-int"]');
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnIntSaveIcon(): Promise<void> {
|
||||
const saveIcon = $('button[data-automation-id="card-textitem-update-int"]');
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
async enterIntField(text): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.intField, text);
|
||||
}
|
||||
|
||||
getIntFieldText(): Promise<string> {
|
||||
const textField = $('span[data-automation-id="card-textitem-value-int"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorInt(): Promise<string> {
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async clickOnFloatField(): Promise<void> {
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-float"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
}
|
||||
|
||||
async clickOnFloatClearIcon(): Promise<void> {
|
||||
const clearIcon = $(`button[data-automation-id="card-textitem-reset-float"]`);
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnFloatSaveIcon(): Promise<void> {
|
||||
const saveIcon = $(`button[data-automation-id="card-textitem-update-float"]`);
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
async enterFloatField(text): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.floatField, text);
|
||||
}
|
||||
|
||||
getFloatFieldText(): Promise<string> {
|
||||
const textField = $('span[data-automation-id="card-textitem-value-float"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorFloat(): Promise<string> {
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-float"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async setName(name: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.nameInputField, name);
|
||||
}
|
||||
|
||||
async setValue(value): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.valueInputField, value);
|
||||
}
|
||||
|
||||
async waitForOutput(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.consoleLog);
|
||||
}
|
||||
|
||||
getOutputText(index: number): Promise<string> {
|
||||
return BrowserActions.getText(this.consoleLog.$$('p').get(index));
|
||||
}
|
||||
|
||||
async deletePairsValues(): Promise<void> {
|
||||
await BrowserActions.click(this.deleteButton);
|
||||
}
|
||||
|
||||
async clickSelectBox(): Promise<void> {
|
||||
await this.selectDropdown.clickDropdown();
|
||||
await this.selectDropdown.checkOptionsPanelIsDisplayed();
|
||||
}
|
||||
|
||||
async checkboxClick(): Promise<void> {
|
||||
await this.booleanCardBooleanItem.checkboxClick();
|
||||
}
|
||||
|
||||
async checkBooleanLabelIsPresent(): Promise<void> {
|
||||
await this.booleanCardBooleanItem.checkLabelIsPresent();
|
||||
}
|
||||
|
||||
async selectValueFromComboBox(index): Promise<void> {
|
||||
await this.selectDropdown.selectOptionFromIndex(index);
|
||||
}
|
||||
|
||||
async disableEdit(): Promise<void> {
|
||||
const check = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (check.indexOf('mat-checked') > -1) {
|
||||
await BrowserActions.click(this.editableSwitch);
|
||||
await expect(await BrowserActions.getAttribute(this.editableSwitch, 'class')).not.toContain('mat-checked');
|
||||
}
|
||||
}
|
||||
|
||||
async getDateValue(): Promise<string> {
|
||||
const dateValue = $('span[data-automation-id="card-date-value-date"]');
|
||||
return dateValue.getText();
|
||||
}
|
||||
|
||||
async getDateTimeValue(): Promise<string> {
|
||||
const dateTimeValue = $('span[data-automation-id="card-datetime-value-datetime"]');
|
||||
return dateTimeValue.getText();
|
||||
}
|
||||
|
||||
async clearDateField(): Promise<void> {
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-date"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async clearDateTimeField(): Promise<void> {
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-datetime"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async enableClearDate(): Promise<void> {
|
||||
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.clearDateSwitch.click();
|
||||
const clearDateChecked = $('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clearDateChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async enableNoneOption(): Promise<void> {
|
||||
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.noneOptionSwitch.click();
|
||||
const noneOptionChecked = $('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(noneOptionChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async isErrorNotDisplayed(): Promise<boolean> {
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async getClickableValue(): Promise<string> {
|
||||
return this.clickableField.getText();
|
||||
}
|
||||
|
||||
async updateClickableField(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
||||
await BrowserActions.click(this.clickableField);
|
||||
const inputField = $('input[data-automation-id="card-textitem-editinput-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(inputField);
|
||||
await BrowserActions.clearSendKeys(inputField, text);
|
||||
const save = $('[data-automation-id="card-textitem-update-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(save);
|
||||
await BrowserActions.click(save);
|
||||
}
|
||||
|
||||
async hasCardViewConsoleLog(text: string): Promise<string> {
|
||||
const cardViewConsole = element(by.cssContainingText('.app-console', text));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(cardViewConsole);
|
||||
return cardViewConsole.getText();
|
||||
}
|
||||
|
||||
async clearIntField(): Promise<void> {
|
||||
await this.intField.clear();
|
||||
}
|
||||
|
||||
}
|
@@ -69,17 +69,17 @@ 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 '));
|
||||
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*="METADATA"]');
|
||||
versionManagerAction = $('button[data-automation-id*="VERSIONS"]');
|
||||
moveContentElement = $('button[data-automation-id*="MOVE"]');
|
||||
copyContentElement = $('button[data-automation-id*="COPY"]');
|
||||
lockContentElement = $('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]');
|
||||
downloadContent = $('button[data-automation-id*="DOWNLOAD"]');
|
||||
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'));
|
||||
@@ -124,7 +124,7 @@ export class ContentServicesPage {
|
||||
|
||||
async checkDeleteIsDisabled(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
const disabledDelete = $(`button[data-automation-id*='DELETE'][disabled='true']`);
|
||||
const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
|
@@ -1,86 +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 { $, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
columns = {
|
||||
id: 'Id',
|
||||
name: 'Name',
|
||||
createdBy: 'Created By',
|
||||
json: 'Json'
|
||||
};
|
||||
|
||||
data = {
|
||||
copyClipboardDataTable: 'copyClipboard-datatable',
|
||||
defaultTable: 'datatable'
|
||||
};
|
||||
|
||||
dataTable: DataTableComponentPage;
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`);
|
||||
selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
|
||||
idColumnHeader = $(`div[data-automation-id='auto_id_id']`);
|
||||
selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`));
|
||||
|
||||
constructor(data?) {
|
||||
if (this.data[data]) {
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data[data] + `']`));
|
||||
} else {
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data.defaultTable + `']`));
|
||||
}
|
||||
}
|
||||
|
||||
async checkRowIsNotSelected(rowNumber: string): Promise<void> {
|
||||
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
|
||||
.element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(isRowSelected);
|
||||
}
|
||||
|
||||
async checkNoRowIsSelected(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
|
||||
}
|
||||
|
||||
async getNumberOfSelectedRows(): Promise<number> {
|
||||
return this.allSelectedRows.count();
|
||||
}
|
||||
|
||||
async selectRow(rowNumber: string): Promise<void> {
|
||||
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
|
||||
await BrowserActions.click(row);
|
||||
}
|
||||
|
||||
async selectRowWithKeyboard(rowNumber: string): Promise<void> {
|
||||
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
|
||||
await this.selectRow(rowNumber);
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
}
|
||||
|
||||
async selectSelectionMode(selectionMode: string): Promise<void> {
|
||||
await this.selectModeDropdown.selectDropdownOption(selectionMode);
|
||||
}
|
||||
|
||||
getDropTargetIdColumnCell(rowNumber: number): ElementFinder {
|
||||
return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id);
|
||||
}
|
||||
|
||||
getDropTargetIdColumnHeader(): ElementFinder {
|
||||
return this.idColumnHeader;
|
||||
}
|
||||
}
|
@@ -96,14 +96,6 @@ export class ShareDialogPage {
|
||||
await this.dateTimePickerPage.setDate(tomorrow);
|
||||
}
|
||||
|
||||
async setDefaultHour(): Promise<void> {
|
||||
await this.dateTimePickerPage.dateTime.setDefaultEnabledHour();
|
||||
}
|
||||
|
||||
async setDefaultMinutes() {
|
||||
await this.dateTimePickerPage.dateTime.setDefaultEnabledMinutes();
|
||||
}
|
||||
|
||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
|
||||
}
|
||||
|
@@ -1,43 +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 { $, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class IconsPage {
|
||||
|
||||
locateCustomIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] svg`);
|
||||
locateLigatureIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] .material-icons`);
|
||||
|
||||
async isCustomIconDisplayed(name: string) {
|
||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
|
||||
if (present) {
|
||||
return this.locateCustomIcon(name).isDisplayed();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async isLigatureIconDisplayed(name: string) {
|
||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateLigatureIcon(name));
|
||||
if (present) {
|
||||
return this.locateLigatureIcon(name).isDisplayed();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -15,41 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { $, browser, by, element } from 'protractor';
|
||||
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class LoginShellPage {
|
||||
loginURL = browser.baseUrl + '/login';
|
||||
loginSSOPage = new LoginPage();
|
||||
|
||||
togglePage = new TogglePage();
|
||||
txtUsername = $('input[id="username"]');
|
||||
txtPassword = $('input[id="password"]');
|
||||
logoImg = $('img[id="adf-login-img-logo"]');
|
||||
logoTxt = $('input[data-automation-id="adf-url-logo"]');
|
||||
usernameError = $('span[data-automation-id="username-error"]');
|
||||
usernameInactive = $('input[id="username"][class*="ng-invalid"]');
|
||||
adfLogo = $('.adf-img-logo');
|
||||
|
||||
usernameHighlighted = $('input[id="username"][aria-invalid="true"]');
|
||||
signInButton = $('#login-button');
|
||||
showPasswordElement = $('button[data-automation-id="show_password"]');
|
||||
hidePasswordElement = $('button[data-automation-id="hide_password"]');
|
||||
rememberMe = $('mat-checkbox[id="adf-login-remember"]');
|
||||
needHelp = $('#adf-login-action-left');
|
||||
register = $('#adf-login-action-right');
|
||||
footerSwitch = $('#switch4');
|
||||
rememberMeSwitch = $('#adf-toggle-show-rememberme');
|
||||
logoSwitch = $('#adf-toggle-logo');
|
||||
header = $('#adf-header');
|
||||
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
||||
private txtUsername = $('input[id="username"]');
|
||||
private txtPassword = $('input[id="password"]');
|
||||
private signInButton = $('#login-button');
|
||||
sidenavLayout = $(`[data-automation-id="sidenav-layout"]`);
|
||||
|
||||
async goToLoginPage(): Promise<void> {
|
||||
await BrowserActions.getUrl(this.loginURL);
|
||||
await this.waitForElements();
|
||||
}
|
||||
|
||||
async waitForElements(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtUsername);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
@@ -63,114 +37,7 @@ export class LoginShellPage {
|
||||
await BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
}
|
||||
|
||||
async clearUsername(): Promise<void> {
|
||||
await BrowserActions.click(this.txtUsername);
|
||||
await BrowserActions.clearWithBackSpace(this.txtUsername);
|
||||
}
|
||||
|
||||
async clearPassword(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
await BrowserActions.clearWithBackSpace(this.txtPassword);
|
||||
}
|
||||
|
||||
async getUsernameTooltip(): Promise<string> {
|
||||
return BrowserActions.getText(this.usernameError);
|
||||
}
|
||||
|
||||
async checkLoginImgURL(): Promise<string> {
|
||||
return BrowserActions.getAttribute(this.logoImg, 'src');
|
||||
}
|
||||
|
||||
async checkUsernameInactive(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameInactive);
|
||||
}
|
||||
|
||||
async checkUsernameHighlighted(): Promise<void> {
|
||||
await BrowserActions.click(this.adfLogo);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameHighlighted);
|
||||
}
|
||||
|
||||
async checkUsernameTooltipIsNotVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.usernameError);
|
||||
}
|
||||
|
||||
async getSignInButtonIsEnabled(): Promise<boolean> {
|
||||
return this.signInButton.isEnabled();
|
||||
}
|
||||
|
||||
async clickSignInButton(): Promise<void> {
|
||||
await BrowserActions.click(this.signInButton);
|
||||
}
|
||||
|
||||
async clickSettingsIcon(): Promise<void> {
|
||||
await BrowserActions.click(this.settingsIcon);
|
||||
}
|
||||
|
||||
async showPassword(): Promise<void> {
|
||||
await BrowserActions.click(this.showPasswordElement);
|
||||
}
|
||||
|
||||
async hidePassword(): Promise<void> {
|
||||
await BrowserActions.click(this.hidePasswordElement);
|
||||
}
|
||||
|
||||
async getShownPassword(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.txtPassword);
|
||||
}
|
||||
|
||||
async checkPasswordIsHidden(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
}
|
||||
|
||||
async checkRememberIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.rememberMe);
|
||||
}
|
||||
|
||||
async checkRememberIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.rememberMe);
|
||||
}
|
||||
|
||||
async checkNeedHelpIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.needHelp);
|
||||
}
|
||||
|
||||
async checkNeedHelpIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.needHelp);
|
||||
}
|
||||
|
||||
async checkRegisterDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.register);
|
||||
}
|
||||
|
||||
async checkRegisterIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.register);
|
||||
}
|
||||
|
||||
async enableFooter(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.footerSwitch);
|
||||
}
|
||||
|
||||
async disableFooter(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.footerSwitch);
|
||||
}
|
||||
|
||||
async disableRememberMe(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.rememberMeSwitch);
|
||||
}
|
||||
|
||||
async enableLogoSwitch(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.logoSwitch);
|
||||
}
|
||||
|
||||
async enterLogo(logo: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.logoTxt, logo);
|
||||
}
|
||||
|
||||
async login(username: string, password: string): Promise<void> {
|
||||
await this.loginSSOPage.login(username, password);
|
||||
}
|
||||
|
||||
async loginWithProfile(profile: string): Promise<void> {
|
||||
await this.loginSSOPage.loginWithProfile(profile);
|
||||
}
|
||||
}
|
||||
|
@@ -1,28 +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 } from '@alfresco/adf-testing';
|
||||
|
||||
export class LogoutPage {
|
||||
|
||||
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||
|
||||
async checkLogoutSectionIsDisplayed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||
}
|
||||
}
|
@@ -21,8 +21,6 @@ import { ProcessServicesPage } from '../../process-services/pages/process-servic
|
||||
|
||||
export class NavigationBarPage {
|
||||
linkMenuChildrenContainer = $('.nestedMenu');
|
||||
dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]');
|
||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]');
|
||||
processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]');
|
||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]');
|
||||
formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]');
|
||||
@@ -100,31 +98,6 @@ export class NavigationBarPage {
|
||||
await this.clickNavigationBarItem('Custom Sources');
|
||||
}
|
||||
|
||||
async clickDataTable(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Datatable');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToDatatable(): Promise<void> {
|
||||
await this.clickDataTable();
|
||||
await BrowserActions.click(this.dataTableNestedButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToDragAndDropDatatable(): Promise<void> {
|
||||
await this.clickDataTable();
|
||||
await BrowserActions.click(this.dataTableDragAndDropButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async clickTagButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Tag');
|
||||
}
|
||||
|
||||
async clickSocialButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Social');
|
||||
}
|
||||
|
||||
async clickOverlayViewerButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Overlay Viewer');
|
||||
}
|
||||
|
@@ -1,95 +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 { element, by, browser, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage, SnackbarPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class NotificationDemoPage {
|
||||
|
||||
snackbarPage = new SnackbarPage();
|
||||
|
||||
messageField = $('input[data-automation-id="notification-message"]');
|
||||
decorativeIconField = $('input[data-automation-id="notification-icon"]');
|
||||
durationField = $('input[data-automation-id="notification-duration"]');
|
||||
actionToggle = $('mat-slide-toggle[data-automation-id="notification-action-toggle"]');
|
||||
notificationSnackBar = $$('simple-snack-bar').first();
|
||||
actionOutput = $('div[data-automation-id="notification-action-output"]');
|
||||
notificationsPage = $('.app-sidenav-link[data-automation-id="Notifications"]');
|
||||
notificationConfig = $('p[data-automation-id="notification-custom-object"]');
|
||||
|
||||
horizontalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-horizontal-position"]'));
|
||||
verticalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-vertical-position"]'));
|
||||
directionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-direction"]'));
|
||||
|
||||
async checkNotifyContains(message): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
||||
}
|
||||
|
||||
async goToNotificationsPage(): Promise<void> {
|
||||
await BrowserActions.click(this.notificationsPage);
|
||||
}
|
||||
|
||||
getConfigObject(): Promise<string> {
|
||||
return BrowserActions.getText(this.notificationConfig);
|
||||
}
|
||||
|
||||
async enterMessageField(text: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.messageField, text);
|
||||
}
|
||||
|
||||
async enterDecorativeIconField(icon: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.decorativeIconField, icon);
|
||||
}
|
||||
|
||||
async enterDurationField(time: number): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.durationField, time.toString());
|
||||
}
|
||||
|
||||
async selectHorizontalPosition(selectItem: string): Promise<void> {
|
||||
await this.horizontalPositionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async selectVerticalPosition(selectItem: string): Promise<void> {
|
||||
await this.verticalPositionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async selectDirection(selectItem: string): Promise<void> {
|
||||
await this.directionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async clickNotificationButton(): Promise<void> {
|
||||
const button = $('button[data-automation-id="notification-custom-config-button"]');
|
||||
await BrowserActions.click(button);
|
||||
}
|
||||
|
||||
async checkActionEvent(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.actionOutput);
|
||||
}
|
||||
|
||||
async clickActionToggle(): Promise<void> {
|
||||
await BrowserActions.click(this.actionToggle);
|
||||
}
|
||||
|
||||
async clickActionButton(): Promise<void> {
|
||||
await browser.executeScript(`document.querySelector("[data-automation-id='adf-snackbar-message-content-action-button']").click();`);
|
||||
}
|
||||
|
||||
async clearMessage(): Promise<void> {
|
||||
await BrowserActions.click(this.messageField);
|
||||
await BrowserActions.clearWithBackSpace(this.messageField);
|
||||
}
|
||||
}
|
@@ -19,28 +19,21 @@ import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/a
|
||||
import { browser, $$, $ } from 'protractor';
|
||||
|
||||
export class TrashcanPage {
|
||||
|
||||
contentList = new DocumentListPage($('adf-document-list'));
|
||||
rows = $$('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||
pagination = $('adf-pagination');
|
||||
emptyTrashcan = $('adf-empty-content');
|
||||
restoreButton = $(`button[title='Restore']`);
|
||||
private contentList = new DocumentListPage($('adf-document-list'));
|
||||
private restoreButton = $(`button[title='Restore']`);
|
||||
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return this.rows.count();
|
||||
const rows = $$('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
return rows.count();
|
||||
}
|
||||
|
||||
async waitForTableBody(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
async waitForPagination(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.pagination);
|
||||
const tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(tableBody);
|
||||
}
|
||||
|
||||
async checkTrashcanIsEmpty(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyTrashcan);
|
||||
await BrowserVisibility.waitUntilElementIsVisible($('adf-empty-content'));
|
||||
}
|
||||
|
||||
getDocumentList(): DocumentListPage {
|
||||
@@ -55,9 +48,4 @@ export class TrashcanPage {
|
||||
async checkRestoreButtonIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.restoreButton);
|
||||
}
|
||||
|
||||
async checkRestoreButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.restoreButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user