diff --git a/e2e/dashboards-suite/dashboard-browse.spec.ts b/e2e/dashboards-suite/dashboard-browse.spec.ts
index 5be77033f02..2bfc26b59fa 100644
--- a/e2e/dashboards-suite/dashboard-browse.spec.ts
+++ b/e2e/dashboards-suite/dashboard-browse.spec.ts
@@ -20,4 +20,48 @@ describe('Dashboard browse', () => {
e2e.components.Search.folderContent('General').should('be.visible');
e2e.components.Search.dashboardItem('E2E Test - Import Dashboard').should('be.visible');
});
+
+ it.skip('Manage Dashboards tests', () => {
+ e2e.flows.importDashboard(testDashboard, 1000, true);
+
+ e2e.pages.Dashboards.visit();
+
+ // Folders and dashboards should be visible
+ e2e.pages.BrowseDashboards.table.row('gdev dashboards').should('be.visible');
+ e2e.pages.BrowseDashboards.table.row('E2E Test - Import Dashboard').should('be.visible');
+
+ // gdev dashboards folder is collapsed - its content should not be visible
+ e2e.pages.BrowseDashboards.table.row('Alerting with TestData').should('not.exist');
+
+ // should click a folder and see it's children
+ e2e.pages.BrowseDashboards.table.row('gdev dashboards').find('[aria-label^="Expand folder"]').click();
+ e2e.pages.BrowseDashboards.table.row('Alerting with TestData').should('be.visible');
+
+ // Open the new folder drawer
+ cy.contains('button', 'New').click();
+ cy.contains('button', 'New folder').click();
+
+ // And create a new folder
+ e2e.pages.BrowseDashboards.NewFolderForm.nameInput().type('My new folder');
+ e2e.pages.BrowseDashboards.NewFolderForm.form().contains('button', 'Create').click();
+ e2e.components.Alert.alertV2('success').find('button[aria-label="Close alert"]').click();
+ cy.contains('h1', 'My new folder').should('be.visible');
+
+ // Delete the folder and expect to go back to the root
+ cy.contains('button', 'Folder actions').click();
+ cy.contains('button', 'Delete').click();
+ e2e.flows.confirmDelete();
+ cy.contains('h1', 'Dashboards').should('be.visible');
+
+ // Can collapse the gdev folder and delete the dashboard we imported
+ e2e.pages.BrowseDashboards.table.row('gdev dashboards').find('[aria-label^="Collapse folder"]').click();
+ e2e.pages.BrowseDashboards.table
+ .row('E2E Test - Import Dashboard')
+ .find('[type="checkbox"]')
+ .click({ force: true });
+
+ cy.contains('button', 'Delete').click();
+ e2e.flows.confirmDelete();
+ e2e.pages.BrowseDashboards.table.row('E2E Test - Import Dashboard').should('not.exist');
+ });
});
diff --git a/e2e/utils/flows/confirmModal.ts b/e2e/utils/flows/confirmModal.ts
new file mode 100644
index 00000000000..1f2c63f4577
--- /dev/null
+++ b/e2e/utils/flows/confirmModal.ts
@@ -0,0 +1,6 @@
+import { e2e } from '..';
+
+export function confirmDelete() {
+ cy.get(`input[placeholder='Type "Delete" to confirm']`).type('Delete');
+ e2e.pages.ConfirmModal.delete().click();
+}
diff --git a/e2e/utils/flows/index.ts b/e2e/utils/flows/index.ts
index e7fbfb3ce82..ae07146d13e 100644
--- a/e2e/utils/flows/index.ts
+++ b/e2e/utils/flows/index.ts
@@ -15,6 +15,7 @@ export * from './setTimeRange';
export * from './importDashboard';
export * from './importDashboards';
export * from './userPreferences';
+export * from './confirmModal';
export {
VISUALIZATION_ALERT_LIST,
diff --git a/packages/grafana-e2e-selectors/src/selectors/pages.ts b/packages/grafana-e2e-selectors/src/selectors/pages.ts
index fae9f32db26..80c5a8c289a 100644
--- a/packages/grafana-e2e-selectors/src/selectors/pages.ts
+++ b/packages/grafana-e2e-selectors/src/selectors/pages.ts
@@ -280,9 +280,14 @@ export const Pages = {
BrowseDashboards: {
table: {
body: 'data-testid browse-dashboards-table',
- row: (uid: string) => `data-testid ${uid} row`,
+ row: (name: string) => `data-testid browse dashboards row ${name}`,
checkbox: (uid: string) => `data-testid ${uid} checkbox`,
},
+ NewFolderForm: {
+ form: 'data-testid new folder form',
+ nameInput: 'data-testid new-folder-name-input',
+ createButton: 'data-testid new-folder-create-button',
+ },
},
Search: {
url: '/?search=openn',
diff --git a/public/app/features/browse-dashboards/components/BrowseView.test.tsx b/public/app/features/browse-dashboards/components/BrowseView.test.tsx
index 34271fdbc70..bdca23a807d 100644
--- a/public/app/features/browse-dashboards/components/BrowseView.test.tsx
+++ b/public/app/features/browse-dashboards/components/BrowseView.test.tsx
@@ -4,6 +4,7 @@ import React from 'react';
import { TestProvider } from 'test/helpers/TestProvider';
import { selectors } from '@grafana/e2e-selectors';
+import { DashboardViewItem } from 'app/features/search/types';
import { wellFormedTree } from '../fixtures/dashboardsTreeItem.fixture';
@@ -47,10 +48,10 @@ describe('browse-dashboards BrowseView', () => {
render(