mirror of https://github.com/grafana/grafana
Dashboards/E2E: Add e2e test for adding and configuring a new panel (#104857)
parent
6727f797f5
commit
4812cdf1a7
@ -0,0 +1,28 @@ |
||||
import { e2e } from '../utils'; |
||||
|
||||
const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output'; |
||||
const DASHBOARD_NAME = 'Test variable output'; |
||||
|
||||
describe('Dashboard panels', () => { |
||||
beforeEach(() => { |
||||
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD')); |
||||
}); |
||||
|
||||
it('can add a new panel', () => { |
||||
e2e.pages.Dashboards.visit(); |
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1` }); |
||||
cy.contains(DASHBOARD_NAME).should('be.visible'); |
||||
|
||||
// Toggle edit mode
|
||||
e2e.components.NavToolbar.editDashboard.editButton().should('be.visible').click(); |
||||
|
||||
e2e.flows.scenes.addPanel(); |
||||
|
||||
// Check that new panel has been added
|
||||
e2e.components.Panels.Panel.title('New panel').should('be.visible'); |
||||
|
||||
// Check that pressing the configure button shows the panel editor
|
||||
e2e.flows.scenes.configurePanel(); |
||||
e2e.components.PanelEditor.General.content().should('be.visible'); |
||||
}); |
||||
}); |
@ -0,0 +1,6 @@ |
||||
import { e2e } from '../..'; |
||||
|
||||
export const addPanel = () => { |
||||
e2e.components.DashboardEditPaneSplitter.primaryBody().scrollTo('bottom'); |
||||
e2e.components.CanvasGridAddActions.addPanel().should('be.visible').click(); |
||||
}; |
@ -0,0 +1,5 @@ |
||||
import { e2e } from '../..'; |
||||
|
||||
export const configurePanel = () => { |
||||
e2e.components.Panels.Panel.content().contains('Configure').should('be.visible').click(); |
||||
}; |
@ -0,0 +1,2 @@ |
||||
export * from './addPanel'; |
||||
export * from './configurePanel'; |
Loading…
Reference in new issue