mirror of
https://github.com/grafana/grafana.git
synced 2024-11-21 08:34:25 -06:00
Chore: remove scenario wrapping in cypress tests (#74674)
* remove scenario wrapping in cypress tests * remove more hardcoded logins * don't forget the various suite! * make sure we log in for every test * fix afterAll revert * stability
This commit is contained in:
parent
f3b6d01306
commit
ba7f77f25d
@ -155,10 +155,11 @@ const storageAcctName = 'azmonteststorage';
|
||||
const logAnalyticsName = 'az-mon-test-logs';
|
||||
const applicationInsightsName = 'az-mon-test-ai-a';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Add Azure Monitor datasource',
|
||||
itName: 'fills out datasource connection configuration',
|
||||
scenario: () => {
|
||||
describe('Azure monitor datasource', () => {
|
||||
before(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
|
||||
// Add datasource
|
||||
// This variable will be set in CI
|
||||
const CI = e2e.env('CI');
|
||||
if (CI) {
|
||||
@ -186,13 +187,18 @@ e2e.scenario({
|
||||
});
|
||||
}
|
||||
e2e.setScenarioContext({ addedDataSources: [] });
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Create dashboard and add a panel for each query type',
|
||||
itName: 'create dashboard, add panel for metrics, log analytics, ARG, and traces queries',
|
||||
scenario: () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
after(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
e2e.flows.revertAllChanges();
|
||||
});
|
||||
|
||||
it('create dashboard, add panel for metrics, log analytics, ARG, and traces queries', () => {
|
||||
e2e.flows.addDashboard({
|
||||
timeRange: {
|
||||
from: 'now-6h',
|
||||
@ -277,13 +283,9 @@ e2e.scenario({
|
||||
},
|
||||
timeout: 10000,
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Create dashboard with template variables',
|
||||
itName: 'creates a dashboard that includes a template variable',
|
||||
scenario: () => {
|
||||
it('creates a dashboard that includes a template variable', () => {
|
||||
e2e.flows.addDashboard({
|
||||
timeRange: {
|
||||
from: 'now-6h',
|
||||
@ -343,13 +345,9 @@ e2e.scenario({
|
||||
},
|
||||
timeout: 10000,
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Create dashboard with annotation',
|
||||
itName: 'creates a dashboard that includes an annotation',
|
||||
scenario: () => {
|
||||
it.skip('creates a dashboard that includes an annotation', () => {
|
||||
e2e.flows.addDashboard({
|
||||
timeRange: {
|
||||
from: '2022-10-03 00:00:00',
|
||||
@ -382,14 +380,5 @@ e2e.scenario({
|
||||
e2eSelectors.queryEditor.metricsQueryEditor.metricName.input().find('input').type('Used capacity{enter}');
|
||||
},
|
||||
});
|
||||
},
|
||||
skipScenario: true,
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Remove datasource',
|
||||
itName: 'remove azure monitor datasource',
|
||||
scenario: () => {
|
||||
e2e.flows.deleteDataSource({ name: dataSourceName, id: '', quick: true });
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -3,7 +3,7 @@ const PAGE_UNDER_TEST = 'WVpf2jp7z/repeating-a-panel-horizontally';
|
||||
|
||||
describe('Repeating a panel horizontally', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('should be able to repeat a panel horizontally', () => {
|
||||
|
@ -3,7 +3,7 @@ const PAGE_UNDER_TEST = 'OY8Ghjt7k/repeating-a-panel-vertically';
|
||||
|
||||
describe('Repeating a panel vertically', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('should be able to repeat a panel vertically', () => {
|
||||
|
@ -3,7 +3,7 @@ const PAGE_UNDER_TEST = 'dtpl2Ctnk/repeating-an-empty-row';
|
||||
|
||||
describe('Repeating empty rows', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('should be able to repeat empty rows vertically', () => {
|
||||
|
@ -14,7 +14,7 @@ describe.skip('Dashboard browse (nested)', () => {
|
||||
|
||||
// Add nested folder structure
|
||||
before(() => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'), false);
|
||||
|
||||
// Add root folders
|
||||
for (let i = 0; i < NUM_ROOT_FOLDERS; i++) {
|
||||
|
@ -1,13 +1,12 @@
|
||||
import testDashboard from '../dashboards/TestDashboard.json';
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Dashboard browse',
|
||||
itName: 'Basic folder view test',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Dashboard browse', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Basic folder view test', () => {
|
||||
e2e.flows.importDashboard(testDashboard, 1000, true);
|
||||
|
||||
e2e.pages.Dashboards.visit();
|
||||
@ -20,5 +19,5 @@ e2e.scenario({
|
||||
|
||||
e2e.components.Search.folderContent('General').should('be.visible');
|
||||
e2e.components.Search.dashboardItem('E2E Test - Import Dashboard').should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Create a public dashboard',
|
||||
itName: 'Create a public dashboard',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Public dashboards', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Create a public dashboard', () => {
|
||||
// Opening a dashboard without template variables
|
||||
cy.intercept({
|
||||
pathname: '/api/ds/query',
|
||||
@ -60,16 +59,9 @@ e2e.scenario({
|
||||
// There elements should be rendered once the Settings dropdown is opened
|
||||
e2e.pages.ShareDashboardModal.PublicDashboard.EnableAnnotationsSwitch().should('exist');
|
||||
e2e.pages.ShareDashboardModal.PublicDashboard.EnableTimeRangeSwitch().should('exist');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Open a public dashboard',
|
||||
itName: 'Open a public dashboard',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Open a public dashboard', () => {
|
||||
// Opening a dashboard without template variables
|
||||
cy.intercept({
|
||||
method: 'POST',
|
||||
@ -110,16 +102,9 @@ e2e.scenario({
|
||||
expect(resp.status).to.eq(200);
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Disable a public dashboard',
|
||||
itName: 'Disable a public dashboard',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Disable a public dashboard', () => {
|
||||
// Opening a dashboard without template variables
|
||||
cy.intercept({
|
||||
method: 'POST',
|
||||
@ -159,7 +144,7 @@ e2e.scenario({
|
||||
expect(resp.status).to.eq(403);
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const getPublicDashboardAPIUrl = (url: string): string => {
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Create a public dashboard with template variables shows a template variable warning',
|
||||
itName: 'Create a public dashboard with template variables shows a template variable warning',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Create a public dashboard with template variables shows a template variable warning', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Create a public dashboard with template variables shows a template variable warning', () => {
|
||||
// Opening a dashboard with template variables
|
||||
e2e.flows.openDashboard({ uid: 'HYaGDGIMk' });
|
||||
|
||||
@ -26,5 +25,5 @@ e2e.scenario({
|
||||
e2e.pages.ShareDashboardModal.PublicDashboard.CreateButton().should('exist');
|
||||
|
||||
e2e.pages.ShareDashboardModal.PublicDashboard.PauseSwitch().should('not.exist');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Dashboard templating',
|
||||
itName: 'Verify variable interpolation works',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Dashboard templating', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Verify variable interpolation works', () => {
|
||||
// Open dashboard global variables and interpolation
|
||||
e2e.flows.openDashboard({ uid: 'HYaGDGIMk' });
|
||||
|
||||
@ -57,5 +56,5 @@ e2e.scenario({
|
||||
'href',
|
||||
'https://example.com/?from=now-6h&to=now'
|
||||
);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -11,13 +11,12 @@ import {
|
||||
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Dashboard time zone support',
|
||||
itName: 'Tests dashboard time zone scenarios',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: true,
|
||||
scenario: () => {
|
||||
describe('Dashboard time zone support', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests dashboard time zone scenarios', () => {
|
||||
e2e.flows.openDashboard({ uid: '5SdHCasdf' });
|
||||
|
||||
const fromTimeZone = 'UTC';
|
||||
@ -38,15 +37,15 @@ e2e.scenario({
|
||||
for (const title of panelsToCheck) {
|
||||
e2e.components.Panels.Panel.title(title)
|
||||
.should('be.visible')
|
||||
.within(() =>
|
||||
.within(() => {
|
||||
e2e.components.Panels.Visualization.Graph.xAxis.labels().should('be.visible');
|
||||
e2e.components.Panels.Visualization.Graph.xAxis
|
||||
.labels()
|
||||
.should('be.visible')
|
||||
.last()
|
||||
.should((element) => {
|
||||
timesInUtc[title] = element.text();
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
e2e.components.PageToolbar.item('Dashboard settings').click();
|
||||
@ -80,16 +79,9 @@ e2e.scenario({
|
||||
})
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Dashboard time zone support',
|
||||
itName: 'Tests relative timezone support and overrides',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Tests relative timezone support and overrides', () => {
|
||||
// Open dashboard
|
||||
e2e.flows.openDashboard({
|
||||
uid: 'd41dbaa2-a39e-4536-ab2b-caca52f1a9c8',
|
||||
@ -201,7 +193,7 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
cy.contains('[role="row"]', '00:00:00').should('be.visible');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const isTimeCorrect = (inUtc: string, inTz: string, offset: number): boolean => {
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Dashboard timepicker',
|
||||
itName: 'Shows the correct calendar days with custom timezone set via preferences',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Dashboard timepicker', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Shows the correct calendar days with custom timezone set via preferences', () => {
|
||||
e2e.flows.setUserPreferences({
|
||||
timezone: 'Asia/Tokyo',
|
||||
});
|
||||
@ -26,16 +25,9 @@ e2e.scenario({
|
||||
e2e.components.TimePicker.openButton().click();
|
||||
e2e.components.TimePicker.calendar.openButton().first().click();
|
||||
cy.get('.react-calendar__tile--active, .react-calendar__tile--hasActive').should('have.length', 3);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Dashboard timepicker',
|
||||
itName: 'Shows the correct calendar days with custom timezone set via time picker',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Shows the correct calendar days with custom timezone set via time picker', () => {
|
||||
// Open dashboard with time range from 2022-06-08 00:00:00 to 2022-06-10 23:59:59 in Tokyo time
|
||||
e2e.flows.openDashboard({
|
||||
uid: '5SdHCasdf',
|
||||
@ -50,5 +42,5 @@ e2e.scenario({
|
||||
e2e.components.TimePicker.openButton().click();
|
||||
e2e.components.TimePicker.calendar.openButton().first().click();
|
||||
cy.get('.react-calendar__tile--active, .react-calendar__tile--hasActive').should('have.length', 3);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,12 @@
|
||||
import testDashboard from '../dashboards/TestDashboard.json';
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Import Dashboards Test',
|
||||
itName: 'Ensure you can import a number of json test dashboards from a specific test directory',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Import Dashboards Test', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Ensure you can import a number of json test dashboards from a specific test directory', () => {
|
||||
e2e.flows.importDashboard(testDashboard, 1000);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -3,8 +3,11 @@ import { e2e } from '../utils';
|
||||
const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
|
||||
|
||||
describe('Variables - Load options from Url', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('default options should be correct', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: PAGE_UNDER_TEST });
|
||||
cy.intercept({
|
||||
method: 'POST',
|
||||
@ -54,7 +57,6 @@ describe('Variables - Load options from Url', () => {
|
||||
});
|
||||
|
||||
it('options set in url should load correct options', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=B&var-server=BB&var-pod=BBB` });
|
||||
cy.intercept({
|
||||
method: 'POST',
|
||||
@ -104,7 +106,6 @@ describe('Variables - Load options from Url', () => {
|
||||
});
|
||||
|
||||
it('options set in url that do not exist should load correct options', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
// @ts-ignore some typing issue
|
||||
cy.on('uncaught:exception', (err) => {
|
||||
if (err.stack?.indexOf("Couldn't find any field of type string in the results.") !== -1) {
|
||||
|
@ -4,8 +4,11 @@ const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
|
||||
const DASHBOARD_NAME = 'Test variable output';
|
||||
|
||||
describe('Variables - Constant', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('can add a new constant variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
|
@ -20,8 +20,11 @@ function assertPreviewValues(expectedValues: string[]) {
|
||||
}
|
||||
|
||||
describe('Variables - Custom', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('can add a custom template variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
@ -41,7 +44,6 @@ describe('Variables - Custom', () => {
|
||||
});
|
||||
|
||||
it('can add a custom template variable with labels', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
|
@ -4,8 +4,11 @@ const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
|
||||
const DASHBOARD_NAME = 'Test variable output';
|
||||
|
||||
describe('Variables - Datasource', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('can add a new datasource variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
|
@ -11,8 +11,11 @@ function assertPreviewValues(expectedValues: string[]) {
|
||||
}
|
||||
|
||||
describe('Variables - Interval', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('can add a new interval variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
|
@ -4,8 +4,11 @@ const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
|
||||
const DASHBOARD_NAME = 'Templating - Nested Template Variables';
|
||||
|
||||
describe('Variables - Query - Add variable', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('query variable should be default and default fields should be correct', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
@ -70,7 +73,6 @@ describe('Variables - Query - Add variable', () => {
|
||||
});
|
||||
|
||||
it('adding a single value query variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
@ -118,7 +120,6 @@ describe('Variables - Query - Add variable', () => {
|
||||
});
|
||||
|
||||
it('adding a multi value query variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
|
@ -4,8 +4,11 @@ const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
|
||||
const DASHBOARD_NAME = 'Test variable output';
|
||||
|
||||
describe('Variables - Text box', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('can add a new text box variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
|
||||
|
@ -3,8 +3,11 @@ import { e2e } from '../utils';
|
||||
const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
|
||||
|
||||
describe('Variables - Set options from ui', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('clicking a value that is not part of dependents options should change these to All', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-server=AA&var-pod=AAA` });
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
|
||||
@ -50,7 +53,6 @@ describe('Variables - Set options from ui', () => {
|
||||
});
|
||||
|
||||
it('adding a value that is not part of dependents options should add the new values dependant options', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-server=AA&var-pod=AAA` });
|
||||
cy.intercept({
|
||||
pathname: '/api/ds/query',
|
||||
@ -100,7 +102,6 @@ describe('Variables - Set options from ui', () => {
|
||||
});
|
||||
|
||||
it('removing a value that is part of dependents options should remove the new values dependant options', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({
|
||||
uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-datacenter=B&var-server=AA&var-server=BB&var-pod=AAA&var-pod=BBB`,
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Templating',
|
||||
itName: 'Tests dashboard links and variables in links',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Templating', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests dashboard links and variables in links', () => {
|
||||
cy.intercept({
|
||||
method: 'GET',
|
||||
url: '/api/search?tag=templating&limit=100',
|
||||
@ -51,5 +50,5 @@ e2e.scenario({
|
||||
|
||||
// verify all links, should have p2 value
|
||||
verifyLinks('p2');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -3,15 +3,17 @@ import { e2e } from '../utils';
|
||||
const PAGE_UNDER_TEST = 'AejrN1AMz';
|
||||
|
||||
describe('TextBox - load options scenarios', function () {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('default options should be correct', function () {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}/templating-textbox-e2e-scenarios?orgId=1` });
|
||||
|
||||
validateTextboxAndMarkup('default value');
|
||||
});
|
||||
|
||||
it('loading variable from url should be correct', function () {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({
|
||||
uid: `${PAGE_UNDER_TEST}/templating-textbox-e2e-scenarios?orgId=1&var-text=not default value`,
|
||||
});
|
||||
@ -21,6 +23,10 @@ describe('TextBox - load options scenarios', function () {
|
||||
});
|
||||
|
||||
describe.skip('TextBox - change query scenarios', function () {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('when changing the query value and not saving current as default should revert query value', function () {
|
||||
copyExistingDashboard();
|
||||
|
||||
@ -71,6 +77,10 @@ describe.skip('TextBox - change query scenarios', function () {
|
||||
});
|
||||
|
||||
describe.skip('TextBox - change picker value scenarios', function () {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('when changing the input value and not saving current as default should revert query value', function () {
|
||||
copyExistingDashboard();
|
||||
|
||||
@ -115,7 +125,6 @@ describe.skip('TextBox - change picker value scenarios', function () {
|
||||
});
|
||||
|
||||
function copyExistingDashboard() {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
cy.intercept({
|
||||
method: 'GET',
|
||||
url: '/api/search?query=&type=dash-folder&permission=Edit',
|
||||
|
@ -3,13 +3,12 @@ import { e2e } from '../utils';
|
||||
const DASHBOARD_ID = 'c01bf42b-b783-4447-a304-8554cee1843b';
|
||||
const DATAGRID_SELECT_SERIES = 'Datagrid Select series';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Datagrid data changes',
|
||||
itName: 'Tests changing data in the grid',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Datagrid data changes', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests changing data in the grid', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
|
||||
// Check that the data is series A
|
||||
@ -32,5 +31,5 @@ e2e.scenario({
|
||||
cy.get('[data-testid="data-testid Confirm Modal Danger Button"]').click();
|
||||
|
||||
cy.get('[data-testid="query-editor-row"]').contains('Snapshot');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -3,13 +3,12 @@ import { e2e } from '../utils';
|
||||
const DASHBOARD_ID = 'c01bf42b-b783-4447-a304-8554cee1843b';
|
||||
const DATAGRID_CANVAS = 'data-grid-canvas';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Datagrid data changes',
|
||||
itName: 'Tests changing data in the grid',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Datagrid data changes', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests changing data in the grid', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
|
||||
// Edit datagrid which triggers a snapshot query
|
||||
@ -155,5 +154,5 @@ e2e.scenario({
|
||||
cy.get('body').type('Val{enter}');
|
||||
cy.get(`[data-testid="${DATAGRID_CANVAS}"] tbody tr`).contains('Val');
|
||||
cy.get(`[data-testid="${DATAGRID_CANVAS}"] tbody tr`).should('have.length', 8);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,17 +1,16 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Panel menu ui extension flow',
|
||||
itName: 'Should be possible to click extension menu item',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Panel menu ui extension flow', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Should be possible to click extension menu item', () => {
|
||||
const panelTitle = 'Random walk series';
|
||||
const extensionTitle = 'Copy';
|
||||
|
||||
e2e.flows.openDashboard({ uid: '5SdHCasdf' });
|
||||
e2e.flows.openPanelMenuExtension(extensionTitle, panelTitle);
|
||||
e2e.flows.assertSuccessNotification();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -6,13 +6,12 @@ const MAP_LAYERS_TYPE = 'Map layers Layer type';
|
||||
const MAP_LAYERS_DATA = 'Map layers Data';
|
||||
const MAP_LAYERS_GEOJSON = 'Map layers GeoJSON URL';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap layer types',
|
||||
itName: 'Tests changing the layer type',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Geomap layer types', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests changing the layer type', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
cy.get('[data-testid="layer-drag-drop-list"]').should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).should('be.visible');
|
||||
@ -57,16 +56,9 @@ e2e.scenario({
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers URL template').should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Attribution').should('be.visible');
|
||||
e2e.components.PanelEditor.General.content().should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap layer types (alpha)',
|
||||
itName: 'Tests changing the layer type (alpha)',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: true,
|
||||
scenario: () => {
|
||||
it.skip('Tests changing the layer type (alpha)', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
cy.get('[data-testid="layer-drag-drop-list"]').should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).should('be.visible');
|
||||
@ -103,5 +95,5 @@ e2e.scenario({
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Style').should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Line width').should('be.visible');
|
||||
e2e.components.PanelEditor.General.content().should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { e2e } from '../utils';
|
||||
const DASHBOARD_ID = 'P2jR04WVk';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap map controls options',
|
||||
itName: 'Tests map controls options',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Geomap layer controls options', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests map controls options', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
|
||||
// Show zoom
|
||||
@ -31,5 +30,5 @@ e2e.scenario({
|
||||
// Show debug
|
||||
cy.get('input[id="controls.showDebug"]').check({ force: true });
|
||||
e2e.components.DebugOverlay.wrapper().should('exist');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -2,13 +2,12 @@ import { e2e } from '../utils';
|
||||
|
||||
const DASHBOARD_ID = 'P2jR04WVk';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap spatial operations - auto transforms',
|
||||
itName: 'Tests location auto option',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Geomap spatial operations', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests location auto option', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
|
||||
@ -25,16 +24,9 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
cy.contains('Point').should('be.visible');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap spatial operations - coords transforms ',
|
||||
itName: 'Tests location coords option',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Tests location coords option', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
|
||||
@ -56,16 +48,9 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
cy.contains('Point').should('be.visible');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap spatial operations - geohash transforms ',
|
||||
itName: 'Tests geoshash field column appears in table view',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Tests geoshash field column appears in table view', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
|
||||
@ -84,16 +69,9 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
cy.contains('State 1').should('be.visible');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Geomap spatial operations - lookup transforms ',
|
||||
itName: 'Tests location lookup option',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
it('Tests location lookup option', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
|
||||
@ -115,5 +93,5 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
cy.contains('Geometry').should('be.visible');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -2,13 +2,12 @@ import { e2e } from '../utils';
|
||||
|
||||
const PANEL_UNDER_TEST = 'Lines 500 data points';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Panel edit tests',
|
||||
itName: 'Tests various Panel edit scenarios',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Panel edit tests', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests various Panel edit scenarios', () => {
|
||||
cy.intercept({
|
||||
pathname: '/api/ds/query',
|
||||
}).as('query');
|
||||
@ -107,5 +106,5 @@ e2e.scenario({
|
||||
// Field & Overrides tabs (need to switch to React based vis, i.e. Table)
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel('Table Show table header').should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.fieldLabel('Table Column width').should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -2,13 +2,12 @@ import { e2e } from '../utils';
|
||||
|
||||
const flakyTimeout = 10000;
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Panel edit tests - queries',
|
||||
itName: 'Testes various Panel edit queries scenarios',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Panel edit tests - queries', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests various Panel edit queries scenarios', () => {
|
||||
e2e.flows.openDashboard({ uid: '5SdHCadmz', queryParams: { editPanel: 3 } });
|
||||
|
||||
// New panel editor opens when navigating from Panel menu
|
||||
@ -84,7 +83,7 @@ e2e.scenario({
|
||||
expect(resultIds.has('A:')).equals(true);
|
||||
expect(resultIds.has('B:')).equals(true);
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const expectInspectorResultAndClose = (expectCallBack: (keys: JQuery<HTMLElement>) => void) => {
|
||||
|
@ -1,16 +1,15 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Panel edit tests - transformations',
|
||||
itName: 'Tests transformations editor',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Panel edit tests - transformations', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests transformations editor', () => {
|
||||
e2e.flows.openDashboard({ uid: '5SdHCadmz', queryParams: { editPanel: 3 } });
|
||||
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
e2e.components.TransformTab.newTransform('Reduce').scrollIntoView().should('be.visible').click();
|
||||
e2e.components.Transforms.Reduce.calculationsLabel().should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,33 +1,38 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
export const smokeTestScenario = {
|
||||
describeName: 'Smoke tests',
|
||||
itName: 'Login scenario, create test data source, dashboard, panel, and export scenario',
|
||||
addScenarioDataSource: true,
|
||||
addScenarioDashBoard: true,
|
||||
skipScenario: false,
|
||||
loginViaApi: false,
|
||||
scenario: () => {
|
||||
// wait for time to be set to account for any layout shift
|
||||
cy.contains('2020-01-01 00:00:00 to 2020-01-01 06:00:00').should('be.visible');
|
||||
e2e.components.PageToolbar.itemButton('Add button').click();
|
||||
e2e.components.PageToolbar.itemButton('Add new visualization menu item').click();
|
||||
export const smokeTestScenario = () =>
|
||||
describe('Smoke tests', () => {
|
||||
before(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'), false);
|
||||
e2e.flows.addDataSource();
|
||||
e2e.flows.addDashboard();
|
||||
});
|
||||
|
||||
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
cy.get('input[id*="test-data-scenario-select-"]').should('be.visible').click();
|
||||
});
|
||||
after(() => {
|
||||
e2e.flows.revertAllChanges();
|
||||
});
|
||||
|
||||
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
|
||||
it('Login scenario, create test data source, dashboard, panel, and export scenario', () => {
|
||||
// wait for time to be set to account for any layout shift
|
||||
cy.contains('2020-01-01 00:00:00 to 2020-01-01 06:00:00').should('be.visible');
|
||||
e2e.components.PageToolbar.itemButton('Add button').click();
|
||||
e2e.components.PageToolbar.itemButton('Add new visualization menu item').click();
|
||||
|
||||
// Make sure the graph renders via checking legend
|
||||
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
|
||||
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
cy.get('input[id*="test-data-scenario-select-"]').should('be.visible').click();
|
||||
});
|
||||
|
||||
// Expand options section
|
||||
e2e.components.PanelEditor.applyButton();
|
||||
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
|
||||
|
||||
// Make sure panel is & visualization is added to dashboard
|
||||
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
|
||||
},
|
||||
};
|
||||
// Make sure the graph renders via checking legend
|
||||
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
|
||||
|
||||
// Expand options section
|
||||
e2e.components.PanelEditor.applyButton();
|
||||
|
||||
// Make sure panel is & visualization is added to dashboard
|
||||
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
|
||||
});
|
||||
});
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { smokeTestScenario } from '../shared/smokeTestScenario';
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario(smokeTestScenario);
|
||||
smokeTestScenario();
|
||||
|
@ -2,13 +2,16 @@ import { GrafanaBootConfig } from '@grafana/runtime';
|
||||
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Panels smokescreen',
|
||||
itName: 'Tests each panel type in the panel edit view to ensure no crash',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Panels smokescreen', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'), false);
|
||||
});
|
||||
|
||||
after(() => {
|
||||
e2e.flows.revertAllChanges();
|
||||
});
|
||||
|
||||
it('Tests each panel type in the panel edit view to ensure no crash', () => {
|
||||
e2e.flows.addDashboard();
|
||||
|
||||
// TODO: Try and use e2e.flows.addPanel() instead of block below
|
||||
@ -40,5 +43,5 @@ e2e.scenario({
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -8,9 +8,11 @@ const tableNameWithSpecialCharacter = tablesResponse.results.tables.frames[0].da
|
||||
const normalTableName = tablesResponse.results.tables.frames[0].data.values[0][0];
|
||||
|
||||
describe('MySQL datasource', () => {
|
||||
it('code editor autocomplete should handle table name escaping/quoting', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('code editor autocomplete should handle table name escaping/quoting', () => {
|
||||
cy.intercept(
|
||||
'POST',
|
||||
{
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { e2e } from '../index';
|
||||
|
||||
import { importDashboard, Dashboard } from './importDashboard';
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,6 @@ import { E2ESelectors, Selectors, selectors } from '@grafana/e2e-selectors';
|
||||
import * as flows from './flows';
|
||||
import { e2eFactory } from './support';
|
||||
import { benchmark } from './support/benchmark';
|
||||
import { e2eScenario, ScenarioArguments } from './support/scenario';
|
||||
import { getScenarioContext, setScenarioContext } from './support/scenarioContext';
|
||||
import * as typings from './typings';
|
||||
|
||||
@ -12,7 +11,6 @@ export const e2e = {
|
||||
config: () => Cypress.config(),
|
||||
blobToBase64String: (blob: Blob) => Cypress.Blob.blobToBase64String(blob),
|
||||
imgSrcToBlob: (url: string) => Cypress.Blob.imgSrcToBlob(url),
|
||||
scenario: (args: ScenarioArguments) => e2eScenario(args),
|
||||
benchmark,
|
||||
pages: e2eFactory({ selectors: selectors.pages }),
|
||||
typings,
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { e2e } from '../index';
|
||||
|
||||
// @todo this actually returns type `Cypress.Chainable`
|
||||
const get = (key: string): any =>
|
||||
cy.wrap({ getLocalStorage: () => localStorage.getItem(key) }, { log: false }).invoke('getLocalStorage');
|
||||
|
@ -1,53 +0,0 @@
|
||||
import { e2e } from '../';
|
||||
|
||||
export interface ScenarioArguments {
|
||||
describeName: string;
|
||||
itName: string;
|
||||
scenario: Function;
|
||||
skipScenario?: boolean;
|
||||
addScenarioDataSource?: boolean;
|
||||
addScenarioDashBoard?: boolean;
|
||||
loginViaApi?: boolean;
|
||||
}
|
||||
|
||||
export const e2eScenario = ({
|
||||
describeName,
|
||||
itName,
|
||||
scenario,
|
||||
skipScenario = false,
|
||||
addScenarioDataSource = false,
|
||||
addScenarioDashBoard = false,
|
||||
loginViaApi = true,
|
||||
}: ScenarioArguments) => {
|
||||
describe(describeName, () => {
|
||||
if (skipScenario) {
|
||||
it.skip(itName, () => scenario());
|
||||
} else {
|
||||
before(() => {
|
||||
cy.session(
|
||||
'login',
|
||||
() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'), loginViaApi);
|
||||
},
|
||||
{
|
||||
cacheAcrossSpecs: true,
|
||||
}
|
||||
);
|
||||
e2e.flows.setDefaultUserPreferences();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
if (addScenarioDataSource) {
|
||||
e2e.flows.addDataSource();
|
||||
}
|
||||
if (addScenarioDashBoard) {
|
||||
e2e.flows.addDashboard();
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(() => e2e.flows.revertAllChanges());
|
||||
|
||||
it(itName, () => scenario());
|
||||
}
|
||||
});
|
||||
};
|
@ -1,6 +1,5 @@
|
||||
import { DeleteDashboardConfig } from '../flows/deleteDashboard';
|
||||
import { DeleteDataSourceConfig } from '../flows/deleteDataSource';
|
||||
import { e2e } from '../index';
|
||||
|
||||
export interface ScenarioContext {
|
||||
addedDashboards: DeleteDashboardConfig[];
|
||||
|
@ -2,18 +2,17 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Bar Gauge Panel',
|
||||
itName: 'Bar Gauge rendering e2e tests',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Bar Gauge Panel', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Bar Gauge rendering e2e tests', () => {
|
||||
// open Panel Tests - Bar Gauge
|
||||
e2e.flows.openDashboard({ uid: 'O6f11TZWk' });
|
||||
|
||||
cy.get(`[data-panelid=6] [data-testid^="${selectors.components.Panels.Visualization.BarGauge.valueV2}"]`)
|
||||
.should('have.css', 'color', 'rgb(242, 73, 92)')
|
||||
.contains('100');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -19,7 +19,7 @@ const addDataSource = () => {
|
||||
|
||||
describe('Exemplars', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
|
||||
cy.request({ url: `${e2e.env('BASE_URL')}/api/datasources/name/${dataSourceName}`, failOnStatusCode: false }).then(
|
||||
(response) => {
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Explore',
|
||||
itName: 'Basic path through Explore.',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Explore', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Basic path through Explore.', () => {
|
||||
e2e.pages.Explore.visit();
|
||||
e2e.pages.Explore.General.container().should('have.length', 1);
|
||||
e2e.components.RefreshPicker.runButtonV2().should('have.length', 1);
|
||||
@ -39,5 +38,5 @@ e2e.scenario({
|
||||
cy.get('button[title="Delete query"]').each((button) => {
|
||||
button.trigger('click');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { e2e } from '../utils';
|
||||
const DASHBOARD_ID = 'ed155665';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Annotations filtering',
|
||||
itName: 'Tests switching filter type updates the UI accordingly',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Annotations filtering', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests switching filter type updates the UI accordingly', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID });
|
||||
|
||||
e2e.components.PageToolbar.item('Dashboard settings').click();
|
||||
@ -57,5 +56,5 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
e2e.pages.Dashboard.Annotations.marker().should('exist').should('have.length', 4);
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Gauge Panel',
|
||||
itName: 'Gauge rendering e2e tests',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Gauge Panel', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Gauge rendering e2e tests', () => {
|
||||
// open Panel Tests - Gauge
|
||||
e2e.flows.openDashboard({ uid: '_5rDmaQiz' });
|
||||
|
||||
@ -17,5 +16,5 @@ e2e.scenario({
|
||||
|
||||
// check that no panel errors exist
|
||||
e2e.components.Panels.Panel.headerCornerInfo('error').should('not.exist');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -2,13 +2,12 @@ import { e2e } from '../utils';
|
||||
const DASHBOARD_ID = 'XMjIZPmik';
|
||||
const DASHBOARD_NAME = 'Panel Tests - Graph Time Regions';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Auto-migrate graph panel',
|
||||
itName: 'Annotation markers exist for time regions',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Auto-migrate graph panel', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Annotation markers exist for time regions', () => {
|
||||
e2e.flows.openDashboard({ uid: DASHBOARD_ID });
|
||||
cy.contains(DASHBOARD_NAME).should('be.visible');
|
||||
cy.contains('uplot-main-div').should('not.exist');
|
||||
@ -48,5 +47,5 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
e2e.pages.Dashboard.Annotations.marker().should('exist');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -2,13 +2,12 @@ import { e2e } from '../utils';
|
||||
|
||||
const PANEL_UNDER_TEST = 'Value reducers 1';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Inspect drawer tests',
|
||||
itName: 'Tests various Inspect Drawer scenarios',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Inspect drawer tests', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests various Inspect Drawer scenarios', () => {
|
||||
// @ts-ignore some typing issue
|
||||
cy.on('uncaught:exception', (err) => {
|
||||
if (err.stack?.indexOf("TypeError: Cannot read property 'getText' of null") !== -1) {
|
||||
@ -59,7 +58,7 @@ e2e.scenario({
|
||||
});
|
||||
|
||||
e2e.components.PanelInspector.Query.content().should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const expectDrawerTabsAndContent = () => {
|
||||
|
@ -12,13 +12,16 @@ const addDataSource = () => {
|
||||
});
|
||||
};
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Loki Query Editor',
|
||||
itName: 'Autocomplete features should work as expected.',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Loki Query Editor', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
e2e.flows.revertAllChanges();
|
||||
});
|
||||
|
||||
it('Autocomplete features should work as expected.', () => {
|
||||
addDataSource();
|
||||
|
||||
cy.intercept(/labels?/, (req) => {
|
||||
@ -84,5 +87,5 @@ e2e.scenario({
|
||||
e2e.components.QueryField.container().type('{selectall}av');
|
||||
cy.contains('avg').should('be.visible');
|
||||
cy.contains('avg_over_time').should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ const finalQuery = 'rate({instance=~"instance1|instance2"} | logfmt | __error__=
|
||||
|
||||
describe('Loki query builder', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
|
||||
cy.request({ url: `${e2e.env('BASE_URL')}/api/datasources/name/${dataSourceName}`, failOnStatusCode: false }).then(
|
||||
(response) => {
|
||||
|
@ -2,13 +2,12 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Pie Chart Panel',
|
||||
itName: 'Pie Chart rendering e2e tests',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Pie Chart Panel', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Pie Chart rendering e2e tests', () => {
|
||||
// open Panel Tests - Pie Chart
|
||||
e2e.flows.openDashboard({ uid: 'lVE-2YFMz' });
|
||||
|
||||
@ -16,5 +15,5 @@ e2e.scenario({
|
||||
'have.length',
|
||||
5
|
||||
);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Query editor',
|
||||
itName: 'Undo should work in query editor for prometheus -- test CI.',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Query editor', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Undo should work in query editor for prometheus -- test CI.', () => {
|
||||
e2e.pages.Explore.visit();
|
||||
e2e.components.DataSourcePicker.container().should('be.visible').click();
|
||||
|
||||
@ -31,5 +30,5 @@ e2e.scenario({
|
||||
cy.contains(queryText).should('be.visible');
|
||||
|
||||
e2e.components.Alert.alertV2('error').should('not.be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Select focus/unfocus tests',
|
||||
itName: 'Tests select focus/unfocus scenarios',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Select focus/unfocus tests', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Tests select focus/unfocus scenarios', () => {
|
||||
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
|
||||
e2e.components.PageToolbar.item('Dashboard settings').click();
|
||||
|
||||
@ -31,5 +30,5 @@ e2e.scenario({
|
||||
.within(() => {
|
||||
cy.get('#dashboard-folder-input').should('exist').should('not.have.focus');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Solo Route',
|
||||
itName: 'Can view panels with shared queries in fullsceen',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Solo Route', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Can view panels with shared queries in fullsceen', () => {
|
||||
// open Panel Tests - Bar Gauge
|
||||
e2e.pages.SoloPanel.visit('ZqZnVvFZz/datasource-tests-shared-queries?orgId=1&panelId=4');
|
||||
|
||||
cy.get('canvas').should('have.length', 6);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,8 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
describe('Trace view', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Can lazy load big traces', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
cy.intercept('GET', '**/api/traces/trace', {
|
||||
fixture: 'long-trace-response.json',
|
||||
}).as('longTrace');
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
e2e.scenario({
|
||||
describeName: 'Visualization suggestions',
|
||||
itName: 'Should be shown and clickable',
|
||||
addScenarioDataSource: false,
|
||||
addScenarioDashBoard: false,
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
describe('Visualization suggestions', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('Should be shown and clickable', () => {
|
||||
e2e.flows.openDashboard({ uid: 'aBXrJ0R7z', queryParams: { editPanel: 9 } });
|
||||
|
||||
// Try visualization suggestions
|
||||
@ -25,5 +24,5 @@ e2e.scenario({
|
||||
// Select a visualisation
|
||||
e2e.components.VisualizationPreview.card('Table').click();
|
||||
e2e.components.Panels.Visualization.Table.header().should('be.visible');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { smokeTestScenario } from '../../shared/smokeTestScenario';
|
||||
import { e2e } from '../../utils';
|
||||
|
||||
e2e.scenario(smokeTestScenario);
|
||||
smokeTestScenario();
|
||||
|
Loading…
Reference in New Issue
Block a user