I have a really simple line in a test that calls execute script like this:
puts page.execute_script("return somefunction();").to_i.inspect
And in javascript I have a function like this:
function somefunction(){
console.log("test");
return 999;
}
The 'test' from the console log is getting logged out so it is running however...
Looking at the logs when running the test, the execute_script returns 0 not 999, so in rspec I can't get at the return value from the function, how do I make page.execute_script return that value from that function?