Skip to content

Commit

Permalink
various bug fixes (#1010)
Browse files Browse the repository at this point in the history
* various bug fixes

* use 'remove favorite' label where appropriate

* fix toggle favorite component labels

* e2e type check and fixes

* favorite library label

* support toggle favorite component selectors

* update tests

* update e2e tests

* update e2e

* e2e update

* update e2e
  • Loading branch information
DenysVuika authored Mar 14, 2019
1 parent becd71a commit 07f45e0
Show file tree
Hide file tree
Showing 18 changed files with 218 additions and 171 deletions.
19 changes: 18 additions & 1 deletion e2e/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class Menu extends Component {
submenu: 'app-context-menu-item .mat-menu-item',

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']`
};
Expand All @@ -56,7 +58,10 @@ export class Menu extends Component {
downloadAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Download'));
editFolderAction: ElementFinder = this.component.element(by.css(Menu.selectors.editFolder));
editOfflineAction: ElementFinder = this.component.element(by.css(Menu.selectors.editOffline));
favoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Favorite'));
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'));
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'));
Expand Down Expand Up @@ -260,6 +265,18 @@ export class Menu extends Component {
return await this.favoriteAction.isPresent();
}

async isRemoveFavoritePresent() {
return await this.removeFavoriteAction.isPresent();
}

async isToggleFavoritePresent() {
return await this.toggleFavoriteAction.isPresent();
}

async isToggleRemoveFavoritePresent() {
return await this.toggleRemoveFavoriteAction.isPresent();
}

async isJoinLibraryPresent() {
return await this.joinAction.isPresent();
}
Expand Down
5 changes: 5 additions & 0 deletions e2e/components/toolbar/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ export class Toolbar extends Component {
return await this.menu.clickMenuItem('Favorite');
}

async clickMoreActionsRemoveFavorite() {
await this.openMoreMenu();
return await this.menu.clickMenuItem('Remove favorite');
}

async clickMoreActionsDelete() {
await this.openMoreMenu();
return await this.menu.clickMenuItem('Delete');
Expand Down
32 changes: 16 additions & 16 deletions e2e/suites/actions/context-menu-multiple-selection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -189,7 +189,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -206,7 +206,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -223,7 +223,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is not displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -354,7 +354,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is not displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand Down Expand Up @@ -385,7 +385,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -402,7 +402,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand Down Expand Up @@ -433,7 +433,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -450,7 +450,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -467,7 +467,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -484,7 +484,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`);
expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand Down Expand Up @@ -588,7 +588,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -608,7 +608,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -628,7 +628,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand All @@ -648,7 +648,7 @@ describe('Context menu actions - multiple selection : ', () => {
expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`);
expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`);
expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`);
expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`);
expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`);
expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`);
expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
});
Expand Down
Loading

0 comments on commit 07f45e0

Please sign in to comment.