Created
November 18, 2014 22:23
-
-
Save shuynh/0573b01babcbe0b57ca9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var require = patchRequire(require), | |
config = require('../config.js'), | |
utils = require('../utils/utils'), | |
x = require('casper').selectXPath; | |
function getCookie(name) { | |
function escape(s) { return s.replace(/([.*+?\^${}()|\[\]\/\\])/g, '\\$1'); }; | |
var match = document.cookie.match(RegExp('(?:^|;\\s*)' + escape(name) + '=([^;]*)')); | |
return match ? match[1] : null; | |
} | |
casper.test.begin('COOKIE COOKIE COOKIE COOKIE', function(test) { | |
casper.start('http://vimeo.com/', function() { | |
this.echo(getCookie("vuid")); | |
}); | |
casper.run(function() { | |
this.test.done(); | |
}); | |
casper.then(function() { | |
this.exit(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment