E2E: Do not skip visualization suggestions (#40955)

* E2E: Do not skip visualization suggestions 

Was disabled because drone performance is so varied that it sometimes completes and sometimes needs a lot more time, trying to increase wait time and see if that helps.

* Made it possible to go directly to panel edit

* Fixes
This commit is contained in:
Torkel Ödegaard 2021-10-28 09:56:21 +02:00 committed by GitHub
parent 7521d56cec
commit eabaa3af2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 20 deletions

View File

@ -1,7 +1,6 @@
import { e2e } from '@grafana/e2e';
import { expect } from '../../../public/test/lib/common';
const PANEL_UNDER_TEST = 'Random walk series';
const flakyTimeout = 10000;
e2e.scenario({
@ -11,9 +10,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
e2e.flows.openDashboard({ uid: '5SdHCadmz', queryParams: { editPanel: 3 } });
// New panel editor opens when navigating from Panel menu
e2e.components.PanelEditor.General.content().should('be.visible');

View File

@ -1,7 +1,5 @@
import { e2e } from '@grafana/e2e';
const PANEL_UNDER_TEST = 'Random walk series';
e2e.scenario({
describeName: 'Panel edit tests - transformations',
itName: 'Tests transformations editor',
@ -9,9 +7,7 @@ e2e.scenario({
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard({ uid: '5SdHCadmz' });
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
e2e.flows.openDashboard({ uid: '5SdHCadmz', queryParams: { editPanel: 3 } });
e2e.components.Tab.title('Transform').should('be.visible').click();

View File

@ -1,21 +1,18 @@
import { e2e } from '@grafana/e2e';
const PANEL_UNDER_TEST = 'Interpolation: linear';
e2e.scenario({
describeName: 'Visualization suggestions',
itName: 'Should be shown and clickable',
addScenarioDataSource: false,
addScenarioDashBoard: false,
skipScenario: true,
skipScenario: false,
scenario: () => {
e2e.flows.openDashboard({ uid: 'TkZXxlNG3' });
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
e2e.flows.openDashboard({ uid: 'aBXrJ0R7z', queryParams: { editPanel: 9 } });
// Try visualization suggestions
e2e.components.PanelEditor.toggleVizPicker().click();
e2e().contains('Suggestions').click();
cy.wait(1000);
cy.wait(3000);
// Verify we see suggestions
e2e.components.VisualizationPreview.card('Line chart').should('be.visible');

View File

@ -8,6 +8,7 @@ interface OpenDashboardDefault {
interface OpenDashboardOptional {
timeRange?: TimeRangeConfig;
queryParams?: object;
}
export type PartialOpenDashboardConfig = Partial<OpenDashboardDefault> & OpenDashboardOptional;
@ -21,9 +22,9 @@ export const openDashboard = (config?: PartialOpenDashboardConfig) =>
...config,
};
const { timeRange, uid } = fullConfig;
const { timeRange, uid, queryParams } = fullConfig;
e2e.pages.Dashboard.visit(uid);
e2e.pages.Dashboard.visit(uid, queryParams);
if (timeRange) {
setDashboardTimeRange(timeRange);

View File

@ -3,7 +3,7 @@ import { e2e } from '../index';
import { Selector } from './selector';
import { fromBaseUrl } from './url';
export type VisitFunction = (args?: string) => Cypress.Chainable<Window>;
export type VisitFunction = (args?: string, queryParams?: object) => Cypress.Chainable<Window>;
export type E2EVisit = { visit: VisitFunction };
export type E2EFunction = ((text?: string, options?: CypressOptions) => Cypress.Chainable<JQuery<HTMLElement>>) &
E2EFunctionWithOnlyOptions;
@ -40,7 +40,7 @@ const processSelectors = <S extends Selectors>(e2eObjects: E2EFunctions<S>, sele
if (key === 'url') {
// @ts-ignore
e2eObjects['visit'] = (args?: string) => {
e2eObjects['visit'] = (args?: string, queryParams?: object) => {
let parsedUrl = '';
if (typeof value === 'string') {
parsedUrl = fromBaseUrl(value);
@ -51,7 +51,11 @@ const processSelectors = <S extends Selectors>(e2eObjects: E2EFunctions<S>, sele
}
e2e().logToConsole('Visiting', parsedUrl);
return e2e().visit(parsedUrl);
if (queryParams) {
return e2e().visit({ url: parsedUrl, qs: queryParams });
} else {
return e2e().visit(parsedUrl);
}
};
continue;