webdriverio-boneyard / gulp-webdriver

gulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
http://webdriver.io
MIT License
76 stars 33 forks source link

Add support for custom extensions #3

Closed jimschubert closed 9 years ago

jimschubert commented 9 years ago

I've been working on jimschubert/electron-aurelia-example, combining atom/electron and aurelia/skeleton-navigation into a desktop application example. I have end to end tests working with a few modifications, one of which was a need to add custom commends to the webdriver client.

I added this functionality with an applyExtensions property on the configuration object, which expects a function(client) signature. This allows me to extend webdriver with, most importantly,

  client.addCommand('waitForAureliaPage', function(cb){
    this.executeAsync(function(done){
      document.addEventListener("aurelia-composed", function (e) {
        done(true)
      });
    }, cb);
  });
christian-bromann commented 9 years ago

Sounds good! Thanks