This is what I came up with:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
So, what is going on?
I set the script timeout to the timeout I set in Capybara. I found, that otherwise there is a timeout of 2ms, which was not enough for me.
Is there a better solution?
I don’t know. I googled a bit and found none - so I came up with this solution. If there is a better one, I would be really glad. The code is not really obvious, has a lot of technical details and is tied quite strongly to the selenium bridge. I cannot switch to another driver, say poltergeist.
Do you have a better solution? Tell me!
Why do we need to do that at all?
That’s not possible for us. We are building a smoke test. The event is coming from a different system, which is not under our control. In theory, I could try to get the other guys to change something in their page. But that’s not something to be done easily and fast.