Reputation: 1207
Trying to test some user permissions here, and i'm having trouble logging out after each test...
afterEach: function () {
return this.remote
.clearLocalStorage()
// .clearCookies();
},
nextTest: function () {
return this.remote.get("/")...
This will only work if I clearCookies as well, but I shouldn't need to clear cookies (manually executing localStorage.clear()
and reloading works). I would expect return this.remote.clearLocalStorage();
to suffice, but on the following test I get redirected to my dashboard.
Upvotes: 0
Views: 73
Reputation: 3363
clearLocalStorage
simply sends a DELETE request to the WebDriver server's local_storage
endpoint, so the driver is what actually implements the clearing behavior. It's possible that different WebDrivers handle clearing local storage in different ways, but given that local storage and cookie storage are not the same, clearing one shouldn't necessarily affect the other.
Upvotes: 0