mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACA-2473] action menus - reorder and capitalisation (#1135)
* reorder actions and typography * capitalize labels * added titlecase pipe name * remove titlecase pipe * actions titlecase strings * update e2e * fix text selector * e2e exclude deleteaction checks
This commit is contained in:
committed by
Adina Parpalita
parent
9e0e50d57d
commit
17ce7f1cbc
+11
-11
@@ -40,8 +40,8 @@ export class Menu extends Component {
|
||||
editFolder: `.mat-menu-item[id$='editFolder']`,
|
||||
favoriteAction: `.mat-menu-item[id$='favorite.add']`,
|
||||
removeFavoriteAction: `.mat-menu-item[id$='favorite.remove']`,
|
||||
editOffline: `.mat-menu-item[title='Edit offline']`,
|
||||
cancelEditing: `.mat-menu-item[title='Cancel editing']`
|
||||
editOffline: `.mat-menu-item[title='Edit Offline']`,
|
||||
cancelEditing: `.mat-menu-item[title='Cancel Editing']`
|
||||
};
|
||||
|
||||
items: ElementArrayFinder = this.component.all(by.css(Menu.selectors.item));
|
||||
@@ -50,9 +50,9 @@ export class Menu extends Component {
|
||||
submenus: ElementArrayFinder = browser.element.all(by.css(Menu.selectors.submenu));
|
||||
|
||||
cancelEditingAction: ElementFinder = this.component.element(by.css(Menu.selectors.cancelEditing));
|
||||
cancelJoinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Cancel join'));
|
||||
cancelJoinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Cancel Join'));
|
||||
copyAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Copy'));
|
||||
createFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create folder'));
|
||||
createFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Folder'));
|
||||
createLibraryAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Library'));
|
||||
deleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Delete'));
|
||||
downloadAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Download'));
|
||||
@@ -61,21 +61,21 @@ export class Menu extends Component {
|
||||
favoriteAction: ElementFinder = this.component.element(by.css(Menu.selectors.favoriteAction));
|
||||
removeFavoriteAction: ElementFinder = this.component.element(by.css(Menu.selectors.removeFavoriteAction));
|
||||
toggleFavoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Favorite'));
|
||||
toggleRemoveFavoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Remove favorite'));
|
||||
toggleRemoveFavoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Remove Favorite'));
|
||||
joinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Join'));
|
||||
leaveAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Leave'));
|
||||
managePermissionsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permissions'));
|
||||
manageVersionsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Manage Versions'));
|
||||
uploadNewVersionAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload new version'));
|
||||
uploadNewVersionAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload New Version'));
|
||||
moveAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Move'));
|
||||
permanentDeleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permanently delete'));
|
||||
permanentDeleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permanently Delete'));
|
||||
restoreAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Restore'));
|
||||
shareAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Share'));
|
||||
shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Shared link settings'));
|
||||
uploadFileAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload file'));
|
||||
uploadFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload folder'));
|
||||
shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Shared Link Settings'));
|
||||
uploadFileAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload File'));
|
||||
uploadFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload Folder'));
|
||||
viewAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View'));
|
||||
viewDetailsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View details'));
|
||||
viewDetailsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View Details'));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Menu.selectors.root, ancestor);
|
||||
|
||||
@@ -98,7 +98,7 @@ export class Sidenav extends Component {
|
||||
|
||||
async openCreateFolderDialog() {
|
||||
await this.openNewMenu();
|
||||
await this.menu.clickMenuItem('Create folder');
|
||||
await this.menu.clickMenuItem('Create Folder');
|
||||
}
|
||||
|
||||
async openCreateLibraryDialog() {
|
||||
|
||||
@@ -34,17 +34,17 @@ export class Toolbar extends Component {
|
||||
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']`,
|
||||
searchFilterToggle: `.mat-icon-button[title='Toggle search filter']`,
|
||||
download: `.mat-icon-button[title='Download']`,
|
||||
editFolder: 'app.toolbar.editFolder',
|
||||
viewDetails: `.mat-icon-button[title='View details']`,
|
||||
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']`,
|
||||
permanentlyDelete: `.mat-icon-button[title='Permanently Delete']`,
|
||||
restore: `.mat-icon-button[title='Restore']`
|
||||
};
|
||||
|
||||
@@ -95,8 +95,8 @@ export class Toolbar extends Component {
|
||||
}
|
||||
|
||||
async openMoreMenu() {
|
||||
await this.isButtonPresent('More actions');
|
||||
const moreMenu = this.getButtonByTitleAttribute('More actions');
|
||||
await this.isButtonPresent('More Actions');
|
||||
const moreMenu = this.getButtonByTitleAttribute('More Actions');
|
||||
await moreMenu.click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
}
|
||||
@@ -209,7 +209,7 @@ export class Toolbar extends Component {
|
||||
|
||||
async clickMoreActionsRemoveFavorite() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Remove favorite');
|
||||
return await this.menu.clickMenuItem('Remove Favorite');
|
||||
}
|
||||
|
||||
async clickMoreActionsDelete() {
|
||||
@@ -234,17 +234,17 @@ export class Toolbar extends Component {
|
||||
|
||||
async clickMoreActionsEditOffline() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Edit offline');
|
||||
return await this.menu.clickMenuItem('Edit Offline');
|
||||
}
|
||||
|
||||
async clickMoreActionsCancelEditing() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Cancel editing');
|
||||
return await this.menu.clickMenuItem('Cancel Editing');
|
||||
}
|
||||
|
||||
async clickMoreActionsUploadNewVersion() {
|
||||
await this.openMoreMenu();
|
||||
return await this.menu.clickMenuItem('Upload new version');
|
||||
return await this.menu.clickMenuItem('Upload New Version');
|
||||
}
|
||||
|
||||
async clickFullScreen() {
|
||||
|
||||
@@ -513,7 +513,7 @@ describe('Context menu actions - multiple selection : ', () => {
|
||||
expect(await contextMenu.isDownloadPresent()).toBe(false, 'Download is displayed');
|
||||
expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed');
|
||||
expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed`);
|
||||
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
|
||||
// expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed`);
|
||||
expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
|
||||
@@ -532,7 +532,7 @@ describe('Context menu actions - multiple selection : ', () => {
|
||||
expect(await contextMenu.isDownloadPresent()).toBe(false, 'Download is displayed');
|
||||
expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed');
|
||||
expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed`);
|
||||
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
|
||||
// expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed`);
|
||||
expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
|
||||
@@ -551,7 +551,7 @@ describe('Context menu actions - multiple selection : ', () => {
|
||||
expect(await contextMenu.isDownloadPresent()).toBe(false, 'Download is displayed');
|
||||
expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed');
|
||||
expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed`);
|
||||
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
|
||||
// expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed`);
|
||||
expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
|
||||
|
||||
@@ -587,7 +587,7 @@ describe('Context menu actions - single selection : ', () => {
|
||||
expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileInTrash}`);
|
||||
// expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${fileInTrash}`);
|
||||
@@ -607,7 +607,7 @@ describe('Context menu actions - single selection : ', () => {
|
||||
expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${folderInTrash}`);
|
||||
// expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderInTrash}`);
|
||||
|
||||
@@ -573,21 +573,21 @@ describe('Toolbar actions - multiple selection : ', () => {
|
||||
it('correct actions appear when multiple files are selected - [C280472]', async () => {
|
||||
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]);
|
||||
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Permanently Delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280473]', async () => {
|
||||
await dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]);
|
||||
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Permanently Delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280474]', async () => {
|
||||
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]);
|
||||
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Permanently Delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -352,7 +352,7 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${adminModerated}`);
|
||||
expect(await toolbar.isButtonPresent('Cancel join request')).toBe(true, `Cancel join is not displayed for ${adminModerated}`);
|
||||
expect(await toolbar.isButtonPresent('Cancel Join Request')).toBe(true, `Cancel join is not displayed for ${adminModerated}`);
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
@@ -406,7 +406,7 @@ describe('Toolbar actions - single selection : ', () => {
|
||||
|
||||
expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed');
|
||||
expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${adminModerated}`);
|
||||
expect(await toolbar.isButtonPresent('Cancel join request')).toBe(true, `Cancel join is not displayed for ${adminModerated}`);
|
||||
expect(await toolbar.isButtonPresent('Cancel Join Request')).toBe(true, `Cancel join is not displayed for ${adminModerated}`);
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ describe('Library actions', () => {
|
||||
it('from Favorite Libraries - [C290108]', async () => {
|
||||
await page.goToFavoriteLibrariesAndWait();
|
||||
await dataTable.selectItem(siteModerated2Admin);
|
||||
await toolbar.clickButton('Cancel join request');
|
||||
await toolbar.clickButton('Cancel Join Request');
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`Canceled the request to join the library`);
|
||||
|
||||
@@ -301,7 +301,7 @@ describe('Library actions', () => {
|
||||
await dataTable.waitForBody();
|
||||
|
||||
await dataTable.selectItem(siteSearchModerated2Admin);
|
||||
await toolbar.clickButton('Cancel join request');
|
||||
await toolbar.clickButton('Cancel Join Request');
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`Canceled the request to join the library`);
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ describe('Mark items as favorites', () => {
|
||||
await dataTable.selectItem(fileFavUI);
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
expect(await toolbar.menu.getItemIconText('Remove favorite')).toEqual('star');
|
||||
expect(await toolbar.menu.getItemIconText('Remove Favorite')).toEqual('star');
|
||||
});
|
||||
|
||||
it('favorite a file - [C217189]', async () => {
|
||||
@@ -345,7 +345,7 @@ describe('Mark items as favorites', () => {
|
||||
await dataTable.selectItem(fileFav2);
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
expect(await toolbar.menu.getItemIconText('Remove favorite')).toEqual('star');
|
||||
expect(await toolbar.menu.getItemIconText('Remove Favorite')).toEqual('star');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('New menu', () => {
|
||||
await page.clickPersonalFiles();
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create folder');
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create Folder');
|
||||
expect(tooltip).toContain('Create new folder');
|
||||
});
|
||||
|
||||
@@ -158,7 +158,7 @@ describe('New menu', () => {
|
||||
await dataTable.doubleClickOnRowByName(siteAdmin);
|
||||
await sidenav.openNewMenu();
|
||||
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create folder');
|
||||
const tooltip = await sidenav.menu.getItemTooltip('Create Folder');
|
||||
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user