Skip to content

Commit

Permalink
[EuiDataGrid] Harden osquery Cypress tests
Browse files Browse the repository at this point in the history
- not sure why they're failing/timing out with the previous clicks, likely same Cypress race condition weirdness as previous commits
  • Loading branch information
cee-chen committed Jan 22, 2024
1 parent f4f209f commit c63770e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions x-pack/plugins/osquery/cypress/tasks/saved_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ export const getSavedQueriesComplexTest = () =>

// hidden columns
cy.getBySel(RESULTS_TABLE_COLUMNS_BUTTON).should('have.text', 'Columns35');
cy.getBySel('dataGridHeaderCell-osquery.cmdline').click();
cy.contains(/Hide column$/).click();
cy.getBySel('dataGridHeaderCell-osquery.cwd').click();

cy.contains(/Hide column$/).click();
cy.getBySel('dataGridHeaderCell-osquery.disk_bytes_written.number').click();

cy.contains(/Hide column$/).click();
cy.getBySel('dataGridColumnSelectorButton').click();
cy.get('[data-popover-open="true"]').should('be.visible');
cy.getBySel('dataGridColumnSelectorToggleColumnVisibility-osquery.cmdline').click();
cy.getBySel('dataGridColumnSelectorToggleColumnVisibility-osquery.cwd').click();
cy.getBySel(
'dataGridColumnSelectorToggleColumnVisibility-osquery.disk_bytes_written.number'
).click();
cy.getBySel('dataGridColumnSelectorButton').click();
cy.get('[data-popover-open="true"]').should('not.exist');
cy.getBySel(RESULTS_TABLE_COLUMNS_BUTTON).should('have.text', 'Columns32/35');

// change pagination
cy.getBySel('pagination-button-next').click().wait(500).click();
cy.getBySel(RESULTS_TABLE_COLUMNS_BUTTON).should('have.text', 'Columns32/35');
Expand All @@ -72,8 +74,7 @@ export const getSavedQueriesComplexTest = () =>
cy.getBySel(RESULTS_TABLE_BUTTON).click();

// sorting
cy.getBySel('dataGridHeaderCell-osquery.egid').click();

cy.getBySel('dataGridHeaderCellActionButton-osquery.egid').click({ force: true });
cy.contains(/Sort A-Z$/).click();
cy.getBySel(RESULTS_TABLE_COLUMNS_BUTTON).should('have.text', 'Columns32/35');
cy.getBySel(RESULTS_TABLE_BUTTON).trigger('mouseover');
Expand Down

0 comments on commit c63770e

Please sign in to comment.