How to make sharded protractor tests report after ALL tests finish (instead of per-file)?

前端 未结 3 646
北恋
北恋 2021-01-03 06:26

When sharding tests (aka running tests in parallel; ie: shardTestFiles: true), instead of reporting results when all tests are finished, Protractor rep

3条回答
  •  青春惊慌失措
    2021-01-03 07:03

    Solution2-> Step 1. From the latest version of html-reporter, filePrefix should be fileNamePrefix, so function should be:

    onPrepare: function() {
            return new Promise(function (fulfill, reject) {
                browser.getCapabilities().then(function (value) {
                    reportName = value.get('webdriver.remote.sessionid') + '_' + value.get('browserName') + '_' + Math.floor(Math.random()*1E16);
                    jasmine.getEnv().addReporter(
                        new Jasmine2HtmlReporter({
                            savePath: 'target/',
                            screenshotsFolder: 'images',
                            consolidate: true,
                            consolidateAll: true,
                            fileNamePrefix: reportName + ".html"
                        })
                    );
                    fulfill();
                })
            });
        },
    

提交回复
热议问题