Last active
November 12, 2019 11:24
-
-
Save Milo24s1/cf2b3c357510abf3f1887576d9d7ba62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sJavascript = <<<END_JAVASCRIPT | |
var callback = arguments[arguments.length-1], // webdriver async script callback | |
async function getUserInfo(){ | |
var result = await fetch('https://api.github.com/users/milo24s1',{ | |
credentials: "same-origin"}).then(response=>response.json()).then(text => text); | |
console.log(result); | |
callback(result); | |
} | |
getUserInfo(); | |
END_JAVASCRIPT; | |
$output=$this->webdriver->executeAsyncScript($sJavascript,array()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment