AngularJS量角器:逐步进度日志

时间:2022-10-08 16:32:34

In the (now deprecated) angular scenario test runner, there was an option to create a runner.html page that would run the tests in an iFrame while reporting the progress, step-by-step, in the main page.

在(现已弃用)角度场景测试运行器中,有一个选项可以创建一个runner.html页面,该页面将在iFrame中运行测试,同时在主页面中逐步报告进度。

AngularJS量角器:逐步进度日志

Is there any way to get a similar step-by-step log for protractor tests? It does not need to be in an html page (console or log file would be fine).

有没有办法为量角器测试获得类似的逐步日志?它不需要在一个html页面(控制台或日志文件就可以了)。

2 个解决方案

#1


5  

For that you can use the jasmine-spec-reporter for protractor. You'll have a visual feedback of all your passing and non-passing tests :

为此,您可以使用jasmine-spec-reporter进行量角器。您将获得所有通过和未通过测试的视觉反馈:

AngularJS量角器:逐步进度日志

Easy to configure and looks really good in the console.

易于配置,在控制台中看起来非常好。

Hope this helps.

希望这可以帮助。

#2


2  

Since v1.0.0-rc2 you can see failures in real time:

从v1.0.0-rc2开始,您可以实时看到故障:

In your protractor config, add a jasmineNodeOpts object with realtimeFailure option to true:

在您的量角器配置中,将带有realtimeFailure选项的jasmineNodeOpts对象添加到true:

exports.config = {
  seleniumAddress: 'http://127.0.0.1:4444/wd/hub',

  specs: [
    'e2e/**/*.js'
  ],

  multiCapabilities: [
    {'browserName': 'firefox'},
    {'browserName': 'chrome'}
  ],

  baseUrl: 'http://localhost:8000',

  onPrepare: function() {},

  jasmineNodeOpts: {
    realtimeFailure: true
  }
};

The full list of jasmine options is here: minijasminenode

茉莉花选项的完整列表如下:minijasminenode

And the well detailed reference config file for protractor here: referenceConf.js

这里有详细的量角器参考配置文件:referenceConf.js

#1


5  

For that you can use the jasmine-spec-reporter for protractor. You'll have a visual feedback of all your passing and non-passing tests :

为此,您可以使用jasmine-spec-reporter进行量角器。您将获得所有通过和未通过测试的视觉反馈:

AngularJS量角器:逐步进度日志

Easy to configure and looks really good in the console.

易于配置,在控制台中看起来非常好。

Hope this helps.

希望这可以帮助。

#2


2  

Since v1.0.0-rc2 you can see failures in real time:

从v1.0.0-rc2开始,您可以实时看到故障:

In your protractor config, add a jasmineNodeOpts object with realtimeFailure option to true:

在您的量角器配置中,将带有realtimeFailure选项的jasmineNodeOpts对象添加到true:

exports.config = {
  seleniumAddress: 'http://127.0.0.1:4444/wd/hub',

  specs: [
    'e2e/**/*.js'
  ],

  multiCapabilities: [
    {'browserName': 'firefox'},
    {'browserName': 'chrome'}
  ],

  baseUrl: 'http://localhost:8000',

  onPrepare: function() {},

  jasmineNodeOpts: {
    realtimeFailure: true
  }
};

The full list of jasmine options is here: minijasminenode

茉莉花选项的完整列表如下:minijasminenode

And the well detailed reference config file for protractor here: referenceConf.js

这里有详细的量角器参考配置文件:referenceConf.js