Comments (11)
I agree, that would be nice to have. More information on running the tests with a local Webdriver server could be added to the Step 5 section, or maybe as a Step 5b or something.
from intern-tutorial.
@gaurav21r i put together a gist of how to run the intern tests locally... it shows how simple it is to setup selenium on a local machine https://gist.github.com/neonstalwart/6630466. it's no substitute for docs but it adds some code to support the response i gave to bill on SO.
actually... i just noticed that i already linked to that gist in an edit on that post 😃
from intern-tutorial.
I have been using this set of scripts to run Selenium locally:
https://github.com/sebv/sv-selenium
npm install -g sv-selenium
install_selenium
install_chromedriver
start_selenium_with_chromedriver
I found this project as a dev dependency of 'wd'. Not very robust, but it'll get you running and it's easy. neonstalwart's approach looks better for a more flexible approach.
Once you have Selenium running locally:
- point your config to it (the webdriver property)
- turn "useSauceConnect" to false
- set "capabilities" to whatever Selenium version you're running (the project linked above puts you on 2.35.0)
- update the environments section for browsers your local selenium actually supports. I used {browserName: 'chrome'}
Now clearly your local config is going to differ from the one you use with Sauce Labs. I'm still wondering what the recommended approach would be for someone like me who'e intending to run locally and then use Sauce for CI. My guess is you'll have to figure that out with whatever build system you happen to use.
from intern-tutorial.
Now clearly your local config is going to differ from the one you use with Sauce Labs. I'm still wondering what the recommended approach would be for someone like me who'e intending to run locally and then use Sauce for CI. My guess is you'll have to figure that out with whatever build system you happen to use.
since the configs are just AMD modules, they can depend on other modules. so, i'd be inclined to keep a hierarchy of configs.
// intern.base.js
define({
// The port on which the instrumenting proxy will listen
proxyPort: 9000,
// A fully qualified URL to the Intern proxy
proxyUrl: 'http://localhost:9000/',
// Default desired capabilities for all environments. Individual capabilities can be overridden by any of the
// specified browser environments in the `environments` array below as well. See
// https://code.google.com/p/selenium/wiki/DesiredCapabilities for standard Selenium capabilities and
// https://saucelabs.com/docs/additional-config#desired-capabilities for Sauce Labs capabilities.
// Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment
// automatically
capabilities: {
'selenium-version': '2.37.0',
'idle-timeout': 30
},
// Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce
// OnDemand. Options that will be permutated are browserName, version, platform, and platformVersion; any other
// capabilities options specified for an environment will be copied as-is
environments: [
{ browserName: 'internet explorer', version: '11', platform: 'Windows 8.1' },
{ browserName: 'internet explorer', version: '10', platform: 'Windows 8' },
{ browserName: 'internet explorer', version: '9', platform: 'Windows 7' },
{ browserName: 'firefox', version: '25', platform: [ 'OS X 10.6', 'Windows 7', 'Linux' ] },
{ browserName: 'chrome', version: '31', platform: 'Windows 7' },
{ browserName: 'chrome', version: '30', platform: 'Linux' },
{ browserName: 'chrome', version: '27', platform: 'OS X 10.8' },
{ browserName: 'safari', version: '6', platform: 'OS X 10.8' }
],
// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service
maxConcurrency: 3,
// Whether or not to start Sauce Connect before running tests
useSauceConnect: false,
// Connection information for the remote WebDriver service. If using Sauce Labs, keep your username and password
// in the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables unless you are sure you will NEVER be
// publishing this configuration file somewhere
webdriver: {
host: 'localhost',
port: 4444
},
// Configuration options for the module loader; any AMD configuration options supported by the Dojo loader can be
// used here
loader: {
// Packages that should be registered with the loader in each testing environment
packages: [ { name: 'intern-selftest', location: '.' } ],
map: { 'intern-selftest': { dojo: 'intern-selftest/node_modules/dojo' } }
},
// Non-functional test suite(s) to run in each browser
suites: [ 'intern-selftest/tests/all' ],
// Functional test suite(s) to run in each browser once non-functional tests are completed
functionalSuites: [ 'intern-selftest/tests/functional/basic' ],
// A regular expression matching URLs to files that should not be included in code coverage analysis
excludeInstrumentation: /^(?:tests|node_modules)\//
});
// intern.sauce.js
define([ './intern.base' ], function (baseConfig) {
baseConfig.useSauceConnect = true;
return baseConfig;
});
// intern.local.js
define([ './intern.base' ], function (baseConfig) {
baseConfig.capabilities['selenium-version'] = '2.35.0';
baseConfig.environments = [
{ browserName: 'firefox' },
{ browserName: 'safari' },
{ browserName: 'chrome' }
];
return baseConfig;
});
then you would just invoke intern with whichever config you needed. since there's really only 2 environments in this example, you might just make your default/base config be configured for sauce and then have the local one import that and make the necessary adjustments rather than have 3 configs.
NOTE: i should mention that i've been meaning to confirm that this approach actually works but haven't got around to trying it yet. i don't expect there would be any issues though. it works as expected
from intern-tutorial.
Yeah, that makes sense. I don't see any reason it wouldn't work either, it's just standard AMD.
from intern-tutorial.
I use webdriver-manager
and/or appium
(for iOS simulator testing) to start my selenium srvr locally.
webdriver-manager
is an executable that comes with angular protractor
: on github
from intern-tutorial.
An update to the above:
$ brew update
$ brew doctor
$ brew install selenium-server-standalone chromedriver
To run selenium:
$ java -jar /usr/local/opt/selenium-server-standalone/libexec/selenium-server-standalone-2.40.0.jar -p 4444
Then to run your tests:
$ node node_modules/intern/runner.js config=tests/intern.js
from intern-tutorial.
even with all of these config options, i am still getting attempts to connect to saucelabs instead of local selenium instance https://gist.github.com/lfender6445/9c6c5d31666c46799eee - any ideas?
from intern-tutorial.
change your tunnel - read about the NullTunnel on this page https://github.com/theintern/intern/wiki/Configuring-Intern
from intern-tutorial.
Good work on this thread. Why don't we add it to the main Docs?
from intern-tutorial.
Information in today’s user guide should be able to address questions about how to set up other kinds of servers or use other cloud hosting providers, so I will close this ticket.
from intern-tutorial.
Related Issues (20)
- Failure in dojo.js HOT 2
- Extra hello.js in the completed tutorial? HOT 1
- Comment on unit tests differs from the default HOT 2
- BrowsertStack tests fail out of the box HOT 5
- BrowserStack host needed in tunnelOptions? HOT 4
- README updates HOT 2
- Can't get tutorial to work: `Error: The tunnel reported: You provided an invalid key` HOT 1
- Links offline HOT 3
- intern-client error: missing required argument "config" HOT 2
- Error: "Unexpected token <" appears when setting up tutorial
- Update for Intern 4 HOT 3
- Tutorial - Visual Regression plugin
- Tutorial - a11y plugin
- Tutorial - Advanced Performance Testing
- How to use NullTunnel behind corporate proxy firewall? HOT 4
- Readme shows invalid function type passed to before block (functional tests) HOT 3
- Tutorial doesn't work with Intern 4.1.4 HOT 1
- Test run hangs with IE 11 + Browserstack
- Tutorial doesn't run on Node 10.15.3 / Windows HOT 2
- Tutorial run causes Error: listen EACCES: permission denied 0.0.0.0.9001 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intern-tutorial.