点击命令 - node_modules.bin\karma start js ests\karma.conf.js 测试需要超过 30 秒才能开始。
我已经检查了自动化日志中的任何线索,但显然在创建测试之前没有创建日志。测试无缘无故地排队。我在 CI/CD 上尝试过相同的操作,比如 GitHub Action,但结果是一样的。下面是配置文件代码:
`const webDriverConfig = {
desktop: {
hostname: 'hub.lt.com',
port: 80
}
}`
` config.concurrency = 1,
config.port = 9876,
config.hostname = 'localhost.lt.com',
Object.keys(browsers['lambdaTest']).map(key => {
browsers.lambdaTest[key].base = 'WebDriver'
browsers.lambdaTest[key].build = 'HYE'
browsers.lambdaTest[key].project = 'Bootstrap'
browsers.lambdaTest[key].config = webDriverConfig.desktop
browsers.lambdaTest[key].user = ENV.LT_USERNAME
browsers.lambdaTest[key].accessKey = ENV.LT_ACCESS_KEY
browsers.lambdaTest[key].console = true
browsers.lambdaTest[key].network = true
browsers.lambdaTest[key].pseudoActivityInterval = 5000 // 5000 ms heartbeat
})
plugins.push('karma-webdriver-launcher', 'karma-jasmine', 'karma-jasmine-html-reporter')
config.customLaunchers = browsers.lt
config.browsers = Object.keys(browsers.lt)
reporters.push('kjhtml')`
浏览器.js
`const browsers = {
lt: {
chromeWin10: {
browserName: 'Chrome',
browserVersion: '109',
'LT:Options': {
platformName: 'Windows 10'
}
},
firefoxWin10: {
browserName: 'Firefox',
browserVersion: '109',
'LT:Options': {
platformName: 'Windows 10'
}
},
chromeWin10Latest: {
browserName: 'Chrome',
browserVersion: '108',
'LT:Options': {
platformName: 'Windows 10'
}
},
firefoxWin10Latest: {
browserName: 'Firefox',
browserVersion: '108',
'LT:Options': {
platformName: 'Windows 10'
}
}}`
如何减少这30秒的时间?