mirror of https://github.com/grafana/grafana
Explore: fix undo in query editor (#24797)
* Explore: fix undo in query editor * Add e2e test for regressionpull/24867/head
parent
c62591e77b
commit
29afc2feb8
@ -0,0 +1,36 @@ |
|||||||
|
import { e2e } from '@grafana/e2e'; |
||||||
|
|
||||||
|
e2e.scenario({ |
||||||
|
describeName: 'Query editor', |
||||||
|
itName: 'Undo should work in query editor for prometheus.', |
||||||
|
addScenarioDataSource: false, |
||||||
|
addScenarioDashBoard: false, |
||||||
|
skipScenario: false, |
||||||
|
scenario: () => { |
||||||
|
e2e.pages.Explore.visit(); |
||||||
|
e2e.components.DataSourcePicker.container() |
||||||
|
.should('be.visible') |
||||||
|
.within(() => { |
||||||
|
e2e.components.Select.input() |
||||||
|
.should('be.visible') |
||||||
|
.click(); |
||||||
|
|
||||||
|
cy.contains('gdev-prometheus') |
||||||
|
.scrollIntoView() |
||||||
|
.should('be.visible') |
||||||
|
.click(); |
||||||
|
}); |
||||||
|
const queryText = 'http_requests_total'; |
||||||
|
|
||||||
|
e2e.components.QueryField.container() |
||||||
|
.should('be.visible') |
||||||
|
.type(queryText) |
||||||
|
.type('{backspace}'); |
||||||
|
|
||||||
|
cy.contains(queryText.slice(0, -1)).should('be.visible'); |
||||||
|
|
||||||
|
e2e.components.QueryField.container().type('{ctrl}z'); |
||||||
|
|
||||||
|
cy.contains(queryText).should('be.visible'); |
||||||
|
}, |
||||||
|
}); |
||||||
Loading…
Reference in new issue