-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(e2e): Functioning end-to-end tests
This adds working e2e tests, using webdriverio and mocha via a work-in-progress fork of gulp-webdriver. Will need to investigate using only mocha in the project, or modifying gulp-webdriver to support both frameworks.
- Loading branch information
1 parent
a6b3212
commit 2984097
Showing
15 changed files
with
290 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* Aurelia Webdriver Plugin */ | ||
|
||
exports = module.exports = function(client){ | ||
client.timeouts('page load',20000); | ||
client.timeouts('script',30000); | ||
client.timeoutsImplicitWait(30000); | ||
|
||
client.addCommand('waitForAureliaPage', function(cb){ | ||
this.executeAsync(function(done){ | ||
document.addEventListener("aurelia-composed", function (e) { | ||
done(true) | ||
}); | ||
}, cb); | ||
}); | ||
|
||
client.addCommand('waitForHttpDone', function(cb){ | ||
this.executeAsync(function(done){ | ||
document.addEventListener("aurelia-http-client-requests-drained", function (e) { | ||
done(true) | ||
}); | ||
}, cb); | ||
}); | ||
|
||
client.addCommand('valueBind', function(element, parent, cb){ | ||
var callback; | ||
if('undefined' === typeof(cb)){ | ||
callback = parent; | ||
parent = null; | ||
} else { | ||
callback = cb; | ||
} | ||
|
||
this.executeAsync(function(bindingModel, opt_parentElement, done){ | ||
var using = opt_parentElement || document; | ||
var matches = using.querySelectorAll('*[value\\.bind="' + bindingModel +'"]'); | ||
var result; | ||
|
||
if (matches.length === 0) { | ||
result = null; | ||
} else if (matches.length === 1) { | ||
result = matches[0]; | ||
} else { | ||
result = matches; | ||
} | ||
done(result); | ||
}, element, parent, callback); | ||
}); | ||
|
||
client.addCommand("loadAndWaitForAureliaPage", function(pageUrl, cb) { | ||
// TODO: Investigate chromedriver/webdriver async command uncertainty | ||
// There seems to be an issue with chromedriver executing | ||
// the next tests before the page loaded call completes, pause seems | ||
// to help this and should be considered only temporary. | ||
// Calling this command's callback on process.nextTick is a last-ditch effort. | ||
this.url(pageUrl) | ||
.waitForAureliaPage() | ||
.pause(200) | ||
.call(function(){ | ||
// Attempt to avoid electron<->chromedriver issues with applying webdriverio extensions. | ||
process.nextTick(cb); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
/* global aurelia */ | ||
/* eslint no-unused-vars: [1,"after-used"] */ | ||
export function configure(aurelia) { | ||
import {bootstrap} from 'aurelia-bootstrapper'; | ||
|
||
bootstrap(aurelia => { | ||
aurelia.use | ||
//.defaultBindingLanguage() | ||
//.defaultResources() | ||
.standardConfiguration() | ||
.developmentLogging() | ||
//.eventAggregator() | ||
.plugin('aurelia-animator-css'); | ||
|
||
aurelia.start().then(a => a.setRoot()); | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.