Files
grafana/e2e/suite1/specs/1-smoketests.spec.ts
Hugo Häggmark e4d492fd35 e2e: adds inspect drawer tests (#23823)
* 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>
2020-04-24 08:48:04 +02:00

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');
},
});