Skip to content

Commit

Permalink
e2e: adds verify release (#24568)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugohaggmark committed May 12, 2020
1 parent bffa0fa commit 7d800e7
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Expand Up @@ -111,9 +111,9 @@ compilation-stats.json
/packages/grafana-e2e/cypress/videos
/packages/grafana-e2e/cypress/logs
/e2e/server.log
/e2e/suite1/screenshots
!/e2e/suite1/screenshots/expeced/*
/e2e/suite1/videos/*
/e2e/**/screenshots
!/e2e/**/screenshots/expeced/*
/e2e/**/videos/*

# report dumping the whole system env
/report.*.json
3 changes: 2 additions & 1 deletion e2e/run-suite
Expand Up @@ -8,6 +8,7 @@ CMD="start"
PARAMS=""
SLOWMO=0
URL=${BASE_URL:-"http://$DEFAULT_HOST:$DEFAULT_PORT"}
SUITE=${SUITE:-$DEFAULT_SUITE}

if [ "$1" == "debug" ]; then
echo -e "Debug mode"
Expand All @@ -23,5 +24,5 @@ fi
cd packages/grafana-e2e

yarn $CMD --env BASE_URL=$URL,CIRCLE_SHA1=$CIRCLE_SHA1,SLOWMO=$SLOWMO \
--config integrationFolder=../../e2e/suite1/specs,screenshotsFolder=../../e2e/suite1/screenshots,videosFolder=../../e2e/suite1/videos,fileServerFolder=./cypress,viewportWidth=1920,viewportHeight=1080,trashAssetsBeforeRuns=false \
--config integrationFolder=../../e2e/$SUITE/specs,screenshotsFolder=../../e2e/$SUITE/screenshots,videosFolder=../../e2e/$SUITE/videos,fileServerFolder=./cypress,viewportWidth=1920,viewportHeight=1080,trashAssetsBeforeRuns=false \
$PARAMS
29 changes: 29 additions & 0 deletions e2e/shared/smokeTestScenario.ts
@@ -0,0 +1,29 @@
import { e2e } from '@grafana/e2e';

export const smokeTestScenario = {
describeName: 'Smoke tests',
itName: 'Login scenario, create test data source, dashboard, panel, and export scenario',
addScenarioDataSource: true,
addScenarioDashBoard: true,
skipScenario: false,
scenario: () => {
e2e.getScenarioContext().then(({ lastAddedDashboardUid }: any) => {
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');
},
};
29 changes: 2 additions & 27 deletions e2e/suite1/specs/1-smoketests.spec.ts
@@ -1,29 +1,4 @@
import { e2e } from '@grafana/e2e';
import { smokeTestScenario } from '../../shared/smokeTestScenario';

e2e.scenario({
describeName: 'Smoke tests',
itName: 'Login scenario, create test data source, dashboard, panel, and export scenario',
addScenarioDataSource: true,
addScenarioDashBoard: true,
skipScenario: false,
scenario: () => {
e2e.getScenarioContext().then(({ lastAddedDashboardUid }: any) => {
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');
},
});
e2e.scenario(smokeTestScenario);
1 change: 1 addition & 0 deletions e2e/variables
Expand Up @@ -6,3 +6,4 @@ PACKAGE_FILE=dist/grafana-*linux-amd64.tar.gz
PROV_DIR=$RUNDIR/conf/provisioning
DEFAULT_HOST=localhost
DEFAULT_PORT=3001
DEFAULT_SUITE=suite1
5 changes: 5 additions & 0 deletions e2e/verify-release
@@ -0,0 +1,5 @@
#!/bin/bash

. e2e/variables

SUITE=verify ./e2e/run-suite
4 changes: 4 additions & 0 deletions e2e/verify/specs/smoketests.spec.ts
@@ -0,0 +1,4 @@
import { e2e } from '@grafana/e2e';
import { smokeTestScenario } from '../../shared/smokeTestScenario';

e2e.scenario(smokeTestScenario);
7 changes: 7 additions & 0 deletions e2e/verify/tsconfig.json
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": ["cypress"]
},
"extends": "../../tsconfig.json",
"include": ["**/*.ts", "../../packages/grafana-e2e/cypress/support/index.d.ts"]
}

0 comments on commit 7d800e7

Please sign in to comment.