Chore: Bump to latest version of plugin-e2e (#84370)

bump plugin-e2e and update tests
This commit is contained in:
Erik Sundell
2024-03-13 14:37:28 +01:00
committed by GitHub
parent 0604ddac13
commit c0933fa6bb
4 changed files with 14 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
import { expect, test, PanelEditPage, DashboardPage } from '@grafana/plugin-e2e';
import { expect, test, DashboardPage } from '@grafana/plugin-e2e';
import { formatExpectError } from '../errors';
import { successfulDataQuery } from '../mocks/queries';
@@ -6,17 +6,8 @@ import { successfulDataQuery } from '../mocks/queries';
const REACT_TABLE_DASHBOARD = { uid: 'U_bZIMRMk' };
test.describe('panel edit page', () => {
test('table panel data assertions with provisioned dashboard', async ({
page,
selectors,
grafanaVersion,
request,
}) => {
const panelEditPage = new PanelEditPage(
{ page, selectors, grafanaVersion, request },
{ dashboard: REACT_TABLE_DASHBOARD, id: '4' }
);
await panelEditPage.goto();
test('table panel data assertions with provisioned dashboard', async ({ gotoPanelEditPage }) => {
const panelEditPage = await gotoPanelEditPage({ dashboard: REACT_TABLE_DASHBOARD, id: '4' });
await expect(
panelEditPage.panel.locator,
formatExpectError('Could not locate panel in panel edit page')
@@ -70,15 +61,15 @@ test.describe('panel edit page', () => {
});
test.describe('dashboard page', () => {
test('getting panel by title', async ({ page, selectors, grafanaVersion, request }) => {
const dashboardPage = new DashboardPage({ page, selectors, grafanaVersion, request }, REACT_TABLE_DASHBOARD);
test('getting panel by title', async ({ gotoDashboardPage }) => {
const dashboardPage = await gotoDashboardPage(REACT_TABLE_DASHBOARD);
await dashboardPage.goto();
const panel = await dashboardPage.getPanelByTitle('Colored background');
await expect(panel.fieldNames).toContainText(['Field', 'Max', 'Mean', 'Last']);
});
test('getting panel by id', async ({ page, selectors, grafanaVersion, request }) => {
const dashboardPage = new DashboardPage({ page, selectors, grafanaVersion, request }, REACT_TABLE_DASHBOARD);
test('getting panel by id', async ({ gotoDashboardPage }) => {
const dashboardPage = await gotoDashboardPage(REACT_TABLE_DASHBOARD);
await dashboardPage.goto();
const panel = await dashboardPage.getPanelById('4');
await expect(panel.fieldNames, formatExpectError('Could not locate header elements in table panel')).toContainText([

View File

@@ -33,9 +33,7 @@ test.describe('query editor query data', () => {
});
test.describe('query editor with mocked responses', () => {
test('and resource `scenarios` is mocked', async ({ page, selectors, grafanaVersion, request }) => {
const dashboardPage = new DashboardPage({ page, selectors, grafanaVersion, request });
await dashboardPage.goto();
test('and resource `scenarios` is mocked', async ({ selectors, dashboardPage }) => {
await dashboardPage.mockResourceResponse('scenarios', scenarios);
const panelEditPage = await dashboardPage.addPanel();
await panelEditPage.datasource.set('gdev-testdata');