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