You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

karma.conf.saucelabs.cjs 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // Karma configuration
  2. // https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
  3. // TODO: remove dotenv after local test
  4. // require('dotenv').config()
  5. const karmaCommon = require('./karma.conf.common.cjs')
  6. const SauceLabsLaunchers = {
  7. /** Real mobile devices are not available
  8. * Your account does not have access to Android devices.
  9. * Please contact sales@saucelabs.com to add this feature to your account. */
  10. /* sl_android_chrome: {
  11. base: 'SauceLabs',
  12. appiumVersion: '1.5.3',
  13. deviceName: 'Samsung Galaxy S7 Device',
  14. deviceOrientation: 'portrait',
  15. browserName: 'Chrome',
  16. platformVersion: '6.0',
  17. platformName: 'Android'
  18. }, */
  19. /* sl_android: {
  20. base: 'SauceLabs',
  21. browserName: 'Android',
  22. deviceName: 'Android Emulator',
  23. deviceOrientation: 'portrait'
  24. }, */
  25. SL_firefox_latest: {
  26. base: 'SauceLabs',
  27. browserName: 'firefox',
  28. version: 'latest'
  29. },
  30. SL_chrome_latest: {
  31. base: 'SauceLabs',
  32. browserName: 'chrome',
  33. version: 'latest'
  34. },
  35. SL_InternetExplorer: {
  36. base: 'SauceLabs',
  37. browserName: 'internet explorer',
  38. version: '11.0'
  39. } /*
  40. sl_windows_edge: {
  41. base: 'SauceLabs',
  42. browserName: 'MicrosoftEdge',
  43. version: 'latest',
  44. platform: 'Windows 10'
  45. },
  46. sl_macos_safari: {
  47. base: 'SauceLabs',
  48. browserName: 'safari',
  49. platform: 'macOS 10.13',
  50. version: '12.0',
  51. recordVideo: true,
  52. recordScreenshots: true,
  53. screenResolution: '1024x768'
  54. } */ /*,
  55. sl_macos_iphone: {
  56. base: 'SauceLabs',
  57. browserName: 'Safari',
  58. deviceName: 'iPhone SE Simulator',
  59. deviceOrientation: 'portrait',
  60. platformVersion: '10.2',
  61. platformName: 'iOS'
  62. }
  63. 'SL_Chrome': {
  64. base: 'SauceLabs',
  65. browserName: 'chrome',
  66. version: '48.0',
  67. platform: 'Linux'
  68. },
  69. 'SL_Firefox': {
  70. base: 'SauceLabs',
  71. browserName: 'firefox',
  72. version: '50.0',
  73. platform: 'Windows 10'
  74. },
  75. 'SL_Safari': {
  76. base: 'SauceLabs',
  77. browserName: 'safari',
  78. platform: 'OS X 10.11',
  79. version: '10.0'
  80. } */
  81. }
  82. module.exports = function (config) {
  83. if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
  84. console.error(
  85. 'SAUCE_USERNAME and SAUCE_ACCESS_KEY must be provided as environment variables.'
  86. )
  87. console.warn('Aborting Sauce Labs test')
  88. process.exit(1)
  89. }
  90. const settings = Object.assign(karmaCommon(config), {
  91. // Concurrency level
  92. // how many browser should be started simultaneous
  93. // Saucelabs allow up to 5 concurrent sessions on the free open source tier.
  94. concurrency: 5,
  95. // this specifies which plugins karma should load
  96. // by default all karma plugins, starting with `karma-` will load
  97. // so if you are really puzzled why something isn't working, then comment
  98. // out plugins: [] - it's here to make karma load faster
  99. // get possible karma plugins by `ls node_modules | grep 'karma-*'`
  100. plugins: ['karma-jasmine', 'karma-sauce-launcher'],
  101. // logLevel: config.LOG_DEBUG,
  102. // test results reporter to use
  103. // possible values: 'dots', 'progress'
  104. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  105. reporters: ['dots', 'saucelabs'],
  106. customLaunchers: SauceLabsLaunchers,
  107. // start these browsers
  108. browsers: Object.keys(SauceLabsLaunchers),
  109. sauceLabs: {
  110. testName: 'SVG.js Unit Tests'
  111. // connectOptions: {
  112. // noSslBumpDomains: "all"
  113. // },
  114. // connectOptions: {
  115. // port: 5757,
  116. // logfile: 'sauce_connect.log'
  117. // },
  118. }
  119. // The number of disconnections tolerated.
  120. // browserDisconnectTolerance: 0, // well, sometimes it helps to just restart
  121. // // How long does Karma wait for a browser to reconnect (in ms).
  122. // browserDisconnectTimeout: 10 * 60 * 1000,
  123. // // How long will Karma wait for a message from a browser before disconnecting from it (in ms). ~ macOS 10.12 needs more than 7 minutes
  124. // browserNoActivityTimeout: 20 * 60 * 1000,
  125. // // Timeout for capturing a browser (in ms). On newer versions of iOS simulator (10.0+), the start up time could be between 3 - 6 minutes.
  126. // captureTimeout: 12 * 60 * 1000, // this is useful if saucelabs takes a long time to boot a vm
  127. // // Required to make Safari on Sauce Labs play nice.
  128. // // hostname: 'karmalocal.dev'
  129. })
  130. console.log(settings)
  131. config.set(settings)
  132. }