我正在尝试在saucelabs中运行我的量角器测试,但无法确定用于运行测试的命令。我在conf.js中有sauceUser
和sauceKey
。
这是我通常用来在本地运行测试的命令
export TEST_ENV='dev'; ./node_modules/.bin/protractor e2e/conf.js
exports.config = {
sauceUser: '<user>',
sauceKey: '<key>',
directConnect: true,
framework: 'mocha',
onComplete: function () {
},
onPrepare: function () {
// Declaring chai here so it can be accessed through out the tests and
// there is no need to declare it in every test.
var chai = require('chai');
chai.use(require('chai-smoothie'));
var chaiAsPromised = require('chai-as-promised');
var chaiSmoothie = require('chai-smoothie')
chai.use(chaiAsPromised);
chai.use(chaiSmoothie);
var expect = chai.expect;
global.chai = chai;
browser.manage().deleteAllCookies();
},
mochaOpts: {
timeout: 30000,
reporter: 'mochawesome-screenshots',
reporterOptions: {
reportDir: 'e2e/reports', //The directory which stores the reports
reportName: 'TestExecutionReport',
reportTitle: 'Reports',
reportPageTitle: 'customReportPageTitle',
clearOldScreenshots: false,
jsonReport: false,
multiReport: true,
overwrite: true
}
},
specs: [
'test-spec.js'
],
capabilities: {
'browserName': 'chrome',
'shardTestFiles': true,
'maxInstances': 1,
'chromeOptions': {
'args': ['show-fps-counter=true', 'incognito', '--window-size=1200,800', 'use-fake-ui-for-media-stream']
}
},
allScriptsTimeout: 12000,
getPageTimeout: 12000,
};