john-doherty / selenium-cucumber-js

Browser automation framework written in pure JavaScript using official selenium-webdriver and cucumber-js
ISC License
120 stars 89 forks source link

Before/After handlers #10

Closed moogjet closed 7 years ago

moogjet commented 7 years ago

Hi,

I've not been able to get the Before/After Feature or Scenario event handlers working in my step definitions.

    this.BeforeFeature(/^Feature Name$/, function () {
        return helpers.loadPage('http://localhost/login').then(function() {
            return page.login.login(shared.testData.username, shared.testData.password);
        });
    });

Is there an example of how to do this? The above code works in a When - is something like this possible in a Before/After?

Thanks!

john-doherty commented 7 years ago

Hi @moogjet, apologies for the slow response. I've updated the readme to include example of before/after hooks