jvolker / miq-nz-booking-tools

Tools to help booking a spot in New Zealand Managed Isolation and Quarantine. Automatically refreshes, checks and fills forms in the website to find and book the rare spots.
MIT License
83 stars 35 forks source link

Calendar Widget is no longer a ._flatpickr #81

Open Yokai opened 3 years ago

Yokai commented 3 years ago

Describe the bug

Calendar Widget is now not a flatpickr. An inspect on the element shows

`<div id="accommodation-calendar" data-max-date="2021-11-30" data-end-date="2021-11-30" data-arrival-dates="" class="mi4-input" readonly="readonly">
</div>`

And then the internals seem to be scripted into place - disabling Javascript in the debugger in Chrome kills the calendar completely.

This means that the tool no longer works (but thanks for the effort - this is not a criticism at all!!) ...

I'd dig in more but I am not a node dev and am a little out of my depth

Here's the output from iterm

npm start

> miq-nz-booking-assistance@0.10.2 start
> npx run-func miq-assistance.js start

Welcome to the MIQ Booking Assistance!
A new browser window should appear. Please navigate to "Secure your allocation" page.
Found "Secure your allocation" page! Wait for beep sound, confirm the date selected is what you want, then do the reCAPTCHA and click 'next' to continue booking.
Checked MIQ: 1 times, last checked at: 7/25/2021, 9:59:10 AM
/miq-nz-booking-tools/MIQ-Booking-Assistance/miq-assistance.js:112
    await page.waitForSelector('#accommodation-calendar', {visible: true});
               ^

TypeError: Cannot read property 'waitForSelector' of undefined
    at prepareAndCheckPage (/miq-nz-booking-tools/MIQ-Booking-Assistance/miq-assistance.js:112:16)
    at prepareAndCheckPage (/miq-nz-booking-tools/MIQ-Booking-Assistance/miq-assistance.js:133:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /miq-nz-booking-tools/MIQ-Booking-Assistance/miq-assistance.js:84:13

Your system (please complete the following information):

alexDrinkwater commented 3 years ago

Hi @Yokai, I think something else is going on with your run. I still see _flatpickr on the calendar element: image

Notice that your error says "Cannot read property 'waitForSelector' of undefined", that means that "page" is undefined. Make sure you run npm i as we have updated the dependencies and then try again. I just confirmed everything was running fine with the v0.10.2 for me.