加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
karma.saucelabs.conf.js 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
Lukas Holländer 提交于 2020-07-02 14:30 . Fix flaky CI tests (#2786)
// Karma configuration
'use strict'
const yaml = require('js-yaml')
const fs = require('fs')
const karmaConfig = require('./karma.common.conf.js')
const browsers = {
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 10',
version: '11'
},
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: '83'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '77'
}
}
module.exports = (config) => {
// Use ENV vars or .sauce.yml to get credentials
if (!process.env.SAUCE_USERNAME) {
if (!fs.existsSync('.sauce.yml')) {
// eslint-disable-next-line no-console
console.log(
'Create a .sauce.yml with your credentials'
)
process.exit(1)
} else {
let sauceConfig = yaml.safeLoad(fs.readFileSync('.sauce.yml', 'utf8'))
process.env.SAUCE_USERNAME = sauceConfig.addons.sauce_connect.username
process.env.SAUCE_ACCESS_KEY = sauceConfig.addons.sauce_connect.access_key
}
}
config.set({
...karmaConfig,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.DEBUG,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
reporters: ['saucelabs', 'progress', 'coverage', 'mocha', 'verbose'], // 2
browsers: Object.keys(browsers),
customLaunchers: browsers,
})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化