I'm running a javascript test that checks some remote file details using the nodejs package ssh2.
My current code works Ok, and the tests completes in a matter of seconds;
var Client = require('ssh2').Client;
var conn = new Client();
conn.on('ready', function() {
console.log('Client :: ready');
conn.sftp(function(err, sftp) {
if (err) throw err;
sftp.readdir('parkersreviewcontent/', function(err, list) {
if (err) throw err;
.... run some assertion...
conn.end();
});
});
})
.connect({
host: '******',
port: **,
user: '****',
password: '****',
});
The next step is for me to run this test as part of my nightwatchjs test suite, using a tag.
var Client = require('ssh2').Client;
var conn = new Client();
module.exports = {
'@tags': ['bugs']
};
conn.on('ready', function() {
console.log('Client :: ready');
conn.sftp(function(err, sftp) {
if (err) throw err;
sftp.readdir('parkersreviewcontent/', function(err, list) {
if (err) throw err;
.... run some assertion...
conn.end();
});
});
})
.connect({
host: '******',
port: **,
user: '****',
password: '****',
});
However, when I now run the test (with the tag added) via the tag it takes about 5 minutes to run (i.e. for the command prompt to be available again, the actual test again takes 1-2 seconds to perform).
Have I placed the tag command in the wrong place in the script?
Or, is there a command that I need to add that will 'close' the test once its run when using the tag?
Any help would be greatly appreciated. Thanks.