Choosing longest route on Google maps #22395
Unanswered
srdjanmutlak
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Did anyone try to test google maps? The task is: choose two destinations, choose (radio button) to avoid highways and then choose the longest route, click on details, confirm that distance and time is visible.
Example: https://imgur.com/a/XA5nabI
The problem is, routes are changing from time to time, km are changing, distance is changing. Sometimes longest route is in the first place, sometimes it's in second place, and sometimes it's in third.
I know how to extract the distance and compare it to find the longest route (solution for that is here: https://imgur.com/a/5Qy5MKt),
but that is the fixed solution if the route is always in the first place.
How could i choose the route if it changes places? And how to click on it later on and how to make sure that proper distance and time is visible?
Any ideas?
P.S. I managed to solve this by using three different tests and saying that only one will pass and two others will fail:
https://github.com/srdjanmutlak/srdjanmutlak.github.io/blob/main/Cypress/testingGoogleMapsBackUp.spec.js
, but I don't know if there is more simpler and elegant solution than this.
Solution for catching the longest route if its in the first section:
Example from google maps:
Beta Was this translation helpful? Give feedback.
All reactions