featurist / browser-monkey

Reliable DOM testing
https://browsermonkey.org
53 stars 6 forks source link

iframe script loading #70

Open awyl opened 7 years ago

awyl commented 7 years ago

Hi,

Is there a way to wait for scripts loading done before proceeding to testing for iframe mount?

My pages currently either using async script loading or scripts are at the bottom. The tests are either incorrectly passing or failed if a test clicks on a button bind with js event. It is because the scripts aren't loaded yet.

Thanks!

dereke commented 7 years ago

We don't currently have a way of knowing when the page has loaded in the iframe though that may be something worth looking into.

In the meantime a less than ideal solution would be to check that an element or text exists before proceeding with your test. I'll leave this open to remind me to look into it at some point.

awyl commented 7 years ago

I was looking into it. I found this issue karma-runner/karma-jasmine#77

The suggested workaround works. The tests will run after dom ready.