@nevantan had a good idea - let's make the eval code snippet into an Actions.js function. This will allow us to change our method in future if we ever need to.
Format of Eval code snippet
await t
.eval(() => new Promise(resolve => setInterval(function() {
if(jQuery('#name-of-element').length > 0) resolve();
}, 500)));
[ ] Come up with a good name for the generic function
[ ] Add eval code snippet to Actions.js as a generic function we can call from our tests
[ ] Update any tests in master so they use the generic function rather than the eval code snippet
@nevantan had a good idea - let's make the eval code snippet into an Actions.js function. This will allow us to change our method in future if we ever need to.
Format of Eval code snippet