Skip to content

Commit

Permalink
[Security Solution] Fix flaky timeline pagination tests (elastic#173531)
Browse files Browse the repository at this point in the history
## Summary

Fixes elastic#169413
elastic#169619

and colocates related tests cases.

Flaky TR pipeline:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4614
  • Loading branch information
lgestc authored Dec 20, 2023
1 parent 3d76e39 commit bada436
Showing 1 changed file with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,34 @@ import { hostsUrl } from '../../../urls/navigation';

// Flaky on serverless
const defaultPageSize = 25;
// FLAKY: https://github.com/elastic/kibana/issues/169413
describe.skip('Pagination', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverLoad', { archiveName: 'timeline' });
});

describe('Timeline Pagination', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
cy.task('esArchiverLoad', { archiveName: 'timeline' });
login();
visitWithTimeRange(hostsUrl('allHosts'));
openTimelineUsingToggle();
populateTimeline();
});

after(() => {
afterEach(() => {
cy.task('esArchiverUnload', 'timeline');
});

it(`should have ${defaultPageSize} events in the page by default`, () => {
it(`should paginate records correctly`, () => {
// should have ${defaultPageSize} events in the page by default
cy.get(TIMELINE_EVENT).should('have.length', defaultPageSize);
});

it('should be able to go to next / previous page', () => {
// should be able to go to next / previous page
cy.get(`${TIMELINE_FLYOUT} ${TIMELINE_EVENTS_COUNT_NEXT_PAGE}`).first().click();
cy.get(`${TIMELINE_FLYOUT} ${TIMELINE_EVENTS_COUNT_PREV_PAGE}`).first().click();
});

it(`should select ${defaultPageSize} items per page by default`, () => {
// should select ${defaultPageSize} items per page by default
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE).should('contain.text', defaultPageSize);
});

it('should be able to change items count per page with the dropdown', () => {
// should be able to change items count per page with the dropdown
const itemsPerPage = 100;
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE_BTN).first().click({ force: true });
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE_BTN).first().click();
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE_OPTION(itemsPerPage)).click();
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE).should('not.have.text', '0');
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE)
Expand Down

0 comments on commit bada436

Please sign in to comment.