Each of my Nightwatch.js tests requires authentication in order to run and for the time being I can't make authentication to be done via cookies (of course if test fill in a username and password it logs in, but it takes time this way)
I have a working PHPSESSID (tested in Fiddler) cookie and trying to set it via nightwatch setCookie function like this:
browser
.setCookie({
name : "PHPSESSID",
value : "gfnpqlflvlrkd2asj18ja2ewrt",
path : "/admin", //(Optional)
domain : "example.com", //(Optional)
secure : true, //(Optional)
httpOnly : false // (Optional)
})
.url("www.example.com/admin")however www.example.com/admin redirects me back to www.example.com/login meaning authentication didn't pass.
Is there any solution?
--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/e96f08de-874f-4de3-8002-f0be3a85831a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
browser
.url("https://www.example.com/")
.setCookie({
name : "PHPSESSID",
value : "gfnpqlflvlrkd2asj18ja2ewrt",
path : "/admin", //(Optional)
domain : "example.com", //(Optional)
secure : true, //(Optional)
httpOnly : false // (Optional)
})
.url("https://www.example.com/admin")
.getCookie("PHPSESSID", function(result){ self.globals.cookieSet = result.value; });