plugin-e2e: Fix flaky test (#83370)

fix mock issue
This commit is contained in:
Erik Sundell 2024-02-26 09:21:29 +01:00 committed by GitHub
parent 11ff4e7b8c
commit af4382e4c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
import { expect, test } from '@grafana/plugin-e2e';
import { DashboardPage, expect, test } from '@grafana/plugin-e2e';
import { formatExpectError } from '../errors';
import { successfulDataQuery } from '../mocks/queries';
@ -33,8 +33,11 @@ test.describe('query editor query data', () => {
});
test.describe('query editor with mocked responses', () => {
test('and resource `scenarios` is mocked', async ({ panelEditPage, selectors }) => {
await panelEditPage.mockResourceResponse('scenarios', scenarios);
test('and resource `scenarios` is mocked', async ({ page, selectors, grafanaVersion, request }) => {
const dashboardPage = new DashboardPage({ page, selectors, grafanaVersion, request });
await dashboardPage.goto();
await dashboardPage.mockResourceResponse('scenarios', scenarios);
const panelEditPage = await dashboardPage.addPanel();
await panelEditPage.datasource.set('gdev-testdata');
const queryEditorRow = await panelEditPage.getQueryEditorRow('A');
await queryEditorRow.getByLabel('Scenario').last().click();