测试用例:我只想运行一个套件(例如)套件“ A”。所以我在运行配置量角器conf.js-套件A
时指定了相同的名称问题:所有套件(A,B,C,D)都在运行,而不仅仅是套件A。
conf.js文件摘录:
const { SpecReporter } = require('jasmine-spec-reporter');
const HtmlReporter = require('protractor-beautiful-reporter');
exports.config = {
allScriptsTimeout: 11000,
suites:{
// login: 'e2e/testSuites/angular.e2e-spec.ts',
userTypeFrame:['e2e/testSuites/userTypeFrame.e2e-spec.ts'],
//customerMyself:'e2e/testSuites/customerMyself.e2e-spec.ts',
myselfCustomer:['e2e/testSuites/myselfCustomer.e2e-spec.ts']
},
multiCapabilities: [{
'browserName': 'chrome',
'chromeOptions': {
'args': ['start-maximized']
},
},
],
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './e2e/tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
browser.baseUrl = 'http://www.sample.domain.com';
/*jasmin html test report */
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: 'reports/ccpa_reports',
preserveDirectory: false, // default is true
screenshotsSubfolder: 'screenshots',
jsonsSubfolder: 'jsons',
docName: 'ccpa_index.html',
docTitle: 'CCPA TEST REPORT',
takeScreenShotsOnlyForFailedSpecs: false
}).getJasmine2Reporter());
}
};
答案 0 :(得分:0)
尝试更改suites
对象
const suites = {
userTypeFrame: 'e2e/testSuites/userTypeFrame.e2e-spec.ts'
}
然后protractor conf.js --suite userTypeFrame