From 39c6c5975bedf6e1610f7328a088acda9ab3406a Mon Sep 17 00:00:00 2001 From: Adam Abrons Date: Mon, 15 Mar 2010 17:02:54 -0700 Subject: get scenarios running again - open Runner.html in a browser to run them --- scenario/Runner.html | 10 +++++++ scenario/datastore-scenarios.js | 19 ++++++++++++++ scenario/datastore.html | 12 +++++++++ scenario/widgets-scenarios.js | 49 ++++++++++++++++++++++++++++++++++ scenario/widgets.html | 58 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 scenario/Runner.html create mode 100644 scenario/datastore-scenarios.js create mode 100644 scenario/datastore.html create mode 100644 scenario/widgets-scenarios.js create mode 100644 scenario/widgets.html (limited to 'scenario') diff --git a/scenario/Runner.html b/scenario/Runner.html new file mode 100644 index 00000000..fb4b0f8f --- /dev/null +++ b/scenario/Runner.html @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/scenario/datastore-scenarios.js b/scenario/datastore-scenarios.js new file mode 100644 index 00000000..6038070b --- /dev/null +++ b/scenario/datastore-scenarios.js @@ -0,0 +1,19 @@ +angular.scenarioDef.datastore = { + $before:[ + {Given:"dataset", + dataset:{ + Book:[{$id:'moby', name:"Moby Dick"}, + {$id:'gadsby', name:'Great Gadsby'}] + } + }, + {Given:"browser", at:"datastore.html#book=moby"}, + ], + checkLoadBook:[ + {Then:"drainRequestQueue"}, + + {Then:"text", at:"{{book.$id}}", should_be:"moby"}, + {Then:"text", at:"li[$index=0] {{book.name}}", should_be:"Great Gahdsby"}, + {Then:"text", at:"li[$index=0] {{book.name}}", should_be:"Moby Dick"}, + + ] +}; diff --git a/scenario/datastore.html b/scenario/datastore.html new file mode 100644 index 00000000..355d151c --- /dev/null +++ b/scenario/datastore.html @@ -0,0 +1,12 @@ + + + + + + +

{{book.$id}}

+
  • +
  • {{book.name}}
  • + + + diff --git a/scenario/widgets-scenarios.js b/scenario/widgets-scenarios.js new file mode 100644 index 00000000..663b06da --- /dev/null +++ b/scenario/widgets-scenarios.js @@ -0,0 +1,49 @@ +angular.scenarioDef.widgets = { + $before:[ + {Given:"browser", at:"widgets.html"} + ], + checkWidgetBinding:[ + {Then:"text", at:"{{name}}", should_be:""}, + {When:"enter", text:"John", at:":input[name=name]"}, + {Then:"text", at:"{{name}}", should_be:"John"}, + + {Then:"text", at:"{{gender}}", should_be:""}, + {When:"click", at:"input:radio[value=male]"}, + {Then:"text", at:"{{gender}}", should_be:"male"}, + + {Then:"text", at:"{{tea}}", should_be:"on"}, + {When:"click", at:"input[name=tea]"}, + {Then:"text", at:"{{tea}}", should_be:""}, + + {Then:"text", at:"{{coffee}}", should_be:""}, + {When:"click", at:"input[name=coffee]"}, + {Then:"text", at:"{{coffee}}", should_be:"on"}, + + {Then:"text", at:"{{count}}", should_be:0}, + {When:"click", at:"form :button"}, + {When:"click", at:"form :submit"}, + {When:"click", at:"form :image"}, + {Then:"text", at:"{{count}}", should_be:3}, + + {Then:"text", at:"{{select}}", should_be:"A"}, + {When:"select", at:"select[name=select]", option:"B"}, + {Then:"text", at:"{{select}}", should_be:"B"}, + + {Then:"text", at:"{{multiple}}", should_be:"[]"}, + {When:"select", at:"select[name=multiple]", option:"A"}, + {Then:"text", at:"{{multiple}}", should_be:["A"]}, + {When:"select", at:"select[name=multiple]", option:"B"}, + {Then:"text", at:"{{multiple}}", should_be:["A", "B"]}, + {When:"select", at:"select[name=multiple]", option:"A"}, + {Then:"text", at:"{{multiple}}", should_be:["B"]}, + + {Then:"text", at:"{{hidden}}", should_be:"hiddenValue"}, + + {Then:"text", at:"{{password}}", should_be:"passwordValue"}, + {When:"enter", text:"reset", at:":input[name=password]"}, + {Then:"text", at:"{{password}}", should_be:"reset"}, + ], + checkNewWidgetEmpty:[ + {Then:"text", at:"{{name}}", should_be:""}, + ] +}; diff --git a/scenario/widgets.html b/scenario/widgets.html new file mode 100644 index 00000000..cb28e78c --- /dev/null +++ b/scenario/widgets.html @@ -0,0 +1,58 @@ + + + + + + + + + +

    + name: name={{name}}
    +

    +

    + Female + Male + gender={{gender}} +

    +

    + tea={{tea}}
    + coffee={{coffee}}
    +

    +

    +

    + + + + action + count={{count}} +
    +

    +

    + + select={{select}} +

    +

    + + multiple={{multiple}} +

    +

    + + Hidden field = {{hidden}} +

    +

    + + Password field = {{password}} +

    + + -- cgit v1.2.3 From 9e1f085ba6e224893abc04be181f8748939bfe77 Mon Sep 17 00:00:00 2001 From: Adam Abrons Date: Mon, 15 Mar 2010 17:05:45 -0700 Subject: datastore scenario failing as expected --- scenario/Runner.html | 2 +- scenario/datastore.html | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'scenario') diff --git a/scenario/Runner.html b/scenario/Runner.html index fb4b0f8f..c5eb6205 100644 --- a/scenario/Runner.html +++ b/scenario/Runner.html @@ -3,7 +3,7 @@ - + diff --git a/scenario/datastore.html b/scenario/datastore.html index 355d151c..525d3636 100644 --- a/scenario/datastore.html +++ b/scenario/datastore.html @@ -1,7 +1,12 @@ - + + + +

    {{book.$id}}

    -- cgit v1.2.3