2023-09-08 16:51:59 +01:00
|
|
|
import { e2e } from '../utils';
|
2021-02-02 10:17:38 +01:00
|
|
|
|
|
|
|
|
describe('Trace view', () => {
|
2023-09-13 13:24:20 +01:00
|
|
|
beforeEach(() => {
|
2023-09-27 11:33:00 +01:00
|
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
2023-09-13 13:24:20 +01:00
|
|
|
});
|
|
|
|
|
|
2021-02-02 10:17:38 +01:00
|
|
|
it('Can lazy load big traces', () => {
|
2023-09-11 11:20:54 +01:00
|
|
|
cy.intercept('GET', '**/api/traces/trace', {
|
|
|
|
|
fixture: 'long-trace-response.json',
|
|
|
|
|
}).as('longTrace');
|
2021-02-02 10:17:38 +01:00
|
|
|
|
|
|
|
|
e2e.pages.Explore.visit();
|
|
|
|
|
|
2021-11-26 16:38:48 +01:00
|
|
|
e2e.components.DataSourcePicker.container().should('be.visible').type('gdev-jaeger{enter}');
|
2023-09-11 11:20:54 +01:00
|
|
|
// 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');
|
2021-02-24 14:18:52 +01:00
|
|
|
|
2021-08-25 11:30:32 +02:00
|
|
|
e2e.components.TraceViewer.spanBar().should('be.visible');
|
2021-02-24 14:18:52 +01:00
|
|
|
|
2021-09-15 16:26:23 +01:00
|
|
|
e2e.components.TraceViewer.spanBar()
|
|
|
|
|
.its('length')
|
|
|
|
|
.then((oldLength) => {
|
2022-05-03 15:28:40 +01:00
|
|
|
e2e.pages.Explore.General.scrollView().children('.scrollbar-view').scrollTo('center');
|
2021-02-02 10:17:38 +01:00
|
|
|
|
2021-09-15 16:26:23 +01:00
|
|
|
// After scrolling we should load more spans
|
2023-04-11 10:51:54 +01:00
|
|
|
e2e.components.TraceViewer.spanBar().should(($span) => {
|
|
|
|
|
expect($span.length).to.be.gt(oldLength);
|
|
|
|
|
});
|
2021-09-15 16:26:23 +01:00
|
|
|
});
|
2021-02-02 10:17:38 +01:00
|
|
|
});
|
|
|
|
|
});
|