Created
October 2, 2015 14:45
-
-
Save selftaught/8d490d5365920763e713 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
browser.addCommand('get_sessid_from_url', function (c) { | |
return browser.url().then(function(res) { | |
return res.value.match(/^https:\/\/(\d+)\./)[1]; | |
}); | |
}); | |
// Usage | |
it('navigate to cgi/wordpress_tools', function*() { | |
sess_id = yield browser.get_sessid_from_url(); | |
console.log(sess_id); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment