mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Explore: Create basic E2E test * Feature: adds e2e tests for panel inspector * Refactor: adds ts-ignore because of type checking errors * Refactor: changes after PR comments and updates snapshot * Refactor: adds typings back for IScope * Refactor: changes after PR comments Co-authored-by: Andreas Opferkuch <andreas.opferkuch@gmail.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import { e2e } from '@grafana/e2e';
|
|
|
|
e2e.scenario({
|
|
describeName: 'Smoke tests',
|
|
itName: 'Login scenario, create test data source, dashboard, panel, and export scenario',
|
|
addScenarioDataSource: true,
|
|
addScenarioDashBoard: true,
|
|
skipScenario: false,
|
|
scenario: () => {
|
|
// @todo remove `@ts-ignore` when possible
|
|
// @ts-ignore
|
|
e2e.getScenarioContext().then(({ lastAddedDashboardUid }) => {
|
|
e2e.flows.openDashboard(lastAddedDashboardUid);
|
|
});
|
|
e2e.pages.Dashboard.Toolbar.toolbarItems('Add panel').click();
|
|
e2e.pages.AddDashboard.addNewPanel().click();
|
|
|
|
e2e.components.DataSource.TestData.QueryTab.scenarioSelect().select('CSV Metric Values');
|
|
|
|
// Make sure the graph renders via checking legend
|
|
e2e.components.Panels.Visualization.Graph.Legend.legendItemAlias('A-series').should('be.visible');
|
|
|
|
// Expand options section
|
|
e2e.components.Panels.Visualization.Graph.VisualizationTab.legendSection().click();
|
|
|
|
// Disable legend
|
|
e2e.components.Panels.Visualization.Graph.Legend.showLegendSwitch().click();
|
|
|
|
e2e.components.Panels.Visualization.Graph.Legend.legendItemAlias('A-series').should('not.exist');
|
|
},
|
|
});
|