Taiko: Wait For Events in a click api

814 views Asked by At

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.

1

There are 1 answers

0
par On

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'.