Intern.js ERROR Connection ECONNREFUSED/ECONNRESET for Functional Test

46 views
Skip to first unread message

Wong Hiu Lan

unread,
Nov 17, 2015, 12:11:11 PM11/17/15
to nodejs

I have this piece of code that is running on Intern.js and is giving me errors such as connect ECONNREFUSED and write ECONNRESET.

        var self = this;

        return this.remote
            .setFindTimeout(6000)
            .findByXpath(subpageXpath).click().end()
            .then(function() {
                return Promise.all(expect.map(function(element) {
                    return self.remote
                        .findByXpath(element['xpath']).getVisibleText()
                        .then(function(text) {
                            assert.equal(text, element['expect']);
                            console.log('check_cols: ' + text);
                            return true;
                        });
                }));
            });

I have no clue why this happens. It might have something to do with the var self = this, but I don't know what I am doing wrong, why the error happens, and how to fix it. The reason I assign this to self is because I wasn't able to access this.remote inside the inner block. I would really appreciate some insight on the issue. Thanks beforehand.

Reply all
Reply to author
Forward
0 new messages