Skip to content

Commit

Permalink
Fix e2e for main grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
asimonok committed Sep 30, 2024
1 parent 858e260 commit b9fcd34
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
23 changes: 5 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@babel/core": "^7.25.2",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.7.1",
"@grafana/plugin-e2e": "^1.8.2",
"@grafana/tsconfig": "^2.0.0",
"@swc/core": "^1.7.23",
"@swc/helpers": "^0.5.13",
Expand Down
12 changes: 7 additions & 5 deletions provisioning/dashboards/devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2,
"links": [],
"panels": [
{
Expand Down Expand Up @@ -140,7 +141,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "select * from comments WHERE id IN (${payload.ids:sqlstring});",
"rawSql": "select * from comments WHERE id IN (${payload.ids:csv});",
"refId": "A",
"sql": {
"columns": [
Expand Down Expand Up @@ -214,7 +215,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "select id, title from comments WHERE id IN (${payload.ids:sqlstring});",
"rawSql": "select id, title from comments WHERE id IN (${payload.ids:csv});",
"refId": "A",
"sql": {
"columns": [
Expand Down Expand Up @@ -834,7 +835,7 @@
"export": false
}
},
"pluginVersion": "1.3.0",
"pluginVersion": "1.4.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -996,7 +997,8 @@
"type": "volkovlabs-table-panel"
}
],
"schemaVersion": 39,
"preload": false,
"schemaVersion": 40,
"tags": [],
"templating": {
"list": []
Expand All @@ -1009,6 +1011,6 @@
"timezone": "browser",
"title": "Devices",
"uid": "edxke3hyi04cgc",
"version": 21,
"version": 1,
"weekStart": ""
}
29 changes: 20 additions & 9 deletions test/panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import { test, expect } from '@grafana/plugin-e2e';
import { PanelHelper } from './utils';

test.describe('Business Table Panel', () => {
/**
* Disable scenes for tests with panel edit
*/
const sceneDisabledParams = new URLSearchParams();
sceneDisabledParams.set('scenes', 'false');

test('Check grafana version', async ({ grafanaVersion }) => {
console.log('Grafana version: ', grafanaVersion);
expect(grafanaVersion).toEqual(grafanaVersion);
});

test('Should display a Table', async ({ gotoDashboardPage, readProvisionedDashboard, page }) => {
test('Should display a Table', async ({ gotoDashboardPage, readProvisionedDashboard }) => {
/**
* Go To Panels dashboard panels.json
* return dashboardPage
Expand All @@ -35,7 +41,7 @@ test.describe('Business Table Panel', () => {
* return dashboardPage
*/
const dashboard = await readProvisionedDashboard({ fileName: 'panels.json' });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid, queryParams: sceneDisabledParams });

/**
* Add new visualization
Expand All @@ -56,14 +62,13 @@ test.describe('Business Table Panel', () => {
gotoDashboardPage,
page,
readProvisionedDashboard,
selectors,
}) => {
/**
* Go To Panels dashboard panels.json
* return dashboardPage
*/
const dashboard = await readProvisionedDashboard({ fileName: 'panels.json' });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid, queryParams: sceneDisabledParams });

/**
* Add new visualization
Expand Down Expand Up @@ -125,7 +130,7 @@ test.describe('Business Table Panel', () => {
await header.getHeaderCell('A-series').checkText('A-series');
});

test('Should toggle tables via tabs', async ({ gotoDashboardPage, page, readProvisionedDashboard }) => {
test('Should toggle tables via tabs', async ({ gotoDashboardPage, readProvisionedDashboard }) => {
/**
* Go To Panels dashboard panels.json
* return dashboardPage
Expand Down Expand Up @@ -169,7 +174,7 @@ test.describe('Business Table Panel', () => {
* return dashboardPage
*/
const dashboard = await readProvisionedDashboard({ fileName: 'devices.json' });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid, queryParams: sceneDisabledParams });

/**
* Add new visualization
Expand Down Expand Up @@ -257,7 +262,7 @@ test.describe('Business Table Panel', () => {
});

test.describe('Filtering', () => {
test('Should filter table', async ({ page, gotoDashboardPage, readProvisionedDashboard }) => {
test('Should filter table', async ({ gotoDashboardPage, readProvisionedDashboard }) => {
/**
* Go To Panels dashboard panels.json
* return dashboardPage
Expand Down Expand Up @@ -303,7 +308,10 @@ test.describe('Business Table Panel', () => {
* return dashboardPage
*/
const dashboard = await readProvisionedDashboard({ fileName: 'devices.json' });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid });
/**
* Disable scene due until refresh panel data issue is resolved
*/
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid, queryParams: sceneDisabledParams });

/**
* Get Table panel
Expand Down Expand Up @@ -365,7 +373,10 @@ test.describe('Business Table Panel', () => {
* return dashboardPage
*/
const dashboard = await readProvisionedDashboard({ fileName: 'devices.json' });
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid });
/**
* Disable scene due until refresh panel data issue is resolved
*/
const dashboardPage = await gotoDashboardPage({ uid: dashboard.uid, queryParams: sceneDisabledParams });

/**
* Get Table panel
Expand Down

0 comments on commit b9fcd34

Please sign in to comment.