javascript - Setting cookies for internjs functional tests -


i'm trying set cookie intern functional test, cookie data doesn't seem available on page. here's setup:

registersuite(function() {     'test': function() {         return this.remote             .get(require.tourl("index.html")            .setfindtimeout(5000)            .setcookie({name: "foo", value: "bar"})            .then(function() {               //... test here ...            });     } }); 

when accessing document.cookie inside index.html, there no data. tips on doing wrong?

update:

i haven't solved problem, figured out need call setcookie() before get(). way i'm hacking around call get() on noop url, , calling setcookie()

return this.remote         .get('/')        .setcookie({name: "foo", value: "bar"})        .get(require.tourl("index.html")        .setfindtimeout(5000)        .setcookie({name: "foo", value: "bar"})        .then(function() {           //... test here ...        }); 

it seem did not include in sample code setup, teardown/after, beforeeach or aftereach. recommend making sure functionality works @ before evaluating cookie expect create.

i not terribly familiar intern.js believe read tests test , once completed remove information test next test can performed. so, maybe missing when cookie in existence , when test completed gets destroyed.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -