mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 09:50:29 -06:00
d8e99e2bb5
* cut down the e2e object more :) * undo changes in grafana-e2e * couple more things to undo in grafana-e2e
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { e2e } from '../utils';
|
|
|
|
describe('Trace view', () => {
|
|
beforeEach(() => {
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
|
});
|
|
|
|
it('Can lazy load big traces', () => {
|
|
cy.intercept('GET', '**/api/traces/trace', {
|
|
fixture: 'long-trace-response.json',
|
|
}).as('longTrace');
|
|
|
|
e2e.pages.Explore.visit();
|
|
|
|
e2e.components.DataSourcePicker.container().should('be.visible').type('gdev-jaeger{enter}');
|
|
// Wait for the query editor to be set correctly
|
|
e2e.components.QueryEditorRows.rows().within(() => {
|
|
cy.contains('gdev-jaeger').should('be.visible');
|
|
});
|
|
|
|
// type this with 0 delay to prevent flaky tests due to cursor position changing between rerenders
|
|
e2e.components.QueryField.container().should('be.visible').type('trace', {
|
|
delay: 0,
|
|
});
|
|
// Use shift+enter to execute the query as it's more stable than clicking the execute button
|
|
e2e.components.QueryField.container().type('{shift+enter}');
|
|
|
|
cy.wait('@longTrace');
|
|
|
|
e2e.components.TraceViewer.spanBar().should('be.visible');
|
|
|
|
e2e.components.TraceViewer.spanBar()
|
|
.its('length')
|
|
.then((oldLength) => {
|
|
e2e.pages.Explore.General.scrollView().children('.scrollbar-view').scrollTo('center');
|
|
|
|
// After scrolling we should load more spans
|
|
e2e.components.TraceViewer.spanBar().should(($span) => {
|
|
expect($span.length).to.be.gt(oldLength);
|
|
});
|
|
});
|
|
});
|
|
});
|