0

In click API in taiko there is an option to provide Wait For Events

Example:

click('Get Started', {waitForEvents: ['DOMContentLoaded']})

I am confused about whether it will wait for the page to load after clicking on click API or before clicking.

ADyson
  • 57,178
  • 14
  • 51
  • 63
  • You mean this, perhaps: https://docs.taiko.dev/api/click/ ? If not then please clarify. Don't assume we know what random product you are talking about. – ADyson Jun 18 '21 at 15:23
  • Anyway it looks like it would tell the framework to wait till the DOM is loaded before doing the click. Having the page load _after_ clicking doesn't sound like it makes a lot of sense. – ADyson Jun 18 '21 at 15:24
  • Thankyou ADyson. I had verified in the taiko site and didn't get any info regarding this. – Ravikiran K Jun 18 '21 at 15:35
  • Well then if you're unclear the next thing to do might be to test it and see what it does. But that's my interpretation of the docs. Or you can raise a query with the people who actually made it, via their github: https://github.com/getgauge/taiko/blob/master/docs/CONTRIBUTING.md . That's better than asking people here, most of whom have probably never heard of this product, never mind used it, what they think. – ADyson Jun 18 '21 at 15:45
  • I had tested it and it was not working as expected. So, I had asked in this forum. Anyone, who had worked in this library might know this answer. – Ravikiran K Jun 18 '21 at 16:49
  • They might. But then you didn't even actually tell us what the library was other than just a random name (which I had to assume was a library, not some other type of product), I had to go and Google it to find the info. But you're far more likely to get a direct answer from the people who actually coded it and wrote the documentation. Also what behaviour did you expect? You didn't make that clear either... – ADyson Jun 18 '21 at 17:05

1 Answers1

0

waitForEvent option added to any action in Taiko will wait for them after performing the action. So for click('Get Started', {waitForEvents: ['DOMContentLoaded']}) taiko will wait for 'DOMContentLoaded' event from page after clicking 'Get Started'.

par
  • 817
  • 8
  • 21