Protractor flakiness

前端 未结 4 626
忘掉有多难
忘掉有多难 2021-02-02 00:58

I maintain a complex Angular (1.5.x) application that is being E2E tested using Protractor (2.5.x). I am experiencing a problem with this approach, which presents primarily in t

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 01:47

    A workaround that my team has been using is to re-run only failed tests using the plugin protractor-errors. Using this tool, we can identify real failures versus flakey tests within 2-3 runs. To add the plugin, just add a require statement to the bottom of the Protractor config's onPrepare function:

    exports.config = {
        ...
    
        onPrepare: function() {
          require('protractor-errors');
        }
    }
    

    You will need to pass these additional parameters when to run your tests with the plugin:

    protractor config.js --params.errorsPath 'jasmineReports' --params.currentTime (timestamp) --params.errorRun (true or false)
    

    There is also a cli tool that will handle generating the currentTime if you don't have an easy way to pass in a timestamp.

提交回复
热议问题