Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Start a Sauce Connect tunnel using Nightwatch? #92

Open
pnulu002 opened this issue Jul 2, 2019 · 4 comments
Open

How to Start a Sauce Connect tunnel using Nightwatch? #92

pnulu002 opened this issue Jul 2, 2019 · 4 comments

Comments

@pnulu002
Copy link

pnulu002 commented Jul 2, 2019

We need to run some automated tests on sites that are internal . We were able to run the tests manually using command line. "bin/sc -u -k -B all"

But how do we automate the starting and Stopping the tunnel ?

@nelsonic
Copy link
Member

nelsonic commented Jul 2, 2019

@pnulu002 this sounds like a question for Saucelabs; the creators of Sauce Connect.
Please consider searching https://support.saucelabs.com or opening a question.

@pnulu002
Copy link
Author

pnulu002 commented Jul 2, 2019

@nelsonic :Seems like Sauce labs does not have any such option.They asked us to reach out to Nightwatch .

@nelsonic
Copy link
Member

nelsonic commented Jul 3, 2019

@pnulu002 that's Odd ...
in which case please consider opening the issue in: https://github.com/nightwatchjs/nightwatch/issues

@pnulu002
Copy link
Author

pnulu002 commented Jul 5, 2019

I was able to start the Tunnel with in Sauce using this piece of code under nightwatch.conf.js , before function. But some how the tests are starting even before the tunnel gets connected(normally it takes around 20 secs for the tunnel to get connected after it actually starts) and hence the tests are not using the tunnel. Is there any way to hold the tests untill the Tunnel is actually connected and ready for Test ?

const before = () => {
const sauceConnectLauncher = require('sauce-connect-launcher');
sauceConnectLauncher({
username: ${process.env.SAUCE_USERNAME},
accessKey: ${process.env.SAUCE_ACCESS_KEY},
}, (err, sauceConnectProcess) => {
if (err) {
console.error(err.message);
return;
}
console.log('Sauce Connect ready');
});
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants