Skip to content

Instantly share code, notes, and snippets.

@zachsnow
Last active December 16, 2015 16:09
Show Gist options
  • Save zachsnow/5461429 to your computer and use it in GitHub Desktop.
Save zachsnow/5461429 to your computer and use it in GitHub Desktop.
An AngularJS e2e scenario runner DSL construct for immediately accessing the tested application's document. Maybe.
// Return `document` for running application.
angular.scenario.dsl('doc', function(){
return function(){
return this.application.getWindow_().document;
};
});
// Return `jQuery(document.body)` for running application;
// requires you to have included your own copy of jQuery.
var body = function(){
return return $(doc().body);
};
// Using `doc`.
it('should allow immediate access to the document', function(){
if(body().find('#hello').length){
// Test one thing.
}
else {
// Test another thing.
}
});
@zachsnow
Copy link
Author

zachsnow commented Dec 4, 2013

This is a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment