assaf / zombie

Insanely fast, full-stack, headless browser testing using node.js
http://zombie.js.org/
MIT License
5.65k stars 518 forks source link

is it possible to pass callback into browser or evaluate a Promise from browsers script? #1144

Open kdong007 opened 6 years ago

kdong007 commented 6 years ago

for example, I have these codes inside html

<script  type="text/javascript">
    function test(){
        return new Promise(resolve=>
            setTimeout(resolve,1000)
        });
    }
}
</script>

then I do this in my main code let rt = browser.evaluate("test()");

I do get a promise object but rt.then() won't work.