From 34909520ae4b20ddf455adf72de8473e43cac1c6 Mon Sep 17 00:00:00 2001 From: Andres Ornelas Date: Wed, 27 Oct 2010 11:29:51 -0700 Subject: add optional label to dsl with selectors to improve test and output readability e.g. Before: code: element('.actions ul li a').click(); output: element .actions ul li a click After code: element('.actions ul li a', "'Configuration' link").click(); output: element 'Configuration' link ( .actions ul li a ) click --- scenario/widgets-scenario.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scenario') diff --git a/scenario/widgets-scenario.js b/scenario/widgets-scenario.js index 7e8b8ade..cf482d46 100644 --- a/scenario/widgets-scenario.js +++ b/scenario/widgets-scenario.js @@ -29,24 +29,24 @@ describe('widgets', function() { expect(binding('button').fromJson()).toEqual({'count': 0}); expect(binding('form').fromJson()).toEqual({'count': 0}); - element('form a').click(); + element('form a', "'action' link").click(); expect(binding('button').fromJson()).toEqual({'count': 1}); - element('input[value="submit input"]').click(); + element('input[value="submit input"]', "'submit input' button").click(); expect(binding('button').fromJson()).toEqual({'count': 2}); expect(binding('form').fromJson()).toEqual({'count': 1}); - element('button:contains("submit button")').click(); + element('button:contains("submit button")', "'submit button' button").click(); expect(binding('button').fromJson()).toEqual({'count': 2}); expect(binding('form').fromJson()).toEqual({'count': 2}); - element('input[value="button"]').click(); + element('input[value="button"]', "'button' button").click(); expect(binding('button').fromJson()).toEqual({'count': 3}); - element('input[type="image"]').click(); + element('input[type="image"]', 'form image').click(); expect(binding('button').fromJson()).toEqual({'count': 4}); - element('#navigate a').click(); + element('#navigate a', "'Go to #route' link").click(); expect(binding('$location.hash')).toEqual('route'); /** -- cgit v1.2.3