mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BrowseDashboards: Add (skipped) basic e2e tests to prepare for GA (#75917)
Add e2e tests for new Browse Dashboards UI
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
6
e2e/utils/flows/confirmModal.ts
Normal file
6
e2e/utils/flows/confirmModal.ts
Normal file
@@ -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();
|
||||
}
|
||||
@@ -15,6 +15,7 @@ export * from './setTimeRange';
|
||||
export * from './importDashboard';
|
||||
export * from './importDashboards';
|
||||
export * from './userPreferences';
|
||||
export * from './confirmModal';
|
||||
|
||||
export {
|
||||
VISUALIZATION_ALERT_LIST,
|
||||
|
||||
Reference in New Issue
Block a user