-
Notifications
You must be signed in to change notification settings - Fork 65
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
fix #152 - modify browserstack config file path to work #222
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -63,4 +63,38 @@ describe('Browserstack capabilities', function () { | |||||||||||||||||||||||
'browserstack.networkProfile': '4g-lte-lossy' | ||||||||||||||||||||||||
}); | ||||||||||||||||||||||||
}); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
it('Should add additional capabilities when both config file and environment variables used', () => { | ||||||||||||||||||||||||
process.env['BROWSERSTACK_BUILD_ID'] = 'build-1'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_PROJECT_NAME'] = 'project-1'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_DISPLAY_RESOLUTION'] = '1024x768'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_TEST_RUN_NAME'] = 'Testcafe test run 1'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_DEBUG'] = 'false'; //env var should take precedence | ||||||||||||||||||||||||
process.env['BROWSERSTACK_CONSOLE'] = 'errors'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_NETWORK_LOGS'] = 'true'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_VIDEO'] = 'true'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_TIMEZONE'] = 'Asia/Taipei'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_GEO_LOCATION'] = 'ZA'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_CUSTOM_NETWORK'] = '"1000", "1000", "100", "1"'; | ||||||||||||||||||||||||
process.env['BROWSERSTACK_NETWORK_PROFILE'] = '4g-lte-lossy'; | ||||||||||||||||||||||||
Comment on lines
+68
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the test uses a configuration file and environment variables, it is not necessary to duplicate all variables present in the configuration file. It is sufficient to set just one variable that differs from the one in the configuration. |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
process.env.BROWSERSTACK_CAPABILITIES_CONFIG_PATH = require.resolve('./data/capabilities-config.json'); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
const capabilities = browserStackProvider._getAdditionalCapabilities(); | ||||||||||||||||||||||||
Comment on lines
+81
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current implementation sets an absolute path, but we need to test the functionality of When a relative path is passed to
Suggested change
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
expect(capabilities).to.deep.equal({ | ||||||||||||||||||||||||
'build': 'build-1', | ||||||||||||||||||||||||
'project': 'project-1', | ||||||||||||||||||||||||
'resolution': '1024x768', | ||||||||||||||||||||||||
'name': 'Testcafe test run 1', | ||||||||||||||||||||||||
'browserstack.debug': 'false', //env var should take precedence | ||||||||||||||||||||||||
'browserstack.console': 'errors', | ||||||||||||||||||||||||
'browserstack.networkLogs': 'true', | ||||||||||||||||||||||||
'browserstack.video': 'true', | ||||||||||||||||||||||||
'browserstack.timezone': 'Asia/Taipei', | ||||||||||||||||||||||||
'browserstack.geoLocation': 'ZA', | ||||||||||||||||||||||||
'browserstack.customNetwork': '"1000", "1000", "100", "1"', | ||||||||||||||||||||||||
'browserstack.networkProfile': '4g-lte-lossy' | ||||||||||||||||||||||||
}); | ||||||||||||||||||||||||
}); | ||||||||||||||||||||||||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
path.resolve
already returns an absolute path, converting it to a relative path is unnecessary.