@@ -17,7 +17,7 @@ var clientSideScripts = {};
17
17
* Wait until Angular has finished rendering and has
18
18
* no outstanding $http calls before continuing.
19
19
*
20
- * arguments none
20
+ * arguments none.
21
21
*/
22
22
clientSideScripts . waitForAngular = function ( ) {
23
23
var callback = arguments [ arguments . length - 1 ] ;
@@ -27,10 +27,10 @@ clientSideScripts.waitForAngular = function() {
27
27
28
28
/**
29
29
* Find an element in the page by their angular binding.
30
- *
31
- * arguments[0] {string} The binding, e.g. {{cat.name}}
32
30
*
33
- * @return {WebElement } The element containing the binding
31
+ * arguments[0] {string} The binding, e.g. {{cat.name}}.
32
+ *
33
+ * @return {WebElement } The element containing the binding.
34
34
*/
35
35
clientSideScripts . findBinding = function ( ) {
36
36
var bindings = document . getElementsByClassName ( 'ng-binding' ) ;
@@ -49,9 +49,9 @@ clientSideScripts.findBinding = function() {
49
49
/**
50
50
* Find a list of elements in the page by their angular binding.
51
51
*
52
- * arguments[0] {string} The binding, e.g. {{cat.name}}
52
+ * arguments[0] {string} The binding, e.g. {{cat.name}}.
53
53
*
54
- * @return {Array.<WebElement> } The elements containing the binding
54
+ * @return {Array.<WebElement> } The elements containing the binding.
55
55
*/
56
56
clientSideScripts . findBindings = function ( ) {
57
57
var bindings = document . getElementsByClassName ( 'ng-binding' ) ;
@@ -70,10 +70,10 @@ clientSideScripts.findBindings = function() {
70
70
/**
71
71
* Find a row within an ng-repeat.
72
72
*
73
- * arguments[0] {string} The text of the repeater, e.g. 'cat in cats'
74
- * arguments[1] {number} The row index
73
+ * arguments[0] {string} The text of the repeater, e.g. 'cat in cats'.
74
+ * arguments[1] {number} The row index.
75
75
*
76
- * @return {Element } The row element
76
+ * @return {Element } The row element.
77
77
*/
78
78
clientSideScripts . findRepeaterRow = function ( ) {
79
79
var repeater = arguments [ 0 ] ;
@@ -97,11 +97,11 @@ clientSideScripts.findBindings = function() {
97
97
/**
98
98
* Find an element within an ng-repeat by its row and column.
99
99
*
100
- * arguments[0] {string} The text of the repeater, e.g. 'cat in cats'
101
- * arguments[1] {number} The row index
102
- * arguments[2] {string} The column binding, e.g. '{{cat.name}}'
100
+ * arguments[0] {string} The text of the repeater, e.g. 'cat in cats'.
101
+ * arguments[1] {number} The row index.
102
+ * arguments[2] {string} The column binding, e.g. '{{cat.name}}'.
103
103
*
104
- * @return {Element } The element
104
+ * @return {Element } The element.
105
105
*/
106
106
clientSideScripts . findRepeaterElement = function ( ) {
107
107
var matches = [ ] ;
@@ -144,10 +144,10 @@ clientSideScripts.findRepeaterElement = function() {
144
144
/**
145
145
* Find the elements in a column of an ng-repeat.
146
146
*
147
- * arguments[0] {string} The text of the repeater, e.g. 'cat in cats'
148
- * arguments[1] {string} The column binding, e.g. '{{cat.name}}'
147
+ * arguments[0] {string} The text of the repeater, e.g. 'cat in cats'.
148
+ * arguments[1] {string} The column binding, e.g. '{{cat.name}}'.
149
149
*
150
- * @return {Array.<Element> } The elements in the column
150
+ * @return {Array.<Element> } The elements in the column.
151
151
*/
152
152
clientSideScripts . findRepeaterColumn = function ( ) {
153
153
var matches = [ ] ;
@@ -189,7 +189,7 @@ clientSideScripts.findRepeaterColumn = function() {
189
189
/**
190
190
* Find an input element by model name.
191
191
*
192
- * arguments[0] {string} The model name
192
+ * arguments[0] {string} The model name.
193
193
*
194
194
* @return {Element } The first matching input element.
195
195
*/
@@ -208,7 +208,7 @@ clientSideScripts.findInput = function() {
208
208
/**
209
209
* Find an select element by model name.
210
210
*
211
- * arguments[0] {string} The model name
211
+ * arguments[0] {string} The model name.
212
212
*
213
213
* @return {Element } The first matching select element.
214
214
*/
@@ -227,7 +227,7 @@ clientSideScripts.findSelect = function() {
227
227
/**
228
228
* Find an selected option element by model name.
229
229
*
230
- * arguments[0] {string} The model name
230
+ * arguments[0] {string} The model name.
231
231
*
232
232
* @return {Element } The first matching input element.
233
233
*/
@@ -248,27 +248,25 @@ clientSideScripts.findSelectedOption = function() {
248
248
* Tests whether the angular global variable is present on a page. Retries
249
249
* twice in case the page is just loading slowly.
250
250
*
251
- * arguments none
252
- *
253
- * @return {boolean } true if angular was found.
251
+ * arguments none.
254
252
*/
255
253
clientSideScripts . testForAngular = function ( ) {
256
254
var callback = arguments [ arguments . length - 1 ] ;
257
255
var retry = function ( n ) {
258
256
if ( window . angular && window . angular . resumeBootstrap ) {
259
257
callback ( true ) ;
260
258
} else if ( n < 1 ) {
261
- callback ( false )
259
+ callback ( false ) ;
262
260
} else {
263
261
window . setTimeout ( function ( ) { retry ( n - 1 ) } , 1000 ) ;
264
262
}
265
- }
263
+ } ;
266
264
if ( window . angular && window . angular . resumeBootstrap ) {
267
265
callback ( true ) ;
268
266
} else {
269
267
retry ( 3 ) ;
270
268
}
271
- }
269
+ } ;
272
270
273
271
274
272
/**
@@ -350,14 +348,14 @@ Protractor.prototype.clearMockModules = function() {
350
348
*/
351
349
Protractor . prototype . get = function ( destination ) {
352
350
this . driver . get ( 'about:blank' ) ;
353
- this . driver . executeScript ( 'window.name += "' + DEFER_LABEL + '";' +
351
+ this . driver . executeScript ( 'window.name += "' + DEFER_LABEL + '";' +
354
352
'window.location.href = "' + destination + '"' ) ;
355
353
356
354
// Make sure the page is an Angular page.
357
355
this . driver . executeAsyncScript ( clientSideScripts . testForAngular ) .
358
356
then ( function ( hasAngular ) {
359
357
if ( ! hasAngular ) {
360
- throw new Error ( " Angular could not be found on the page " +
358
+ throw new Error ( ' Angular could not be found on the page ' +
361
359
destination ) ;
362
360
}
363
361
} ) ;
@@ -389,7 +387,7 @@ exports.wrapDriver = function(webdriver) {
389
387
/**
390
388
* Locators.
391
389
*/
392
- var ProtractorBy = function ( ) { }
390
+ var ProtractorBy = function ( ) { } ;
393
391
var WebdriverBy = function ( ) { } ;
394
392
395
393
/**
@@ -403,7 +401,7 @@ util.inherits(ProtractorBy, WebdriverBy);
403
401
* Usage:
404
402
* <span>{{status}}</span>
405
403
* var status = ptor.findElement(protractor.By.binding('{{status}}'));
406
- *
404
+ *
407
405
* Note: This ignores parent element restrictions if called with
408
406
* WebElement.findElement.
409
407
*/
@@ -420,7 +418,7 @@ ProtractorBy.prototype.binding = function(bindingDescriptor) {
420
418
}
421
419
} ;
422
420
} ;
423
-
421
+
424
422
/**
425
423
* Usage:
426
424
* <select ng-model="user" ng-options="user.name for user in users"></select>
@@ -497,7 +495,7 @@ ProtractorBy.prototype.repeater = function(repeatDescriptor) {
497
495
webdriver . By . js ( clientSideScripts . findRepeaterColumn ) ,
498
496
repeatDescriptor , binding ) ;
499
497
}
500
- }
498
+ } ;
501
499
}
502
500
} ;
503
501
} ;
0 commit comments