2023-09-08 16:51:59 +01:00
|
|
|
import { e2e } from '../utils';
|
2020-04-24 08:48:04 +02:00
|
|
|
|
2023-09-13 13:24:20 +01:00
|
|
|
describe('Explore', () => {
|
|
|
|
|
beforeEach(() => {
|
2023-09-27 11:33:00 +01:00
|
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
2023-09-13 13:24:20 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Basic path through Explore.', () => {
|
2020-04-24 08:48:04 +02:00
|
|
|
e2e.pages.Explore.visit();
|
|
|
|
|
e2e.pages.Explore.General.container().should('have.length', 1);
|
2021-11-10 11:01:06 +01:00
|
|
|
e2e.components.RefreshPicker.runButtonV2().should('have.length', 1);
|
2020-04-24 08:48:04 +02:00
|
|
|
|
2023-04-05 09:08:03 -05:00
|
|
|
// delete query history queries that would be unrelated
|
|
|
|
|
e2e.components.QueryTab.queryHistoryButton().should('be.visible').click();
|
|
|
|
|
cy.get('button[title="Delete query"]').each((button) => {
|
|
|
|
|
button.trigger('click');
|
|
|
|
|
});
|
2023-06-06 15:31:39 +01:00
|
|
|
cy.get('button[title="Delete query"]').should('not.exist');
|
2023-04-05 09:08:03 -05:00
|
|
|
e2e.components.QueryTab.queryHistoryButton().should('be.visible').click();
|
|
|
|
|
|
2020-10-20 18:18:14 +02:00
|
|
|
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
2023-04-05 09:08:03 -05:00
|
|
|
.scrollIntoView()
|
2020-10-20 18:18:14 +02:00
|
|
|
.should('be.visible')
|
|
|
|
|
.within(() => {
|
2023-09-11 11:20:54 +01:00
|
|
|
cy.get('input[id*="test-data-scenario-select-"]').should('be.visible').click();
|
2020-10-20 18:18:14 +02:00
|
|
|
});
|
|
|
|
|
|
2021-07-14 14:04:23 +01:00
|
|
|
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
|
|
|
|
|
|
2023-09-11 11:20:54 +01:00
|
|
|
const canvases = cy.get('canvas');
|
2021-01-15 16:20:20 +01:00
|
|
|
canvases.should('have.length', 1);
|
2022-05-17 12:59:16 +02:00
|
|
|
|
|
|
|
|
// Both queries above should have been run and be shown in the query history
|
|
|
|
|
e2e.components.QueryTab.queryHistoryButton().should('be.visible').click();
|
2023-06-21 10:06:28 +01:00
|
|
|
e2e.components.QueryHistory.queryText().should('have.length', 1).should('contain', 'csv_metric_values');
|
2022-12-19 14:21:00 +00:00
|
|
|
|
|
|
|
|
// delete all queries
|
|
|
|
|
cy.get('button[title="Delete query"]').each((button) => {
|
|
|
|
|
button.trigger('click');
|
|
|
|
|
});
|
2023-09-13 13:24:20 +01:00
|
|
|
});
|
2020-04-24 08:48:04 +02:00
|
|
|
});
|