vendredi 30 juin 2017

Dynamically create test cases in Nightwatch.js

Is there a way to create test cases dynamically in Nightwatch.js?

An example use case:

I would like to run the "Conformance" test suite from the Qual-E test engine and use Nightwatch.js to simply read the results of the test cases from the page. At this moment I have a single module file with each test case defined as a separate function:

module.exports = {
    'AudioContext' : function (browser) {
        // test's code
    },

    ...

    'MediaList.length' : function (browser) {
        // test's code
    }
};

When the "Conformance" test suite from the Qual-E test engine changes (which happens from time to time) I need to update the list of test cases in my module file. I would like to have only a single function inside this module file (e.g. the before function) that will read the Qual-E page as a first step and spawn test cases in runtime, so I will always have an up-to-date test suite.

Aucun commentaire:

Enregistrer un commentaire