2023-09-08 10:51:59 -05:00
|
|
|
import { e2e } from '../utils';
|
2024-02-08 16:00:48 -06:00
|
|
|
|
2023-04-26 21:28:58 -05:00
|
|
|
const DASHBOARD_ID = 'XMjIZPmik';
|
|
|
|
const DASHBOARD_NAME = 'Panel Tests - Graph Time Regions';
|
2024-02-08 16:00:48 -06:00
|
|
|
const UPLOT_MAIN_DIV_SELECTOR = '[data-testid="uplot-main-div"]';
|
2023-04-26 21:28:58 -05:00
|
|
|
|
2023-09-13 07:24:20 -05:00
|
|
|
describe('Auto-migrate graph panel', () => {
|
|
|
|
beforeEach(() => {
|
2023-09-27 05:33:00 -05:00
|
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
|
|
|
|
2024-02-08 16:00:48 -06:00
|
|
|
it('Graph panel is migrated with `autoMigrateOldPanels` feature toggle', () => {
|
2023-04-26 21:28:58 -05:00
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID });
|
2023-09-11 05:20:54 -05:00
|
|
|
cy.contains(DASHBOARD_NAME).should('be.visible');
|
2024-02-08 16:00:48 -06:00
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('not.exist');
|
2023-04-26 21:28:58 -05:00
|
|
|
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { '__feature.autoMigrateOldPanels': true } });
|
|
|
|
|
2024-02-08 16:00:48 -06:00
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Graph panel is migrated with config `disableAngular` feature toggle', () => {
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID });
|
|
|
|
cy.contains(DASHBOARD_NAME).should('be.visible');
|
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('not.exist');
|
|
|
|
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { '__feature.disableAngular': true } });
|
|
|
|
|
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Graph panel is migrated with `autoMigrateGraphPanel` feature toggle', () => {
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID });
|
|
|
|
cy.contains(DASHBOARD_NAME).should('be.visible');
|
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('not.exist');
|
|
|
|
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { '__feature.autoMigrateGraphPanel': true } });
|
|
|
|
|
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Annotation markers exist for time regions', () => {
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID });
|
|
|
|
cy.contains(DASHBOARD_NAME).should('be.visible');
|
|
|
|
cy.get(UPLOT_MAIN_DIV_SELECTOR).should('not.exist');
|
|
|
|
|
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { '__feature.autoMigrateGraphPanel': true } });
|
|
|
|
|
2023-04-26 21:28:58 -05:00
|
|
|
e2e.components.Panels.Panel.title('Business Hours')
|
|
|
|
.should('exist')
|
|
|
|
.within(() => {
|
|
|
|
e2e.pages.Dashboard.Annotations.marker().should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
e2e.components.Panels.Panel.title("Sunday's 20-23")
|
|
|
|
.should('exist')
|
|
|
|
.within(() => {
|
|
|
|
e2e.pages.Dashboard.Annotations.marker().should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
e2e.components.Panels.Panel.title('Each day of week')
|
|
|
|
.should('exist')
|
|
|
|
.within(() => {
|
|
|
|
e2e.pages.Dashboard.Annotations.marker().should('exist');
|
|
|
|
});
|
|
|
|
|
2024-02-06 07:43:11 -06:00
|
|
|
cy.get('#pageContent .scrollbar-view').first().scrollTo('bottom');
|
2023-04-26 21:28:58 -05:00
|
|
|
|
|
|
|
e2e.components.Panels.Panel.title('05:00')
|
|
|
|
.should('exist')
|
|
|
|
.within(() => {
|
|
|
|
e2e.pages.Dashboard.Annotations.marker().should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
e2e.components.Panels.Panel.title('From 22:00 to 00:30 (crossing midnight)')
|
|
|
|
.should('exist')
|
|
|
|
.within(() => {
|
|
|
|
e2e.pages.Dashboard.Annotations.marker().should('exist');
|
|
|
|
});
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
2023-04-26 21:28:58 -05:00
|
|
|
});
|