2020-05-19 08:41:52 -05:00
|
|
|
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();
|
2021-10-12 23:09:35 -05:00
|
|
|
e2e.components.DataSourcePicker.inputV2().should('be.visible').click();
|
2021-07-14 08:04:23 -05:00
|
|
|
|
|
|
|
cy.contains('gdev-prometheus').scrollIntoView().should('be.visible').click();
|
2020-05-19 08:41:52 -05:00
|
|
|
const queryText = 'http_requests_total';
|
|
|
|
|
2021-11-08 07:20:48 -06:00
|
|
|
// we need to wait for the query-field being lazy-loaded, in two steps:
|
|
|
|
// it is a two-step process:
|
|
|
|
// 1. first we wait for the text 'Loading...' to appear
|
|
|
|
// 1. then we wait for the text 'Loading...' to disappear
|
|
|
|
const monacoLoadingText = 'Loading...';
|
|
|
|
e2e.components.QueryField.container().should('be.visible').should('have.text', monacoLoadingText);
|
|
|
|
e2e.components.QueryField.container().should('be.visible').should('not.have.text', monacoLoadingText);
|
|
|
|
|
|
|
|
e2e.components.QueryField.container().type(queryText).type('{backspace}');
|
2020-05-19 08:41:52 -05:00
|
|
|
|
|
|
|
cy.contains(queryText.slice(0, -1)).should('be.visible');
|
|
|
|
|
2020-09-24 11:47:25 -05:00
|
|
|
e2e.components.QueryField.container().type(e2e.typings.undo());
|
2020-05-19 08:41:52 -05:00
|
|
|
|
|
|
|
cy.contains(queryText).should('be.visible');
|
|
|
|
},
|
|
|
|
});
|