2023-09-08 23:51:59 +08:00
|
|
|
import { e2e } from '../utils';
|
2020-05-12 18:48:26 +08:00
|
|
|
|
|
|
|
|
export const smokeTestScenario = {
|
|
|
|
|
describeName: 'Smoke tests',
|
|
|
|
|
itName: 'Login scenario, create test data source, dashboard, panel, and export scenario',
|
|
|
|
|
addScenarioDataSource: true,
|
|
|
|
|
addScenarioDashBoard: true,
|
|
|
|
|
skipScenario: false,
|
2021-12-16 17:28:37 +08:00
|
|
|
loginViaApi: false,
|
2020-05-12 18:48:26 +08:00
|
|
|
scenario: () => {
|
2023-03-30 17:42:43 +08:00
|
|
|
// wait for time to be set to account for any layout shift
|
2023-09-11 18:20:54 +08:00
|
|
|
cy.contains('2020-01-01 00:00:00 to 2020-01-01 06:00:00').should('be.visible');
|
2023-06-08 18:16:08 +08:00
|
|
|
e2e.components.PageToolbar.itemButton('Add button').click();
|
2023-04-03 19:04:54 +08:00
|
|
|
e2e.components.PageToolbar.itemButton('Add new visualization menu item').click();
|
2020-05-12 18:48:26 +08:00
|
|
|
|
2020-10-14 18:08:35 +08:00
|
|
|
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
|
|
|
|
.should('be.visible')
|
|
|
|
|
.within(() => {
|
2023-09-11 18:20:54 +08:00
|
|
|
cy.get('input[id*="test-data-scenario-select-"]').should('be.visible').click();
|
2020-10-14 18:08:35 +08:00
|
|
|
});
|
2020-05-12 18:48:26 +08:00
|
|
|
|
2021-07-14 21:04:23 +08:00
|
|
|
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
|
|
|
|
|
|
2020-05-12 18:48:26 +08:00
|
|
|
// Make sure the graph renders via checking legend
|
2021-05-05 19:19:14 +08:00
|
|
|
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
|
2020-05-12 18:48:26 +08:00
|
|
|
|
|
|
|
|
// Expand options section
|
2021-05-05 19:19:14 +08:00
|
|
|
e2e.components.PanelEditor.applyButton();
|
2020-05-12 18:48:26 +08:00
|
|
|
|
2021-05-05 19:19:14 +08:00
|
|
|
// Make sure panel is & visualization is added to dashboard
|
|
|
|
|
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
|
2020-05-12 18:48:26 +08:00
|
|
|
},
|
|
|
|
|
};
|