Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACA-2177] Actions - rearrange actions order #922

Merged
merged 16 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions e2e/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Menu extends Component {

submenu: 'app-context-menu-item .mat-menu-item',

editFolder: `app.context.menu.editFolder`,
editFolder: `.mat-menu-item[id$='editFolder']`,
editOffline: `.mat-menu-item[title='Edit offline']`,
cancelEditing: `.mat-menu-item[title='Cancel editing']`
};
Expand All @@ -54,7 +54,7 @@ export class Menu extends Component {
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'));
editFolderAction: ElementFinder = this.component.element(by.id(Menu.selectors.editFolder));
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'));
joinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Join'));
Expand Down Expand Up @@ -196,6 +196,9 @@ export class Menu extends Component {
return this.uploadFiles;
}

async clickEditFolder() {
return await this.editFolderAction.click();
}

async clickShare() {
const action = this.shareAction;
Expand Down
36 changes: 24 additions & 12 deletions e2e/suites/actions/edit-folder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ describe('Edit folder', () => {
it('dialog UI defaults - [C216331]', async () => {
await dataTable.doubleClickOnRowByName(parent);
await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();

expect(await editDialog.getTitle()).toEqual('Edit folder');
expect(await editDialog.getName()).toBe(folderName);
Expand All @@ -130,7 +131,8 @@ describe('Edit folder', () => {

it('properties are modified when pressing OK - [C216335]', async (done) => {
await dataTable.selectItem(folderNameToEdit);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited);
Expand All @@ -146,7 +148,8 @@ describe('Edit folder', () => {

it('with empty folder name - [C216332]', async () => {
await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.deleteNameWithBackspace();

expect(await editDialog.isUpdateButtonEnabled()).toBe(false, 'upload button is not enabled');
Expand All @@ -157,7 +160,8 @@ describe('Edit folder', () => {
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];

await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();

for (const name of namesWithSpecialChars) {
await editDialog.enterName(name);
Expand All @@ -168,7 +172,8 @@ describe('Edit folder', () => {

it('with name ending with a dot - [C216334]', async () => {
await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.nameInput.sendKeys('.');

Expand All @@ -178,7 +183,8 @@ describe('Edit folder', () => {

it('Cancel button - [C216336]', async () => {
await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.clickCancel();

Expand All @@ -187,7 +193,8 @@ describe('Edit folder', () => {

it('with duplicate folder name - [C216337]', async () => {
await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.enterName(duplicateFolderName);
await editDialog.clickUpdate();
Expand All @@ -198,7 +205,8 @@ describe('Edit folder', () => {

it('trim ending spaces - [C216338]', async () => {
await dataTable.selectItem(folderName);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.nameInput.sendKeys(' ');
await editDialog.clickUpdate();
await editDialog.waitForDialogToClose();
Expand All @@ -216,7 +224,8 @@ describe('Edit folder', () => {

it('properties are modified when pressing OK - [C280384]', async (done) => {
await dataTable.selectItem(folderFavoriteToEdit);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited);
Expand All @@ -232,7 +241,8 @@ describe('Edit folder', () => {

it('with duplicate folder name - [C280386]', async () => {
await dataTable.selectItem(folderFavorite);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.enterName(folderFavoriteDuplicate);
await editDialog.clickUpdate();
Expand All @@ -251,7 +261,8 @@ describe('Edit folder', () => {

it('properties are modified when pressing OK - [C280509]', async (done) => {
await dataTable.selectItem(folderSiteToEdit);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited);
Expand All @@ -267,7 +278,8 @@ describe('Edit folder', () => {

it('with duplicate folder name - [C280511]', async () => {
await dataTable.selectItem(folderSite);
await toolbar.clickEditFolder();
await toolbar.openMoreMenu();
await toolbar.menu.clickEditFolder();
await editDialog.waitForDialogToOpen();
await editDialog.enterName(duplicateFolderSite);
await editDialog.clickUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ describe('Granular permissions available actions : ', () => {
expect(await toolbar.isViewPresent()).toBe(false, `View is not displayed for ${folder1}`);
expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`);
expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${folder1}`);
// TODO: change expect to false when ACA-1737 is done
expect(await toolbar.isEditFolderPresent()).toBe(true, `Edit folder is displayed for ${folder1}`);
expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`);

await toolbar.openMoreMenu();

// TODO: change expect to false when ACA-1737 is done
expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is displayed for ${folder1}`);
expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`);
expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`);
expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`);
Expand Down
8 changes: 4 additions & 4 deletions e2e/suites/actions/toolbar-single-selection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ describe('Toolbar actions - single selection : ', () => {
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`);
expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderUser}`);
expect(await toolbar.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`);

await toolbar.openMoreMenu();

expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`);
expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`);
expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`);
expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`);
Expand Down Expand Up @@ -264,10 +264,10 @@ describe('Toolbar actions - single selection : ', () => {
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderInSite}`);
expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderInSite}`);
expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderInSite}`);
expect(await toolbar.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderInSite}`);

await toolbar.openMoreMenu();

expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderInSite}`);
expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderInSite}`);
expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderInSite}`);
expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderInSite}`);
Expand Down Expand Up @@ -599,10 +599,10 @@ describe('Toolbar actions - single selection : ', () => {
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`);
expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderUser}`);
expect(await toolbar.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`);

await toolbar.openMoreMenu();

expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`);
expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`);
expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`);
expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`);
Expand Down Expand Up @@ -725,10 +725,10 @@ describe('Toolbar actions - single selection : ', () => {
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`);
expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderUser}`);
expect(await toolbar.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`);

await toolbar.openMoreMenu();

expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`);
expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`);
expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`);
expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`);
Expand Down
4 changes: 4 additions & 0 deletions src/app/ui/overrides/adf-toolbar.theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@mixin adf-toolbar-theme($theme) {
$foreground: map-get($theme, foreground);

.app-toolbar-menu-item:last-child > .mat-divider-horizontal {
display: none;
}

.adf-viewer {
.adf-toolbar {
.mat-toolbar {
Expand Down
Loading