Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bf7ff5

Browse files
committed
fixing broken e2e tests
1 parent a01aa70 commit 5bf7ff5

File tree

7 files changed

+59
-59
lines changed

7 files changed

+59
-59
lines changed

docs/angular.formatter.ngdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ angular.formatter('reverse', {
6868
</doc:source>
6969
<doc:scenario>
7070
it('should store reverse', function(){
71-
expect(element('.doc-example input:first').val()).toEqual('angular');
72-
expect(element('.doc-example input:last').val()).toEqual('RALUGNA');
71+
expect(element('.doc-example-live input:first').val()).toEqual('angular');
72+
expect(element('.doc-example-live input:last').val()).toEqual('RALUGNA');
7373

7474
this.addFutureAction('change to XYZ', function($window, $document, done){
75-
$document.elements('.doc-example input:last').val('XYZ').trigger('change');
75+
$document.elements('.doc-example-live input:last').val('XYZ').trigger('change');
7676
done();
7777
});
78-
expect(element('.doc-example input:first').val()).toEqual('zyx');
78+
expect(element('.doc-example-live input:first').val()).toEqual('zyx');
7979
});
8080
</doc:scenario>
8181
</doc:example>

docs/guide.overview.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ easier life can be with angular:
6363
<tr><td>Quantity</td><td>Cost</td></tr>
6464
<tr>
6565
<td><input name="qty" value="1" ng:validate="integer:0" ng:required/></td>
66-
<td><input name="cost" value="199.95" ng:validate="number" ng:required/></td>
66+
<td><input name="cost" value="19.95" ng:validate="number" ng:required/></td>
6767
</tr>
6868
</table>
6969
<hr>

src/Angular.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,14 @@ function isLeafNode (node) {
562562
* </doc:source>
563563
* <doc:scenario>
564564
it('should print that initialy the form object is NOT equal to master', function() {
565-
expect(element('.doc-example input[name=master.salutation]').val()).toBe('Hello');
566-
expect(element('.doc-example input[name=master.name]').val()).toBe('world');
567-
expect(element('.doc-example span').css('display')).toBe('inline');
565+
expect(element('.doc-example-live input[name=master.salutation]').val()).toBe('Hello');
566+
expect(element('.doc-example-live input[name=master.name]').val()).toBe('world');
567+
expect(element('.doc-example-live span').css('display')).toBe('inline');
568568
});
569569
570570
it('should make form and master equal when the copy button is clicked', function() {
571-
element('.doc-example button').click();
572-
expect(element('.doc-example span').css('display')).toBe('none');
571+
element('.doc-example-live button').click();
572+
expect(element('.doc-example-live span').css('display')).toBe('none');
573573
});
574574
* </doc:scenario>
575575
* </doc:example>
@@ -643,14 +643,14 @@ function copy(source, destination){
643643
* </doc:source>
644644
* <doc:scenario>
645645
it('should print that initialy greeting is equal to the hardcoded value object', function() {
646-
expect(element('.doc-example input[name=greeting.salutation]').val()).toBe('Hello');
647-
expect(element('.doc-example input[name=greeting.name]').val()).toBe('world');
648-
expect(element('.doc-example span').css('display')).toBe('none');
646+
expect(element('.doc-example-live input[name=greeting.salutation]').val()).toBe('Hello');
647+
expect(element('.doc-example-live input[name=greeting.name]').val()).toBe('world');
648+
expect(element('.doc-example-live span').css('display')).toBe('none');
649649
});
650650
651651
it('should say that the objects are not equal when the form is modified', function() {
652652
input('greeting.name').enter('kitty');
653-
expect(element('.doc-example span').css('display')).toBe('inline');
653+
expect(element('.doc-example-live span').css('display')).toBe('inline');
654654
});
655655
* </doc:scenario>
656656
* </doc:example>

src/apis.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ var angularArray = {
151151
});
152152
153153
it('should add an entry and recalculate', function() {
154-
element('.doc-example a:contains("add item")').click();
154+
element('.doc-example-live a:contains("add item")').click();
155155
using('.doc-example-live tr:nth-child(3)').input('item.qty').enter('20');
156156
using('.doc-example-live tr:nth-child(3)').input('item.cost').enter('100');
157157
@@ -206,20 +206,20 @@ var angularArray = {
206206
</doc:source>
207207
<doc:scenario>
208208
it('should initialize the task list with for tasks', function() {
209-
expect(repeater('.doc-example ul li', 'task in tasks').count()).toBe(4);
210-
expect(repeater('.doc-example ul li', 'task in tasks').column('task')).
209+
expect(repeater('.doc-example-live ul li', 'task in tasks').count()).toBe(4);
210+
expect(repeater('.doc-example-live ul li', 'task in tasks').column('task')).
211211
toEqual(['Learn Angular', 'Read Documentation', 'Check out demos',
212212
'Build cool applications']);
213213
});
214214
215215
it('should initialize the task list with for tasks', function() {
216-
element('.doc-example ul li a:contains("X"):first').click();
217-
expect(repeater('.doc-example ul li', 'task in tasks').count()).toBe(3);
216+
element('.doc-example-live ul li a:contains("X"):first').click();
217+
expect(repeater('.doc-example-live ul li', 'task in tasks').count()).toBe(3);
218218
219-
element('.doc-example ul li a:contains("X"):last').click();
220-
expect(repeater('.doc-example ul li', 'task in tasks').count()).toBe(2);
219+
element('.doc-example-live ul li a:contains("X"):last').click();
220+
expect(repeater('.doc-example-live ul li', 'task in tasks').count()).toBe(2);
221221
222-
expect(repeater('.doc-example ul li', 'task in tasks').column('task')).
222+
expect(repeater('.doc-example-live ul li', 'task in tasks').column('task')).
223223
toEqual(['Read Documentation', 'Check out demos']);
224224
});
225225
</doc:scenario>
@@ -442,23 +442,23 @@ var angularArray = {
442442
});
443443
444444
it('should create an empty record when "add empty" is clicked', function() {
445-
element('.doc-example a:contains("add empty")').click();
445+
element('.doc-example-live a:contains("add empty")').click();
446446
expect(binding('people')).toBe('people = [{\n "name":"",\n "sex":null}]');
447447
});
448448
449449
it('should create a "John" record when "add \'John\'" is clicked', function() {
450-
element('.doc-example a:contains("add \'John\'")').click();
450+
element('.doc-example-live a:contains("add \'John\'")').click();
451451
expect(binding('people')).toBe('people = [{\n "name":"John",\n "sex":"male"}]');
452452
});
453453
454454
it('should create a "Mary" record when "add \'Mary\'" is clicked', function() {
455-
element('.doc-example a:contains("add \'Mary\'")').click();
455+
element('.doc-example-live a:contains("add \'Mary\'")').click();
456456
expect(binding('people')).toBe('people = [{\n "name":"Mary",\n "sex":"female"}]');
457457
});
458458
459459
it('should delete a record when "X" is clicked', function() {
460-
element('.doc-example a:contains("add empty")').click();
461-
element('.doc-example li a:contains("X"):first').click();
460+
element('.doc-example-live a:contains("add empty")').click();
461+
element('.doc-example-live li a:contains("X"):first').click();
462462
expect(binding('people')).toBe('people = []');
463463
});
464464
</doc:scenario>
@@ -510,7 +510,7 @@ var angularArray = {
510510
});
511511
512512
it('should recalculate when updated', function() {
513-
using('.doc-example li:first-child').input('item.points').enter('23');
513+
using('.doc-example-live li:first-child').input('item.points').enter('23');
514514
expect(binding('items.$count(\'points==1\')')).toEqual(1);
515515
expect(binding('items.$count(\'points>1\')')).toEqual(2);
516516
});
@@ -586,23 +586,23 @@ var angularArray = {
586586
<doc:scenario>
587587
it('should be reverse ordered by aged', function() {
588588
expect(binding('predicate')).toBe('Sorting predicate = -age');
589-
expect(repeater('.doc-example table', 'friend in friends').column('friend.age')).
589+
expect(repeater('.doc-example-live table', 'friend in friends').column('friend.age')).
590590
toEqual(['35', '29', '21', '19', '10']);
591-
expect(repeater('.doc-example table', 'friend in friends').column('friend.name')).
591+
expect(repeater('.doc-example-live table', 'friend in friends').column('friend.name')).
592592
toEqual(['Adam', 'Julie', 'Mike', 'Mary', 'John']);
593593
});
594594
595595
it('should reorder the table when user selects different predicate', function() {
596-
element('.doc-example a:contains("Name")').click();
597-
expect(repeater('.doc-example table', 'friend in friends').column('friend.name')).
596+
element('.doc-example-live a:contains("Name")').click();
597+
expect(repeater('.doc-example-live table', 'friend in friends').column('friend.name')).
598598
toEqual(['Adam', 'John', 'Julie', 'Mary', 'Mike']);
599-
expect(repeater('.doc-example table', 'friend in friends').column('friend.age')).
599+
expect(repeater('.doc-example-live table', 'friend in friends').column('friend.age')).
600600
toEqual(['35', '10', '29', '19', '21']);
601601
602-
element('.doc-example a:contains("Phone")+a:contains("^")').click();
603-
expect(repeater('.doc-example table', 'friend in friends').column('friend.phone')).
602+
element('.doc-example-live a:contains("Phone")+a:contains("^")').click();
603+
expect(repeater('.doc-example-live table', 'friend in friends').column('friend.phone')).
604604
toEqual(['555-9876', '555-8765', '555-5678', '555-4321', '555-1212']);
605-
expect(repeater('.doc-example table', 'friend in friends').column('friend.name')).
605+
expect(repeater('.doc-example-live table', 'friend in friends').column('friend.name')).
606606
toEqual(['Mary', 'Julie', 'Adam', 'Mike', 'John']);
607607
});
608608
</doc:scenario>
@@ -684,7 +684,7 @@ var angularArray = {
684684
</doc:source>
685685
<doc:scenario>
686686
it('should limit the numer array to first three items', function() {
687-
expect(element('.doc-example input[name=limit]').val()).toBe('3');
687+
expect(element('.doc-example-live input[name=limit]').val()).toBe('3');
688688
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[1,2,3]');
689689
});
690690

src/formatters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ angularFormatter.number = formatter(toString, function(obj){
123123
it('should format lists', function(){
124124
expect(binding('value')).toEqual('value=["chair","table"]');
125125
this.addFutureAction('change to XYZ', function($window, $document, done){
126-
$document.elements('.doc-example :input:last').val(',,a,b,').trigger('change');
126+
$document.elements('.doc-example-live :input:last').val(',,a,b,').trigger('change');
127127
done();
128128
});
129129
expect(binding('value')).toEqual('value=["a","b"]');
@@ -165,7 +165,7 @@ angularFormatter.list = formatter(
165165
it('should format trim', function(){
166166
expect(binding('value')).toEqual('value="book"');
167167
this.addFutureAction('change to XYZ', function($window, $document, done){
168-
$document.elements('.doc-example :input:last').val(' text ').trigger('change');
168+
$document.elements('.doc-example-live :input:last').val(' text ').trigger('change');
169169
done();
170170
});
171171
expect(binding('value')).toEqual('value="text"');

src/validators.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extend(angularValidator, {
2727
</doc:source>
2828
<doc:scenario>
2929
it('should invalidate non ssn', function(){
30-
var textBox = element('.doc-example :input');
30+
var textBox = element('.doc-example-live :input');
3131
expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);
3232
expect(textBox.val()).toEqual('123-45-6789');
3333
input('ssn').enter('123-45-67890');
@@ -68,15 +68,15 @@ extend(angularValidator, {
6868
</doc:source>
6969
<doc:scenario>
7070
it('should invalidate number', function(){
71-
var n1 = element('.doc-example :input[name=n1]');
71+
var n1 = element('.doc-example-live :input[name=n1]');
7272
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
7373
input('n1').enter('1.x');
7474
expect(n1.attr('className')).toMatch(/ng-validation-error/);
75-
var n2 = element('.doc-example :input[name=n2]');
75+
var n2 = element('.doc-example-live :input[name=n2]');
7676
expect(n2.attr('className')).not().toMatch(/ng-validation-error/);
7777
input('n2').enter('9');
7878
expect(n2.attr('className')).toMatch(/ng-validation-error/);
79-
var n3 = element('.doc-example :input[name=n3]');
79+
var n3 = element('.doc-example-live :input[name=n3]');
8080
expect(n3.attr('className')).not().toMatch(/ng-validation-error/);
8181
input('n3').enter('201');
8282
expect(n3.attr('className')).toMatch(/ng-validation-error/);
@@ -122,15 +122,15 @@ extend(angularValidator, {
122122
</doc:source>
123123
<doc:scenario>
124124
it('should invalidate integer', function(){
125-
var n1 = element('.doc-example :input[name=n1]');
125+
var n1 = element('.doc-example-live :input[name=n1]');
126126
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
127127
input('n1').enter('1.1');
128128
expect(n1.attr('className')).toMatch(/ng-validation-error/);
129-
var n2 = element('.doc-example :input[name=n2]');
129+
var n2 = element('.doc-example-live :input[name=n2]');
130130
expect(n2.attr('className')).not().toMatch(/ng-validation-error/);
131131
input('n2').enter('10.1');
132132
expect(n2.attr('className')).toMatch(/ng-validation-error/);
133-
var n3 = element('.doc-example :input[name=n3]');
133+
var n3 = element('.doc-example-live :input[name=n3]');
134134
expect(n3.attr('className')).not().toMatch(/ng-validation-error/);
135135
input('n3').enter('100.1');
136136
expect(n3.attr('className')).toMatch(/ng-validation-error/);
@@ -166,7 +166,7 @@ extend(angularValidator, {
166166
</doc:source>
167167
<doc:scenario>
168168
it('should invalidate date', function(){
169-
var n1 = element('.doc-example :input');
169+
var n1 = element('.doc-example-live :input');
170170
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
171171
input('text').enter('123/123/123');
172172
expect(n1.attr('className')).toMatch(/ng-validation-error/);
@@ -204,7 +204,7 @@ extend(angularValidator, {
204204
</doc:source>
205205
<doc:scenario>
206206
it('should invalidate email', function(){
207-
var n1 = element('.doc-example :input');
207+
var n1 = element('.doc-example-live :input');
208208
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
209209
input('text').enter('a@b.c');
210210
expect(n1.attr('className')).toMatch(/ng-validation-error/);
@@ -238,7 +238,7 @@ extend(angularValidator, {
238238
</doc:source>
239239
<doc:scenario>
240240
it('should invalidate phone', function(){
241-
var n1 = element('.doc-example :input');
241+
var n1 = element('.doc-example-live :input');
242242
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
243243
input('text').enter('+12345678');
244244
expect(n1.attr('className')).toMatch(/ng-validation-error/);
@@ -275,7 +275,7 @@ extend(angularValidator, {
275275
</doc:source>
276276
<doc:scenario>
277277
it('should invalidate url', function(){
278-
var n1 = element('.doc-example :input');
278+
var n1 = element('.doc-example-live :input');
279279
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
280280
input('text').enter('abc://server/path');
281281
expect(n1.attr('className')).toMatch(/ng-validation-error/);
@@ -310,7 +310,7 @@ extend(angularValidator, {
310310
</doc:source>
311311
<doc:scenario>
312312
it('should invalidate json', function(){
313-
var n1 = element('.doc-example :input');
313+
var n1 = element('.doc-example-live :input');
314314
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
315315
input('json').enter('{name}');
316316
expect(n1.attr('className')).toMatch(/ng-validation-error/);
@@ -382,7 +382,7 @@ extend(angularValidator, {
382382
</doc:source>
383383
<doc:scenario>
384384
it('should change color in delayed way', function(){
385-
var textBox = element('.doc-example :input');
385+
var textBox = element('.doc-example-live :input');
386386
expect(textBox.attr('className')).not().toMatch(/ng-input-indicator-wait/);
387387
expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);
388388
input('text').enter('X');

src/widgets.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,15 @@ angularWidget('option', function(){
625625
</doc:source>
626626
<doc:scenario>
627627
it('should load date filter', function(){
628-
expect(element('.doc-example ng\\:include').text()).toMatch(/angular\.filter\.date/);
628+
expect(element('.doc-example-live ng\\:include').text()).toMatch(/angular\.filter\.date/);
629629
});
630630
it('should change to hmtl filter', function(){
631631
select('url').option('angular.filter.html.html');
632-
expect(element('.doc-example ng\\:include').text()).toMatch(/angular\.filter\.html/);
632+
expect(element('.doc-example-live ng\\:include').text()).toMatch(/angular\.filter\.html/);
633633
});
634634
it('should change to blank', function(){
635-
select('url').option('(blank)');
636-
expect(element('.doc-example ng\\:include').text()).toEqual('');
635+
select('url').option('');
636+
expect(element('.doc-example-live ng\\:include').text()).toEqual('');
637637
});
638638
</doc:scenario>
639639
</doc:example>
@@ -729,15 +729,15 @@ angularWidget('ng:include', function(element){
729729
</doc:source>
730730
<doc:scenario>
731731
it('should start in settings', function(){
732-
expect(element('.doc-example ng\\:switch').text()).toEqual('Settings Div');
732+
expect(element('.doc-example-live ng\\:switch').text()).toEqual('Settings Div');
733733
});
734734
it('should change to home', function(){
735735
select('switch').option('home');
736-
expect(element('.doc-example ng\\:switch').text()).toEqual('Home Span');
736+
expect(element('.doc-example-live ng\\:switch').text()).toEqual('Home Span');
737737
});
738738
it('should select deafault', function(){
739739
select('switch').option('other');
740-
expect(element('.doc-example ng\\:switch').text()).toEqual('default');
740+
expect(element('.doc-example-live ng\\:switch').text()).toEqual('default');
741741
});
742742
</doc:scenario>
743743
</doc:example>

0 commit comments

Comments
 (0)