diff --git a/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/support/commands.ts b/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/support/commands.ts index ba1d8659e916..58a2ad006c0a 100644 --- a/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/support/commands.ts +++ b/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/support/commands.ts @@ -88,18 +88,14 @@ Cypress.Commands.add('selectAbsoluteTimeRange', (start: string, end: string) => const format = 'MMM D, YYYY @ HH:mm:ss.SSS'; cy.getByTestSubj('superDatePickerstartDatePopoverButton').click(); - cy.contains('Start date') - .nextAll() - .find('[data-test-subj="superDatePickerAbsoluteDateInput"]') - .clear({ force: true }) + cy.getByTestSubj('superDatePickerAbsoluteDateInput').clear({ force: true }); + cy.getByTestSubj('superDatePickerAbsoluteDateInput') .type(moment(start).format(format), { force: true }) .type('{enter}'); cy.getByTestSubj('superDatePickerendDatePopoverButton').click(); - cy.contains('End date') - .nextAll() - .find('[data-test-subj="superDatePickerAbsoluteDateInput"]') - .clear({ force: true }) + cy.getByTestSubj('superDatePickerAbsoluteDateInput').clear({ force: true }); + cy.getByTestSubj('superDatePickerAbsoluteDateInput') .type(moment(end).format(format), { force: true }) .type('{enter}'); });