Webdriver.io how to send data to custom reporter

446
January 16, 2017, at 7:45 PM

I use wdio tool from webdriver.io npm package to run Mocha test-cases.

Here is part of wdio.conf.js:

var htmlReporter = require('./js/reporter/htmlReporter');
htmlReporter.reporterName = 'htmlReporter';
exports.config = {
    specs: [
        './test.js'
    ],
    reporters: [htmlReporter],
    ...
}

test.js: should send custom data

describe('Test suite', function() {
    // is it possible to send some data to the current test-suite?
    // this.customData ?
    it('Test case', function() {
        // is it possible to send some data to the current test-case?
        // this.customData ?
    });
});

});

htmlReporter.js: should receive custom data

var htmlReporter = function(options) {
var self = this;
    this.on('suite:start', function(suite) {
        // how to get a custom data?
        // suite.customData is undefined
    });
    this.on('test:pass', function(test) {
        // how to get a custom data?
        // suite.customData is undefined
    });
    ...
}
READ ALSO
When is NodeJS an appropriate solution for a website? [on hold]

When is NodeJS an appropriate solution for a website? [on hold]

I am thinking of using NodeJS for my website instead of my current MVC + AngularJSAre there any major disadvatanges/advantages to making this switch? project specification : 1- System will get lots of small requests and occasional requests that require...

253
Redirecting routes in Node using Express and Passport JS

Redirecting routes in Node using Express and Passport JS

Lets say I have a route defined using Express Router for rendering the payment form:

407
How to separate React router and nodejs api

How to separate React router and nodejs api

I'm kind of new in react and trying to develop sample app based on reactjs + expressjs + nodejs referred by https://githubcom/lmammino/judo-heroes but problem is when I'm trying to create webhook api for 3rd party application, react router showed me as 404 page

493
Node.js Server with MongoDB Database + Passport : req.user is undefined

Node.js Server with MongoDB Database + Passport : req.user is undefined

I'm currently working on a project including a chrome extension and a loginTo verify if the User is logged in on my Server from the Chrome Extension, I have made a new route called /checkuserlogin

461