Skip to content

Commit

Permalink
[Cypress] Update queries for text assertions to exclude new hidden co…
Browse files Browse the repository at this point in the history
…py characters
  • Loading branch information
cee-chen committed Sep 26, 2024
1 parent 362c4c4 commit fb7f31d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ export const getRunningProcesses = (command: string): Cypress.Chainable<number>
.getByTestSubj('processesOutput-processListTable', { timeout: 120000 })
.findByTestSubj('processesOutput-command')
.contains(command)
.parents('td')
.siblings('td')
.eq(1)
.find('span')
.then((span) => {
.parents('tr')
.findByTestSubj('processesOutput-pid')
.find('.euiTableCellContent')
.then((cellContent) => {
// get pid
return Number(span.text());
return Number(cellContent.text());
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('All hosts table', { tags: ['@ess'] }, () => {
kqlSearch('host.name: "siem-kibana" {enter}');

cy.get('[data-test-subj="tableHeaderCell_node.risk_4"]').should('exist');
cy.get(`${TABLE_CELL} .euiTableCellContent`).eq(4).should('have.text', 'Low');
cy.get(TABLE_CELL).eq(4).should('have.text', 'Low');
});
});

Expand All @@ -55,7 +55,7 @@ describe('All hosts table', { tags: ['@ess'] }, () => {
kqlSearch('host.name: "siem-kibana" {enter}');

cy.get('[data-test-subj="tableHeaderCell_node.risk_4"]').should('exist');
cy.get(`${TABLE_CELL} .euiTableCellContent`).eq(4).should('have.text', 'Critical');
cy.get(TABLE_CELL).eq(4).should('have.text', 'Critical');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const OVERVIEW_STATUS = '[data-test-subj="eventDetails"] [data-test-subj=
export const EVENT_DETAILS_ALERT_STATUS_POPOVER =
'[data-test-subj="event-details-alertStatusPopover"]';

export const TABLE_CELL = '.euiTableRowCell';
export const TABLE_CELL = '.euiTableRowCell .euiTableCellContent';

export const CELL_EXPAND_VALUE = '[data-test-subj="euiDataGridCellExpandButton"]';

Expand Down

0 comments on commit fb7f31d

Please sign in to comment.