Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c512d10

Browse files
DashboardScene: Adjust plugin-e2e for dashboardScene FF (grafana#89052)
adjust plugin-e2e for dashboard scene ff
1 parent 8d0e437 commit c512d10

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

e2e/plugin-e2e/plugin-e2e-api-tests/as-admin-user/panelDataAssertion.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test, DashboardPage } from '@grafana/plugin-e2e';
1+
import { expect, test } from '@grafana/plugin-e2e';
22

33
import { formatExpectError } from '../errors';
44
import { successfulDataQuery } from '../mocks/queries';
@@ -71,7 +71,7 @@ test.describe('dashboard page', () => {
7171
test('getting panel by id', async ({ gotoDashboardPage }) => {
7272
const dashboardPage = await gotoDashboardPage(REACT_TABLE_DASHBOARD);
7373
await dashboardPage.goto();
74-
const panel = await dashboardPage.getPanelById('4');
74+
const panel = await dashboardPage.getPanelByTitle('Colored background');
7575
await expect(panel.fieldNames, formatExpectError('Could not locate header elements in table panel')).toContainText([
7676
'Field',
7777
'Max',

public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('PanelOptions', () => {
116116

117117
expect(screen.getByLabelText(OptionsPaneSelector.fieldLabel('Panel options Title'))).toBeInTheDocument();
118118

119-
const input = screen.getByTestId('panel-edit-panel-title-input');
119+
const input = screen.getByTestId(selectors.components.PanelEditor.OptionsPane.fieldInput('Title'));
120120
fireEvent.change(input, { target: { value: 'New title' } });
121121

122122
expect(vizManager.state.panel.state.title).toBe('New title');
@@ -127,7 +127,7 @@ describe('PanelOptions', () => {
127127

128128
expect(screen.getByLabelText(OptionsPaneSelector.fieldLabel('Panel options Title'))).toBeInTheDocument();
129129

130-
const input = screen.getByTestId('panel-edit-panel-title-input');
130+
const input = screen.getByTestId(selectors.components.PanelEditor.OptionsPane.fieldInput('Title'));
131131
fireEvent.change(input, { target: { value: '' } });
132132

133133
expect(vizManager.state.panel.state.title).toBe('');

public/app/features/dashboard-scene/panel-edit/getPanelFrameOptions.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22

33
import { SelectableValue } from '@grafana/data';
4+
import { selectors } from '@grafana/e2e-selectors';
45
import { config } from '@grafana/runtime';
56
import { VizPanel } from '@grafana/scenes';
67
import { RadioButtonGroup, Select, DataLinksInlineEditor, Input, TextArea, Switch } from '@grafana/ui';
@@ -187,7 +188,7 @@ function PanelFrameTitle({ vizManager }: { vizManager: VizPanelManager }) {
187188

188189
return (
189190
<Input
190-
data-testid="panel-edit-panel-title-input"
191+
data-testid={selectors.components.PanelEditor.OptionsPane.fieldInput('Title')}
191192
value={title}
192193
onChange={(e) => vizManager.setPanelTitle(e.currentTarget.value)}
193194
/>

0 commit comments

Comments
 (0)