From 5472478ee838876db8a91aa046237dbc1636a902 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Wed, 25 Sep 2024 15:29:19 +0200 Subject: [PATCH] Prometheus: Fix e2e selector by using "data-test-id" instead of "id" (#93736) * use data-test-id instead of id * don't skip --- e2e/various-suite/prometheus-editor.spec.ts | 6 ++---- .../src/querybuilder/components/PromQueryBuilderOptions.tsx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/e2e/various-suite/prometheus-editor.spec.ts b/e2e/various-suite/prometheus-editor.spec.ts index a35ca282e50..d04d502a706 100644 --- a/e2e/various-suite/prometheus-editor.spec.ts +++ b/e2e/various-suite/prometheus-editor.spec.ts @@ -1,5 +1,3 @@ -import { selectors } from '@grafana/e2e-selectors'; - import { e2e } from '../utils'; import { getResources } from './helpers/prometheus-helpers'; @@ -67,9 +65,9 @@ describe('Prometheus query editor', () => { // check options e2e.components.DataSource.Prometheus.queryEditor.legend().scrollIntoView().should('exist'); e2e.components.DataSource.Prometheus.queryEditor.format().scrollIntoView().should('exist'); - cy.get(`#${selectors.components.DataSource.Prometheus.queryEditor.step}`).scrollIntoView().should('exist'); + cy.get(`[data-test-id="prometheus-step"]`).scrollIntoView().should('exist'); e2e.components.DataSource.Prometheus.queryEditor.type().scrollIntoView().should('exist'); - cy.get(`#${selectors.components.DataSource.Prometheus.queryEditor.exemplars}`).scrollIntoView().should('exist'); + cy.get(`[data-test-id="prometheus-exemplars"]`).scrollIntoView().should('exist'); }); describe('Code editor', () => { diff --git a/packages/grafana-prometheus/src/querybuilder/components/PromQueryBuilderOptions.tsx b/packages/grafana-prometheus/src/querybuilder/components/PromQueryBuilderOptions.tsx index 60c73709c68..d79bb1716e0 100644 --- a/packages/grafana-prometheus/src/querybuilder/components/PromQueryBuilderOptions.tsx +++ b/packages/grafana-prometheus/src/querybuilder/components/PromQueryBuilderOptions.tsx @@ -92,7 +92,7 @@ export const PromQueryBuilderOptions = React.memo( minWidth={10} onCommitChange={onChangeStep} defaultValue={query.interval} - id={selectors.components.DataSource.Prometheus.queryEditor.step} + data-test-id="prometheus-step" /> @@ -112,7 +112,7 @@ export const PromQueryBuilderOptions = React.memo( )}