Lieutenant Dan
Lieutenant Dan

Reputation: 8264

modulate tests, sequentially, with nightwatch.js

How can I thread functions, to run sequentially, threading on top of each other (or modulate, somehow, to make smaller tests).

For instance, I'm using nightwatch.js to test a web application - it requires a series of click functions and event listeners to get through to different screens - it works when I have everything in one large function; but when I try to break it multiple functions, per screen or module for instance; the thread is lost (i.e. it doesn't get past login screen), so alas fails. Any suggestions how to achieve, or modulate?

i.e.

this.TeamPanel = function(browser) {
        browser
        // Start
        Errors.checkForErrors(browser);

        browser.end();
};    

this.postTeamPanel = function(browser) {
        browser
        // I want this function to execute where the previous left off, not start over
        Errors.checkForErrors(browser);

        browser.end();
};    

Upvotes: 0

Views: 92

Answers (1)

Luca
Luca

Reputation: 4273

I think you should not call browser.end() until you want to close your test.

Upvotes: 1

Related Questions