@grafana/e2e: improvements (#25708)

* Set time range when opening a dashboard

* Set UTC timezone when creating a dashboard

* Added flow for selecting options in custom select fields

* Fix flaky test
This commit is contained in:
Steven Vachon
2020-06-26 13:33:05 -04:00
committed by GitHub
parent 5d7cd2e9fc
commit fb3bec058a
17 changed files with 102 additions and 33 deletions

View File

@@ -8,7 +8,7 @@ e2e.scenario({
skipScenario: false,
scenario: () => {
// open Panel Tests - Bar Gauge
e2e.flows.openDashboard('O6f11TZWk');
e2e.flows.openDashboard({ uid: 'O6f11TZWk' });
e2e()
.get('#panel-6 .bar-gauge__value')

View File

@@ -7,7 +7,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard('5SdHCasdf');
e2e.flows.openDashboard({ uid: '5SdHCasdf' });
const fromTimeZone = 'Coordinated Universal Time';
const toTimeZone = 'America/Chicago';

View File

@@ -10,7 +10,7 @@ e2e.scenario({
skipScenario: false,
scenario: () => {
const viewPortWidth = e2e.config().viewportWidth;
e2e.flows.openDashboard('5SdHCadmz');
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
// testing opening inspect drawer directly by clicking on Inspect in header menu
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Inspect, PANEL_UNDER_TEST);

View File

@@ -9,7 +9,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard('5SdHCadmz');
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);

View File

@@ -10,7 +10,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard('5SdHCadmz');
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
@@ -96,6 +96,10 @@ e2e.scenario({
e2e().wait('@apiPostQuery');
// Avoid flaky tests
// Maybe the virtual dom performs optimzations such as node position swapping, meaning 1 becomes 0 and it gets that element before the change because and never finds title 'A'
e2e().wait(250);
// Check the order of the rows after change
e2e.components.QueryEditorRows.rows()
.eq(0)

View File

@@ -9,7 +9,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard('5SdHCadmz');
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);

View File

@@ -35,7 +35,7 @@ describe.skip('Variables', () => {
}
e2e.getScenarioContext().then(({ lastAddedDashboardUid, lastAddedDataSource }: any) => {
e2e.flows.openDashboard(lastAddedDashboardUid);
e2e.flows.openDashboard({ uid: lastAddedDashboardUid });
lastUid = lastAddedDashboardUid;
lastData = lastAddedDataSource;
});

View File

@@ -7,7 +7,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard('5SdHCadmz');
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
e2e.pages.Dashboard.Toolbar.toolbarItems('Dashboard settings').click();
e2e.components.FolderPicker.container()