Prometheus: Migrate remaining selectors to data-testid (#106564)

This commit is contained in:
Ida Štambuk
2025-06-26 10:22:42 +00:00
committed by GitHub
parent 2297417374
commit 2e9c4a76c4
7 changed files with 11 additions and 14 deletions
@@ -1,5 +1,3 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../utils';
import { addDashboard } from '../utils/flows';
@@ -56,7 +54,7 @@ describe('Prometheus annotations', () => {
// check for other parts of the annotations
// min step
cy.get(`#${selectors.components.DataSource.Prometheus.annotations.minStep}`);
e2e.components.DataSource.Prometheus.annotations.minStep().should('exist');
// title
e2e.components.DataSource.Prometheus.annotations.title().scrollIntoView().should('exist');
@@ -65,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(`[data-test-id="prometheus-step"]`).scrollIntoView().should('exist');
e2e.components.DataSource.Prometheus.queryEditor.step().scrollIntoView().should('exist');
e2e.components.DataSource.Prometheus.queryEditor.type().scrollIntoView().should('exist');
cy.get(`[data-testid="prometheus-exemplars"]`).scrollIntoView().should('exist');
e2e.components.DataSource.Prometheus.queryEditor.exemplars().scrollIntoView().should('exist');
});
describe('Code editor', () => {
@@ -1,5 +1,3 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../utils';
import { addDashboard } from '../utils/flows';
@@ -57,7 +55,7 @@ describe('Prometheus annotations', () => {
// check for other parts of the annotations
// min step
cy.get(`#${selectors.components.DataSource.Prometheus.annotations.minStep}`);
e2e.components.DataSource.Prometheus.annotations.minStep().should('exist');
// title
e2e.components.DataSource.Prometheus.annotations.title().scrollIntoView().should('exist');
+2 -2
View File
@@ -65,9 +65,9 @@ describe.skip('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(`[data-test-id="prometheus-step"]`).scrollIntoView().should('exist');
e2e.components.DataSource.Prometheus.queryEditor.step().scrollIntoView().should('exist');
e2e.components.DataSource.Prometheus.queryEditor.type().scrollIntoView().should('exist');
cy.get(`[data-testid="prometheus-exemplars"]`).scrollIntoView().should('exist');
e2e.components.DataSource.Prometheus.queryEditor.exemplars().scrollIntoView().should('exist');
});
describe('Code editor', () => {