Browserstack integration
Browserstack project configuration
- Create a new account in Browserstack: https://www.browserstack.com/
- Login and visit the website https://www.browserstack.com/accounts/settings
- Scroll down to the
Automationsection and copy:
UsernameAccess Key
- Add a new
browserstacksection to thekakunin.conf.jsfile in the repository. This is an example of a configuration for IE8 on Windows 7.
browserstack: {
seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
defaultPort: 45691,
capabilities: {
'browserstack.user': 'example-user',
'browserstack.key': 'example-key',
'browserstack.local': true,
nativeEvents: true,
'browserstack.ie.driver': '3.14.0',
'browserstack.selenium_version': '3.14.0',
browserName: 'IE',
browser_version: '8.0',
}
},
Set
'browserstack.user'to theUsernamevalue that you copied from theAutomationsectionSet
'browserstack.key'to theAccess Keyvalue that you copied from theAutomationsectionVisit the link https://www.browserstack.com/automate/capabilities if you want to find more capabilities for your project!.
Run tests in Browserstack
Runs the application with the capabilities set in kakunin.conf.js file through the command line:
npm run kakunin -- --browserstack
Keep in mind that all capabilities that you set via CLI will be ignored!
For example, npm run kakunin -- --safari --browserstack will ignore the safari part.
Only --browserstack matters in case of running tests in Browserstack.
Example kakunin.conf.js configuration file
This is an example configuration for Internet Explorer 8 on Windows 7.
module.exports = {
browserWidth: 1600,
browserHeight: 900,
timeout: 60,
elementsVisibilityTimeout: 5,
waitForPageTimeout: 5,
downloadTimeout: 30,
reports: '/reports',
downloads: '/downloads',
data: '/data',
features: ['/features'],
pages: ['/pages'],
matchers: ['/matchers'],
generators: ['/generators'],
form_handlers: ['/form_handlers'],
step_definitions: ['/step_definitions'],
comparators: ['/comparators'],
dictionaries: ['/dictionaries'],
transformers: ['/transformers'],
regexes: ['/regexes'],
hooks: ['/hooks'],
clearEmailInboxBeforeTests: false,
clearCookiesAfterScenario: true,
clearLocalStorageAfterScenario: true,
email: null,
headless: true,
noGpu: true,
type: 'otherWeb',
baseUrl: 'http://localhost:8080',
apiUrl: 'http://localhost:8080/',
browserstack: {
seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
defaultPort: 45691,
capabilities: {
'browserstack.user': 'example-user',
'browserstack.key': 'example-key',
'browserstack.local': true,
nativeEvents: true,
'browserstack.ie.driver': '3.14.0',
'browserstack.selenium_version': '3.14.0',
browserName: 'IE',
browser_version: '8.0',
}
},
};