mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
[Chore] Dashboard: Tests for dashboard's add content buttons and menu (#66233)
* add tests for empty dashboard page * add tests for AddPanelButton * export default components * test +Add menu in dashboard page * use userEvent instead of firing an event on the DOM itself * fix test to match new analytic events
This commit is contained in:
@@ -10,7 +10,7 @@ export const smokeTestScenario = {
|
||||
scenario: () => {
|
||||
// wait for time to be set to account for any layout shift
|
||||
e2e().contains('2020-01-01 00:00:00 to 2020-01-01 06:00:00').should('be.visible');
|
||||
e2e.components.PageToolbar.itemButton('Add panel button').click();
|
||||
e2e.components.PageToolbar.itemButton('Add button').click();
|
||||
e2e.components.PageToolbar.itemButton('Add new visualization menu item').click();
|
||||
|
||||
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
||||
|
||||
@@ -12,12 +12,12 @@ e2e.scenario({
|
||||
|
||||
// TODO: Try and use e2e.flows.addPanel() instead of block below
|
||||
try {
|
||||
e2e.components.PageToolbar.itemButton('Add panel button').should('be.visible');
|
||||
e2e.components.PageToolbar.itemButton('Add panel button').click();
|
||||
e2e.components.PageToolbar.itemButton('Add button').should('be.visible');
|
||||
e2e.components.PageToolbar.itemButton('Add button').click();
|
||||
} catch (e) {
|
||||
// Depending on the screen size, the "Add panel" button might be hidden
|
||||
e2e.components.PageToolbar.item('Show more items').click();
|
||||
e2e.components.PageToolbar.item('Add panel button').last().click();
|
||||
e2e.components.PageToolbar.item('Add button').last().click();
|
||||
}
|
||||
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').should('be.visible');
|
||||
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').click();
|
||||
|
||||
Reference in New Issue
Block a user