layui-js/karma.conf.sauce.js
前端小武 34a30c1b25 完善 laydate 测试 (#61)
* 添加 laydate 测试

* 添加 options.format 和 options.value 叠加时的验证

* 修改必须单元测试通过后再进行浏览器测试

* 添加判断css是否加载成功

* 优化 options.elem 测试

* 完善laydate测试

* 更新事件回调测试

* 先把 options.format 注释了, 依赖 master 的修复

* 添加 mock server

* 更新404地址

* 使用 show api 来显示日历

* 测试火狐浏览器

* 修复火狐报错

* add callback test case

* fix firefox error

* fix win var

* add window.lay test case

* fix firefox test error

* add edga test

* update `laydate.render({value})` test case

* update options.dateTime test case
2017-09-16 12:38:33 -05:00

113 lines
2.6 KiB
JavaScript

/**
* @file karma配置
* @author fe.xiaowu@gmail.com
*/
var base = require('./karma.conf.base.js');
var customLaunchers = {
// Safari
sl_ios_safari: {
base: 'SauceLabs',
browserName: 'Safari'
},
// 安卓浏览器
sl_android_4_4: {
base: 'SauceLabs',
browserName: 'android',
version: '4.4'
},
sl_android_5: {
base: 'SauceLabs',
browserName: 'android',
version: '5'
},
sl_android_6: {
base: 'SauceLabs',
browserName: 'android',
version: '6'
},
// chrome
sl_ios_chrome: {
base: 'SauceLabs',
browserName: 'chrome'
},
// sl_ie_8: {
// base: 'SauceLabs',
// browserName: 'internet explorer',
// version: '8'
// },
sl_ie_9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
sl_ie_10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10'
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
sl_edga: {
base: 'SauceLabs',
browserName: 'microsoftedge',
platform: 'Windows 10',
version: '15'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 7'
}
};
// 不支持本地运行
if (!process.env.TRAVIS) {
console.error('不支持本地运行, 请使用 npm run test!');
process.exit(1);
}
// 变量检查
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.error('---------------');
console.error('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
console.error('---------------');
process.exit(1);
}
module.exports = function (config) {
var options = Object.assign(base(config), {
reporters: ['mocha', 'saucelabs'],
sauceLabs: {
'testName': 'layui',
'recordVideo': false,
'recordScreenshots': false,
'startConnect': false,
'connectOptions': {
'no-ssl-bump-domains': 'all'
},
'public': 'public',
'build': 'layui-build-' + process.env.TRAVIS_BUILD_NUMBER,
'tunnelIdentifier': process.env.TRAVIS_JOB_NUMBER
},
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers),
captureTimeout: 1000 * 60 * 5,
browserNoActivityTimeout: 1000 * 60 * 5
});
config.set(options);
};