Test on Internal Networks
Run Intern tests on your privately hosted websites using BrowserStack Automate
BrowserStack enables you to run your Intern automated tests on your internal development environments, on localhost, and from behind a corporate firewall. This feature is called “Local Testing”.
Local Testing establishes a secure connection between your machine and the BrowserStack cloud. Once you set up Local Testing, all URLs work out of the box, including HTTPS URLs and those behind a proxy or firewall.
Configuring your Intern tests for Local Testing takes just four steps:
-
Download and run the BrowserStack Local binary:
npm install browserstack-local
-
Next, you need to update your Intern config file,
intern-browserstack/conf/local.conf.js
(in sample repo), and set thebrowserstack.local
capability totrue
:define({ proxyPort: 9000, capabilities: { "browserstack.local": true, name: 'Bstack-[Intern] Local Test', fixSessionCapabilities: false }, environments: [ { browser: 'Chrome' }, ], tunnel: 'BrowserStackTunnel', tunnelOptions: { verbose: true, username: 'YOUR_USERNAME', accessKey: 'YOUR_ACCESS_KEY' } });
-
Run a sample test case to check whether the Local test connection has been setup properly. You can use the following sample test case, which can be found in the repo under
intern-browserstack/tests/local_test.js
directory:define([ 'intern!object', 'intern/chai!assert', 'require' ], function (registerSuite, assert, require, registry) { registerSuite({ name: 'BrowserStack Local Testing', 'can check tunnel working': function () { return this.remote .get(require.toUrl('http://localhost:9000')) .getPageSource() .then(function(title){ assert.match(title, /404 Not Found/i) }); } }); });
-
You can now run your Intern test using BrowserStack Local with the following command:
npm run local
Next steps
Once you have successfully run your first test on BrowserStack, you might want to explore the following:
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!