Codeceptjs: session data exists after rerun tests

Created on 2 Dec 2015  路  11Comments  路  Source: codeceptjs/CodeceptJS

Hi,

there must be an issue with terminating the data of the used session. If I run my tests once and rerun them, the second run has data of the first run. How can I disable this behavior or is it a bug?

I am using webdriverio helper with phantomjs.

bug

Most helpful comment

Any progress regarding Nightmare integration? And, is it still in the roadmap? Thanks.

All 11 comments

Thanks. First real bug! I think cookies should be cleaned in _after hook of webdriver to ensure session is not saved.

Hi,

I am unsure if this is a bug in codeceptjs or in webdriverio.
Because you even can't clear the session storage without getting errors.

clearStorage(){
  return this.browser.sessionStorage('DELETE');
}

I will take a look and do what I can with it...

I've stumbled on the same issue. Clearing localStorage, sessionStorage or cookies has no effect using Phantom JS with Webdriver IO.

class ClearUser extends Helper {
    clearAuthentication() {
        let client = this.helpers['WebDriverIO'].browser;
        return client
            .localStorage('DELETE')
            .sessionStorage('DELETE')
            .deleteCookie();
    }
}

Right now I can recommend not to use phantomjs...
Anyway I will take a look when I have time

That's unfortunate, but there's cases where the tests can't run in a browser with a GUI so phantom js is required. I'll keep looking for a solution.

The issue of Phantom Js is related to Ghost Driver. See https://github.com/detro/ghostdriver/issues/170 -- it's been around since 2013.

I plan to implement Nightmare helper in one of next releases.
I hope it will work better than PhantomJS

Any progress regarding Nightmare integration? And, is it still in the roadmap? Thanks.

Nightmare is implemented, webdriverio has its new versions so I think this can be closed

Was this page helpful?
0 / 5 - 0 ratings