Skip to content

Commit

Permalink
use correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
sunker committed Oct 1, 2024
1 parent e5daed5 commit 4043005
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/plugin-e2e/src/models/pages/DashboardPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export class DashboardPage extends GrafanaPage {
async addPanel(): Promise<PanelEditPage> {
const { components, pages } = this.ctx.selectors;

// From Grafana 10.3.0, one needs to click the edit button before adding a new panel in already existing dashboards
if (semver.gte(this.ctx.grafanaVersion, '10.3.0') && this.dashboard?.uid) {
// From Grafana 11.3.0, one needs to click the edit button before adding a new panel in already existing dashboards
if (semver.gte(this.ctx.grafanaVersion, '11.3.0') && this.dashboard?.uid) {
await this.getByGrafanaSelector(components.NavToolbar.editDashboard.editButton).click();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-e2e/src/models/pages/PanelEditPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class PanelEditPage extends GrafanaPage {

/**
* Clicks the "Back to dashboard" button in the panel editor
* In versions prior to 10.3.0, this method clicks the "Apply" button instead
* In versions prior to 11.3.0, this method clicks the "Apply" button instead
*/
async backToDashboard() {
if (semver.gte(this.ctx.grafanaVersion, '11.3.0')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect, test } from '../../../../src';

test('add panel in already existing dashboard', async ({ gotoDashboardPage, readProvisionedDashboard, page }) => {
const dashboard = await readProvisionedDashboard({ fileName: 'redshift.json' });
const dashboardPage = await gotoDashboardPage({ uid: 'edediimbjhdz4b' });
const dashboardPage = await gotoDashboardPage(dashboard);
const panelEditPage = await dashboardPage.addPanel();
await expect(panelEditPage.panel.locator).toBeVisible();
await expect(page.url()).toContain('editPanel');
Expand Down

0 comments on commit 4043005

Please sign in to comment.