QualiT
QualiT

Reputation: 1955

Nightwatch-friendly command or javascript function to reload a page

I have been trying the various suggestions for reloading a page.

Reload a page manually

With Nightwatch magellan testarmada. The error I see is "TypeError: Cannot read property 'apply' of undefined"

Has anyone else run into this problem/ solved it?

EDIT: client.navigate().refresh(); does not work.

Upvotes: 2

Views: 7192

Answers (2)

Akshay Gupta
Akshay Gupta

Reputation: 11

Refrain yourself from using navigate here. Use the mentioned code below:

return client.refresh();

Upvotes: 0

QualiT
QualiT

Reputation: 1955

Embarrassingly obvious, once I fixed it. I was calling it in an external function but the problem amounted to this:

module.exports = new Test({

    '@disabled': false,

    "test page that needs a reload" : function(client){
    client
        // set url
        .url(this.url)
        .pause(this.timeout)
        .navigate().refresh() // does not work
        .refresh() // does work. 

    },


});

Upvotes: 6

Related Questions