mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1928] e2e improvements - part1 (#883)
* refactor Mark as favourite tests rename method to be more clear create separate methods for some checks and actions * forgot some changes * refactor delete-undo tests * some more refactoring * fix
This commit is contained in:
committed by
Suzana Dirla
parent
0882686172
commit
b8ce533759
@@ -252,10 +252,6 @@ export class DataTable extends Component {
|
||||
}
|
||||
|
||||
async getItemLocationTooltip(name: string) {
|
||||
return await this.getItemLocationEl(name).$('a').getAttribute('title');
|
||||
}
|
||||
|
||||
async getItemLocationTileAttr(name: string) {
|
||||
const location = this.getItemLocationEl(name).$('a');
|
||||
const condition = () => location.getAttribute('title').then(value => value && value.length > 0);
|
||||
|
||||
@@ -319,4 +315,8 @@ export class DataTable extends Component {
|
||||
async getLibraryRole(name: string) {
|
||||
return await this.getRowByName(name).element(by.css(DataTable.selectors.libraryRole)).getText();
|
||||
}
|
||||
|
||||
async isItemPresent(name: string) {
|
||||
return await this.getRowByName(name).isPresent();
|
||||
}
|
||||
}
|
||||
|
@@ -81,4 +81,47 @@ export class ConfirmDialog extends Component {
|
||||
const button = this.getButtonByName(name);
|
||||
return await button.isEnabled();
|
||||
}
|
||||
|
||||
|
||||
async isOkEnabled() {
|
||||
return await this.isButtonEnabled('OK');
|
||||
}
|
||||
|
||||
async isCancelEnabled() {
|
||||
return await this.isButtonEnabled('Cancel');
|
||||
}
|
||||
|
||||
async isKeepEnabled() {
|
||||
return await this.isButtonEnabled('Keep');
|
||||
}
|
||||
|
||||
async isDeleteEnabled() {
|
||||
return await this.isButtonEnabled('Delete');
|
||||
}
|
||||
|
||||
async isRemoveEnabled() {
|
||||
return await this.isButtonEnabled('Remove');
|
||||
}
|
||||
|
||||
|
||||
async clickOk() {
|
||||
return await this.clickButton('OK');
|
||||
}
|
||||
|
||||
async clickCancel() {
|
||||
return await this.clickButton('Cancel');
|
||||
}
|
||||
|
||||
async clickKeep() {
|
||||
return await this.clickButton('Keep');
|
||||
}
|
||||
|
||||
async clickDelete() {
|
||||
return await this.clickButton('Delete');
|
||||
}
|
||||
|
||||
async clickRemove() {
|
||||
return await this.clickButton('Remove');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -115,7 +115,7 @@ export class CopyMoveDialog extends Component {
|
||||
await this.waitForDropDownToClose();
|
||||
}
|
||||
|
||||
async chooseDestination(folderName: string) {
|
||||
async selectDestination(folderName: string) {
|
||||
const row = this.getRow(folderName);
|
||||
await Utils.waitUntilElementClickable(row);
|
||||
await row.click();
|
||||
|
@@ -72,11 +72,39 @@ export class CreateOrEditFolderDialog extends Component {
|
||||
return await this.validationMessage.isDisplayed();
|
||||
}
|
||||
|
||||
async isUpdateButtonEnabled() {
|
||||
return this.updateButton.isEnabled();
|
||||
}
|
||||
|
||||
async isCreateButtonEnabled() {
|
||||
return this.createButton.isEnabled();
|
||||
}
|
||||
|
||||
async isCancelButtonEnabled() {
|
||||
return this.cancelButton.isEnabled();
|
||||
}
|
||||
|
||||
async isNameDisplayed() {
|
||||
return await this.nameInput.isDisplayed();
|
||||
}
|
||||
|
||||
async isDescriptionDisplayed() {
|
||||
return await this.descriptionTextArea.isDisplayed();
|
||||
}
|
||||
|
||||
async getValidationMessage() {
|
||||
await this.isValidationMessageDisplayed();
|
||||
return await this.validationMessage.getText();
|
||||
}
|
||||
|
||||
async getName() {
|
||||
return await this.nameInput.getAttribute('value');
|
||||
}
|
||||
|
||||
async getDescription() {
|
||||
return await this.descriptionTextArea.getAttribute('value');
|
||||
}
|
||||
|
||||
async enterName(name: string) {
|
||||
await this.nameInput.clear();
|
||||
await Utils.typeInField(this.nameInput, name);
|
||||
@@ -104,4 +132,5 @@ export class CreateOrEditFolderDialog extends Component {
|
||||
async clickUpdate() {
|
||||
await this.updateButton.click();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -94,6 +94,10 @@ export class ShareDialog extends Component {
|
||||
return await this.url.getAttribute('readonly');
|
||||
}
|
||||
|
||||
async isCloseEnabled() {
|
||||
return await this.closeButton.isEnabled();
|
||||
}
|
||||
|
||||
async clickClose() {
|
||||
await this.closeButton.click();
|
||||
await this.waitForDialogToClose();
|
||||
|
@@ -54,5 +54,9 @@ export class Header extends Component {
|
||||
await this.moreActions.click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
}
|
||||
|
||||
async isSignOutDisplayed() {
|
||||
return await this.userInfo.menu.isMenuItemPresent('Sign out');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -72,6 +72,10 @@ export class LoginComponent extends Component {
|
||||
return this.submitButton.click();
|
||||
}
|
||||
|
||||
async clickPasswordVisibility() {
|
||||
return await this.passwordVisibility.click();
|
||||
}
|
||||
|
||||
async getPasswordVisibility() {
|
||||
const text = await this.passwordVisibility.getText();
|
||||
if (text.endsWith('visibility_off')) {
|
||||
@@ -84,7 +88,7 @@ export class LoginComponent extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async isPasswordShown() {
|
||||
async isPasswordDisplayed() {
|
||||
const type = await this.passwordInput.getAttribute('type');
|
||||
if (type === 'text') {
|
||||
return true;
|
||||
@@ -95,4 +99,21 @@ export class LoginComponent extends Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async isUsernameEnabled() {
|
||||
return await this.usernameInput.isEnabled();
|
||||
}
|
||||
|
||||
async isPasswordEnabled() {
|
||||
return await this.passwordInput.isEnabled();
|
||||
}
|
||||
|
||||
async isSubmitEnabled() {
|
||||
return await this.submitButton.isEnabled();
|
||||
}
|
||||
|
||||
async isPasswordHidden() {
|
||||
return !(await this.getPasswordVisibility());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -35,9 +35,7 @@ export class Menu extends Component {
|
||||
icon: '.mat-icon',
|
||||
uploadFiles: 'app-upload-files',
|
||||
|
||||
submenu: 'app-context-menu-item .mat-menu-item',
|
||||
|
||||
share: `[data-automation-id='share-action-button']`
|
||||
submenu: 'app-context-menu-item .mat-menu-item'
|
||||
};
|
||||
|
||||
items: ElementArrayFinder = this.component.all(by.css(Menu.selectors.item));
|
||||
@@ -45,8 +43,27 @@ export class Menu extends Component {
|
||||
uploadFiles: ElementFinder = browser.element(by.id(Menu.selectors.uploadFiles));
|
||||
submenus: ElementArrayFinder = browser.element.all(by.css(Menu.selectors.submenu));
|
||||
|
||||
shareAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.share, 'Share'));
|
||||
shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.share, 'Shared link settings'));
|
||||
shareAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Share'));
|
||||
shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Shared link settings'));
|
||||
viewAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View'));
|
||||
downloadAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Download'));
|
||||
editAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Edit'));
|
||||
copyAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Copy'));
|
||||
moveAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Move'));
|
||||
deleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Delete'));
|
||||
managePermissionsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permissions'));
|
||||
manageVersionsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Manage Versions'));
|
||||
favoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Favorite'));
|
||||
leaveAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Leave'));
|
||||
joinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Join'));
|
||||
cancelJoinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Cancel join'));
|
||||
permanentDeleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permanently delete'));
|
||||
restoreAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Restore'));
|
||||
viewDetailsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View details'));
|
||||
createFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create folder'));
|
||||
createLibraryAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Library'));
|
||||
uploadFileAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload file'));
|
||||
uploadFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload folder'));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Menu.selectors.root, ancestor);
|
||||
@@ -173,13 +190,134 @@ export class Menu extends Component {
|
||||
return this.uploadFiles;
|
||||
}
|
||||
|
||||
async clickShareAction() {
|
||||
|
||||
async clickShare() {
|
||||
const action = this.shareAction;
|
||||
await action.click();
|
||||
}
|
||||
|
||||
async clickShareEditAction() {
|
||||
async clickSharedLinkSettings() {
|
||||
const action = this.shareEditAction;
|
||||
await action.click();
|
||||
}
|
||||
|
||||
|
||||
async isViewPresent() {
|
||||
return await this.viewAction.isPresent();
|
||||
}
|
||||
|
||||
async isDownloadPresent() {
|
||||
return await this.downloadAction.isPresent();
|
||||
}
|
||||
|
||||
async isEditPresent() {
|
||||
return await this.editAction.isPresent();
|
||||
}
|
||||
|
||||
async isCopyPresent() {
|
||||
return await this.copyAction.isPresent();
|
||||
}
|
||||
|
||||
async isMovePresent() {
|
||||
return await this.moveAction.isPresent();
|
||||
}
|
||||
|
||||
async isDeletePresent() {
|
||||
return await this.deleteAction.isPresent();
|
||||
}
|
||||
|
||||
async isManagePermissionsPresent() {
|
||||
return await this.managePermissionsAction.isPresent();
|
||||
}
|
||||
|
||||
async isManageVersionsPresent() {
|
||||
return await this.manageVersionsAction.isPresent();
|
||||
}
|
||||
|
||||
async isFavoritePresent() {
|
||||
return await this.favoriteAction.isPresent();
|
||||
}
|
||||
|
||||
async isJoinLibraryPresent() {
|
||||
return await this.joinAction.isPresent();
|
||||
}
|
||||
|
||||
async isCancelJoinPresent() {
|
||||
return await this.cancelJoinAction.isPresent();
|
||||
}
|
||||
|
||||
async isLeaveLibraryPresent() {
|
||||
return await this.leaveAction.isPresent();
|
||||
}
|
||||
|
||||
async isPermanentDeletePresent() {
|
||||
return await this.permanentDeleteAction.isPresent();
|
||||
}
|
||||
|
||||
async isRestorePresent() {
|
||||
return await this.restoreAction.isPresent();
|
||||
}
|
||||
|
||||
async isSharePresent() {
|
||||
return await this.shareAction.isPresent();
|
||||
}
|
||||
|
||||
async isSharedLinkSettingsPresent() {
|
||||
return await this.shareEditAction.isPresent();
|
||||
}
|
||||
|
||||
async isViewDetailsPresent() {
|
||||
return await this.viewDetailsAction.isPresent();
|
||||
}
|
||||
|
||||
async isCreateFolderPresent() {
|
||||
return await this.createFolderAction.isPresent();
|
||||
}
|
||||
async isCreateFolderEnabled() {
|
||||
return await this.createFolderAction.isEnabled();
|
||||
}
|
||||
|
||||
async isCreateLibraryPresent() {
|
||||
return await this.createLibraryAction.isPresent();
|
||||
}
|
||||
async isCreateLibraryEnabled() {
|
||||
return await this.createLibraryAction.isEnabled();
|
||||
}
|
||||
|
||||
async isUploadFilePresent() {
|
||||
return await this.uploadFileAction.isPresent();
|
||||
}
|
||||
async isUploadFileEnabled() {
|
||||
return await this.uploadFileAction.isEnabled();
|
||||
}
|
||||
|
||||
async isUploadFolderPresent() {
|
||||
return await this.uploadFolderAction.isPresent();
|
||||
}
|
||||
async isUploadFolderEnabled() {
|
||||
return await this.uploadFolderAction.isEnabled();
|
||||
}
|
||||
|
||||
|
||||
|
||||
async clickCreateFolder() {
|
||||
const action = this.createFolderAction;
|
||||
await action.click();
|
||||
}
|
||||
|
||||
async clickCreateLibrary() {
|
||||
const action = this.createLibraryAction;
|
||||
await action.click();
|
||||
}
|
||||
|
||||
async clickUploadFile() {
|
||||
const action = this.uploadFileAction;
|
||||
await action.click();
|
||||
}
|
||||
|
||||
async clickUploadFolder() {
|
||||
const action = this.uploadFolderAction;
|
||||
await action.click();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -31,15 +31,35 @@ export class Toolbar extends Component {
|
||||
private static selectors = {
|
||||
root: '.adf-toolbar',
|
||||
button: 'button',
|
||||
|
||||
|
||||
share: `.mat-icon-button[title='Share']`,
|
||||
shareEdit: `.mat-icon-button[title='Shared link settings']`
|
||||
shareEdit: `.mat-icon-button[title='Shared link settings']`,
|
||||
view: `.mat-icon-button[title='View']`,
|
||||
download: `.mat-icon-button[title='Download']`,
|
||||
edit: `.mat-icon-button[title='Edit']`,
|
||||
viewDetails: `.mat-icon-button[title='View details']`,
|
||||
print: `.mat-icon-button[title='Print']`,
|
||||
fullScreen: `.mat-icon-button[title='Activate full-screen mode']`,
|
||||
joinLibrary: `.mat-icon-button[title='Join']`,
|
||||
leaveLibrary: `.mat-icon-button[title='Leave library']`,
|
||||
permanentlyDelete: `.mat-icon-button[title='Permanently delete']`,
|
||||
restore: `.mat-icon-button[title='Restore']`
|
||||
};
|
||||
|
||||
menu: Menu = new Menu();
|
||||
buttons: ElementArrayFinder = this.component.all(by.css(Toolbar.selectors.button));
|
||||
shareButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.share));
|
||||
shareEditButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.shareEdit));
|
||||
viewButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.view));
|
||||
downloadButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.download));
|
||||
editButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.edit));
|
||||
viewDetailsButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.viewDetails));
|
||||
printButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.print));
|
||||
fullScreenButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.fullScreen));
|
||||
joinButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.joinLibrary));
|
||||
leaveButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.leaveLibrary));
|
||||
permanentlyDeleteButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.permanentlyDelete));
|
||||
restoreButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.restore));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Toolbar.selectors.root, ancestor);
|
||||
@@ -87,21 +107,105 @@ export class Toolbar extends Component {
|
||||
await btn.click();
|
||||
}
|
||||
|
||||
async clickShareButton() {
|
||||
async clickShare() {
|
||||
const btn = this.shareButton;
|
||||
await btn.click();
|
||||
}
|
||||
|
||||
async isShareButtonPresent() {
|
||||
return await browser.isElementPresent(this.shareButton);
|
||||
}
|
||||
|
||||
async clickShareEditButton() {
|
||||
async clickSharedLinkSettings() {
|
||||
const btn = this.shareEditButton;
|
||||
await btn.click();
|
||||
}
|
||||
|
||||
async isShareEditButtonPresent() {
|
||||
async isSharedLinkSettingsPresent() {
|
||||
return await browser.isElementPresent(this.shareEditButton);
|
||||
}
|
||||
|
||||
async isSharePresent() {
|
||||
return await browser.isElementPresent(this.shareButton);
|
||||
}
|
||||
|
||||
async isViewPresent() {
|
||||
return await browser.isElementPresent(this.viewButton);
|
||||
}
|
||||
|
||||
async isDownloadPresent() {
|
||||
return await browser.isElementPresent(this.downloadButton);
|
||||
}
|
||||
|
||||
async isEditPresent() {
|
||||
return await browser.isElementPresent(this.editButton);
|
||||
}
|
||||
|
||||
async isViewDetailsPresent() {
|
||||
return await browser.isElementPresent(this.viewDetailsButton);
|
||||
}
|
||||
|
||||
async isPrintPresent() {
|
||||
return await browser.isElementPresent(this.printButton);
|
||||
}
|
||||
|
||||
async isFullScreenPresent() {
|
||||
return await browser.isElementPresent(this.fullScreenButton);
|
||||
}
|
||||
|
||||
|
||||
async clickEdit() {
|
||||
return await this.editButton.click();
|
||||
}
|
||||
|
||||
async clickViewDetails() {
|
||||
return await this.viewDetailsButton.click();
|
||||
}
|
||||
|
||||
async clickDownload() {
|
||||
return await this.downloadButton.click();
|
||||
}
|
||||
|
||||
async clickJoin() {
|
||||
return await this.joinButton.click();
|
||||
}
|
||||
|
||||
async clickLeave() {
|
||||
return await this.leaveButton.click();
|
||||
}
|
||||
|
||||
async clickPermanentlyDelete() {
|
||||
return await this.permanentlyDeleteButton.click();
|
||||
}
|
||||
async clickRestore() {
|
||||
return await this.restoreButton.click();
|
||||
}
|
||||
|
||||
|
||||
async clickMoreActionsFavorite() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Favorite');
|
||||
}
|
||||
|
||||
async clickMoreActionsDelete() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Delete');
|
||||
}
|
||||
|
||||
async clickMoreActionsManageVersions() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Manage Versions');
|
||||
}
|
||||
|
||||
async clickMoreActionsMove() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Move');
|
||||
}
|
||||
|
||||
async clickMoreActionsCopy() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Copy');
|
||||
}
|
||||
|
||||
|
||||
async clickFullScreen() {
|
||||
return await this.fullScreenButton.click();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user