TobseF / impf-bot

💉🤖 Bot for the German "ImpfterminService - 116117"
The Unlicense
151 stars 41 forks source link

fillUserData(userData) #4

Closed bluefish007 closed 3 years ago

bluefish007 commented 3 years ago

I have a question about booking an appointment:

"fillUserData(userData)" from ImpfBot to ImpfPortal but where did the bot get my userData from? Can I set it somewhere? I have not found anything :/

TobseF commented 3 years ago

As for now the bot uses the "userData" from the src/main/resources/config.properties file which contains:

personAge = 42
email = impfMePlease@lasthope.de
mobileNumber = 152123123123

The last step isn't automated, so the "optional" path is the default. You get the notification and have 10min left to choose the right one and enter your private user data. Sorry for the misleading diagram. For me this was all I needed for my "Home Office" setup. On the booking page it's also possible to enter any data. So I waited for a new slot and entered the data of the person I wanted to book for. So no multi user booking configuration was needed.

But to automate the last step would be very easy. I also saved the static html pages. So if anybody is interested in adding this step, I can make them public.

Bergdoc commented 3 years ago

Could you share the files @TobseF ? I guess it would be nice to add a feature which books the appointments automatically after ~9 mins without user input.

TobseF commented 3 years ago

Hey @Bergdoc, of course... last but not least... I pushed the page file I used to write the matchers and I wrote the first test which uses such a file: https://github.com/TobseF/impf-bot/blob/master/src/test/kotlin/de/tfr/impf/page/SmsVerificationPageTest.kt

It's a shame that I didn't wrote the tests before... I was young and needed that vaccine😅

Bergdoc commented 3 years ago

Thank you @TobseF for sharing the files! I just started to work on it and I somehow struggle to test it, since I have like no/ limited experience with web automation/ selenium/ kotlin/ HTML ... How do I build the test you provided? Would it possible to set a test up the same way you did to test if the whole procedure its working? https://github.com/Bergdoc/impf-bot/commit/f20c63a2146df116d08c58132dd597baa597d7b4