Skip to content

Commit

Permalink
fix(cypress): update command to access super date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Antonio Ghiani committed Sep 3, 2024
1 parent bac95ea commit 512d43a
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}');
});
Expand Down

0 comments on commit 512d43a

Please sign in to comment.