mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@grafana/e2e: API improvements (#23079)
* Minor changes * Fixtures path is now relative to the project directory * URL support module now has individual exports * Scenario context timing issues resolved ... caused by being ran synchronously, instead of as part of Cypress' asynchronous queue. * Scenario context API now supports multiple keys per function call * addDataSource flow accepts a config argument … and optionally checks datasource health status * Added readProvisions command * Added addPanel flow
This commit is contained in:
@@ -190,13 +190,17 @@ const assertAdding3dependantQueryVariablesScenario = (queryVariables: QueryVaria
|
||||
for (let queryVariableIndex = 0; queryVariableIndex < queryVariables.length; queryVariableIndex++) {
|
||||
const { name, label, query, options, selectedOption } = queryVariables[queryVariableIndex];
|
||||
const asserts = queryVariables.slice(0, queryVariableIndex + 1);
|
||||
createQueryVariable({
|
||||
dataSourceName: e2e.context().get('lastAddedDataSource'),
|
||||
name,
|
||||
label,
|
||||
query,
|
||||
options,
|
||||
selectedOption,
|
||||
// @todo remove `@ts-ignore` when possible
|
||||
// @ts-ignore
|
||||
e2e.getScenarioContext().then(({ lastAddedDataSource }) => {
|
||||
createQueryVariable({
|
||||
dataSourceName: lastAddedDataSource,
|
||||
name,
|
||||
label,
|
||||
query,
|
||||
options,
|
||||
selectedOption,
|
||||
});
|
||||
});
|
||||
|
||||
assertVariableTable(asserts);
|
||||
@@ -565,7 +569,11 @@ e2e.scenario({
|
||||
addScenarioDashBoard: true,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
e2e.flows.openDashboard(e2e.context().get('lastAddedDashboardUid'));
|
||||
// @todo remove `@ts-ignore` when possible
|
||||
// @ts-ignore
|
||||
e2e.getScenarioContext().then(({ lastAddedDashboardUid }) => {
|
||||
e2e.flows.openDashboard(lastAddedDashboardUid);
|
||||
});
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Dashboard settings').click();
|
||||
e2e.pages.Dashboard.Settings.General.sectionItems('Variables').click();
|
||||
e2e.pages.Dashboard.Settings.Variables.List.addVariableCTA().click();
|
||||
|
||||
@@ -7,7 +7,11 @@ e2e.scenario({
|
||||
addScenarioDashBoard: true,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
e2e.flows.openDashboard(e2e.context().get('lastAddedDashboardUid'));
|
||||
// @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.ctaButtons('Add Query').click();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user