I am having trouble selecting the datepicker button to open the calendar, so I can select a date.
The codegen runner suggests using the following code:
await page.getByRole('button', { name: 'Choose date, selected date is Feb 14, 2023' }).click();
That will only work if I know the previously selected date.
I can use regex like
await page.getByRole("button", { name: /Choose date, selected date is/ }).click();
but that will break if there is more than one datepicker on the page.
I would like to either tab onto the button, and press enter, like
await page.getByLabel("Start date").press("Tab").press("Enter");
, Or if I could get the button inside that datepicker, maybe like
await page.getByLabel("Start date").getByRole("button").click();
but neither of those work, is there a way to do that?
Any other ideas?