javascripttestingend-to-endcucumberjschimp.js

Chimp.js configuration


I am using Chimp.js(with Cucumber.js) and all the tests need to pass a login page.

I know webdriverIO uses testrunner config file for something like .before() and .after().

How would be the best way to achieve that with Chimp?

Thanks!


Solution

  • You can use Cucumber.js before and after hooks with Chimp:

    // tests/features/clearDatabase.js
    var clearDatabase = function() {
    
      this.Before(function() {
        server.call('/fixtures/clearDatabase');
      });
    
    };
    
    module.exports = clearDatabase;