【问题标题】:Protractor: Specified suite is not running .Instead all suite inside suites(conf.js) is running量角器:指定的套件未运行。相反,套件(conf.js)中的所有套件都在运行
【发布时间】:2019-10-23 02:19:35
【问题描述】:

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

【问题讨论】:

标签: typescript protractor


【解决方案1】:

尝试更改 suites 对象

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

然后protractor conf.js --suite userTypeFrame

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多