aboutsummaryrefslogtreecommitdiffstats
path: root/src/scenario/Steps.js
diff options
context:
space:
mode:
authorMisko Hevery2010-05-20 15:55:41 -0700
committerMisko Hevery2010-05-20 15:55:41 -0700
commit5215e2095cfd42a0363eb02eded34e03fa2b0cd3 (patch)
tree01ce02f1c5b7e544a6266d9a6f3b63a5184e88c8 /src/scenario/Steps.js
parent31b35b141f52e6f5d3805d6ca4f2702aee05d61d (diff)
downloadangular.js-5215e2095cfd42a0363eb02eded34e03fa2b0cd3.tar.bz2
basic end to end runner
Diffstat (limited to 'src/scenario/Steps.js')
-rw-r--r--src/scenario/Steps.js57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/scenario/Steps.js b/src/scenario/Steps.js
deleted file mode 100644
index ffe75933..00000000
--- a/src/scenario/Steps.js
+++ /dev/null
@@ -1,57 +0,0 @@
-angular.scenario.GIVEN = {
- browser:function(){
- var self = this;
- if (jQuery.browser.safari && this.frame.attr('src') == this.at) {
- this.window.location.reload();
- } else {
- this.frame.attr('src', this.at);
- }
- return function(done){
- self.frame.load(function(){
- self.frame.unbind();
- done();
- });
- };
- },
- dataset:function(){
- this.frame.name="$DATASET:" + toJson({dataset:this.dataset});
- }
-};
-angular.scenario.WHEN = {
- enter:function(){
- var element = this.element(this.at);
- element.attr('value', this.text);
- element.change();
- },
- click:function(){
- var element = this.element(this.at);
- var input = element[0];
- // emulate the browser behavior which causes it
- // to be overridden at the end.
- var checked = input.checked = !input.checked;
- element.trigger('click');
- input.checked = checked;
- },
- select:function(){
- var element = this.element(this.at);
- var path = "option[value=" + this.option + "]";
- var option = this.assert(element.find(path));
- option[0].selected = !option[0].selected;
- element.change();
- }
-};
-angular.scenario.THEN = {
- text:function(){
- var element = this.element(this.at);
- if (typeof this.should_be != undefined ) {
- var should_be = this.should_be;
- if (_.isArray(this.should_be))
- should_be = JSON.stringify(should_be);
- if (element.text() != should_be)
- throw "Expected " + should_be +
- " but was " + element.text() + ".";
- }
- },
- drainRequestQueue:function(){
- }
-};