grafana/e2e/scenes/various-suite/query-editor.spec.ts
Sergej-Vlasov 8d0e437287
DashboardScene - Add various-suite to scenes e2e (#88911)
* duplicate various-suite in scenes e2e

* restore original various-suite

* adjust various-suite e2e tests for scenes

* adjust workflow for test run

* adjust flaky exemplars test

* remove old dash script and restore workflow

* duplicate e2e/various-suite/keybinds.spec.ts into e2e/scenes

* restore original e2e/various-suite/keybinds.spec.ts

* add new keybinds e2e test

* restore workflow file after test run
2024-06-12 11:36:11 +02:00

33 lines
1.1 KiB
TypeScript

import { e2e } from '../utils';
import { waitForMonacoToLoad } from '../utils/support/monaco';
describe('Query editor', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});
// x-ing to bypass this flaky test.
// Will rewrite in plugin-e2e with this issue
xit('Undo should work in query editor for prometheus -- test CI.', () => {
e2e.pages.Explore.visit();
e2e.components.DataSourcePicker.container().should('be.visible').click();
cy.contains('gdev-prometheus').scrollIntoView().should('be.visible').click();
const queryText = `rate(http_requests_total{job="grafana"}[5m])`;
e2e.components.RadioButton.container().filter(':contains("Code")').should('be.visible').click();
waitForMonacoToLoad();
e2e.components.QueryField.container().type(queryText, { parseSpecialCharSequences: false }).type('{backspace}');
cy.contains(queryText.slice(0, -1)).should('be.visible');
e2e.components.QueryField.container().type(e2e.typings.undo());
cy.contains(queryText).should('be.visible');
e2e.components.Alert.alertV2('error').should('not.be.visible');
});
});