aboutsummaryrefslogtreecommitdiffstats
path: root/scenario/widgets-scenario.js
diff options
context:
space:
mode:
authorElliott Sprehn2010-10-08 16:43:40 -0700
committerElliott Sprehn2010-10-14 09:47:39 -0700
commit03df6cbddbb80186caf571e29957370b2ef9881c (patch)
treed5a321c8b207b464a5c8a300c422186e20e8ae31 /scenario/widgets-scenario.js
parent0f104317dff5628765e26cc68df7dd1175b2aa5e (diff)
downloadangular.js-03df6cbddbb80186caf571e29957370b2ef9881c.tar.bz2
New Angular Scenario runner and DSL system with redesigned HTML UI.
Uses the Jasmine syntax for tests, ex: describe('widgets', function() { it('should verify that basic widgets work', function(){ navigateTo('widgets.html'); input('text.basic').enter('Carlos'); expect(binding('text.basic')).toEqual('Carlos'); input('text.basic').enter('Carlos Santana'); expect(binding('text.basic')).not().toEqual('Carlos Boozer'); input('text.password').enter('secret'); expect(binding('text.password')).toEqual('secret'); expect(binding('text.hidden')).toEqual('hiddenValue'); expect(binding('gender')).toEqual('male'); input('gender').select('female'); expect(binding('gender')).toEqual('female'); }); }); Note: To create new UI's implement the interface shown in angular.scenario.ui.Html.
Diffstat (limited to 'scenario/widgets-scenario.js')
-rw-r--r--scenario/widgets-scenario.js73
1 files changed, 53 insertions, 20 deletions
diff --git a/scenario/widgets-scenario.js b/scenario/widgets-scenario.js
index f4488190..69fdc10e 100644
--- a/scenario/widgets-scenario.js
+++ b/scenario/widgets-scenario.js
@@ -1,25 +1,58 @@
-describe('widgets', function(){
+describe('widgets', function() {
it('should verify that basic widgets work', function(){
- browser.navigateTo('widgets.html');
-
- expect('{{text.basic}}').toEqual('');
- input('text.basic').enter('John');
- expect('{{text.basic}}').toEqual('John');
-
- expect('{{text.password}}').toEqual('');
+ navigateTo('widgets.html');
+ input('text.basic').enter('Carlos');
+ expect(binding('text.basic')).toEqual('Carlos');
+ pause(2);
+ input('text.basic').enter('Carlos Santana');
+ pause(2);
+ expect(binding('text.basic')).not().toEqual('Carlos Boozer');
+ pause(2);
input('text.password').enter('secret');
- expect('{{text.password}}').toEqual('secret');
-
- expect('{{text.hidden}}').toEqual('hiddenValue');
-
- expect('{{gender}}').toEqual('male');
+ expect(binding('text.password')).toEqual('secret');
+ expect(binding('text.hidden')).toEqual('hiddenValue');
+ expect(binding('gender')).toEqual('male');
+ pause(2);
input('gender').select('female');
- input('gender').isChecked('female');
- expect('{{gender}}').toEqual('female');
-
-// expect('{{tea}}').toBeChecked();
-// input('gender').select('female');
-// expect('{{gender}}').toEqual('female');
-
+ expect(binding('gender')).toEqual('female');
+ pause(2);
+ });
+ describe('do it again', function() {
+ it('should verify that basic widgets work', function(){
+ navigateTo('widgets.html');
+ input('text.basic').enter('Carlos');
+ expect(binding('text.basic')).toEqual('Carlos');
+ pause(2);
+ input('text.basic').enter('Carlos Santana');
+ pause(2);
+ expect(binding('text.basic')).toEqual('Carlos Santana');
+ pause(2);
+ input('text.password').enter('secret');
+ expect(binding('text.password')).toEqual('secret');
+ expect(binding('text.hidden')).toEqual('hiddenValue');
+ expect(binding('gender')).toEqual('male');
+ pause(2);
+ input('gender').select('female');
+ expect(binding('gender')).toEqual('female');
+ pause(2);
+ });
+ });
+ it('should verify that basic widgets work', function(){
+ navigateTo('widgets.html');
+ input('text.basic').enter('Carlos');
+ expect(binding('text.basic')).toEqual('Carlos');
+ pause(2);
+ input('text.basic').enter('Carlos Santana');
+ pause(2);
+ expect(binding('text.basic')).toEqual('Carlos Santana');
+ pause(2);
+ input('text.password').enter('secret');
+ expect(binding('text.password')).toEqual('secret');
+ expect(binding('text.hidden')).toEqual('hiddenValue');
+ expect(binding('gender')).toEqual('male');
+ pause(2);
+ input('gender').select('female');
+ expect(binding('gender')).toEqual('female');
+ pause(2);
});
});