grafana/e2e/suite1/specs/query-editor.spec.ts
Marcus Andersson 7feaddea8f
Chore: adding platform independent typings for e2e tests. (#27768)
* added typings that are platform independent in the tests.

* fixing nits.
2020-09-24 18:47:25 +02:00

37 lines
959 B
TypeScript

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(e2e.typings.undo());
cy.contains(queryText).should('be.visible');
},
});