量角器:指定的套件未在运行。相反,套件(conf.js)中的所有套件都在运行

时间:2019-10-22 13:59:07

标签: typescript protractor

测试用例:我只想运行一个套件(例如)套件“ 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()); 
  }
};

1 个答案:

答案 0 :(得分:0)

尝试更改suites对象

const suites = {
    userTypeFrame: 'e2e/testSuites/userTypeFrame.e2e-spec.ts'
}

然后protractor conf.js --suite userTypeFrame