Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit f701614

Browse files
committed
Lint fixes.
1 parent 972b1e1 commit f701614

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

protractor.js

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var clientSideScripts = {};
1717
* Wait until Angular has finished rendering and has
1818
* no outstanding $http calls before continuing.
1919
*
20-
* arguments none
20+
* arguments none.
2121
*/
2222
clientSideScripts.waitForAngular = function() {
2323
var callback = arguments[arguments.length - 1];
@@ -27,10 +27,10 @@ clientSideScripts.waitForAngular = function() {
2727

2828
/**
2929
* Find an element in the page by their angular binding.
30-
*
31-
* arguments[0] {string} The binding, e.g. {{cat.name}}
3230
*
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.
3434
*/
3535
clientSideScripts.findBinding = function() {
3636
var bindings = document.getElementsByClassName('ng-binding');
@@ -49,9 +49,9 @@ clientSideScripts.findBinding = function() {
4949
/**
5050
* Find a list of elements in the page by their angular binding.
5151
*
52-
* arguments[0] {string} The binding, e.g. {{cat.name}}
52+
* arguments[0] {string} The binding, e.g. {{cat.name}}.
5353
*
54-
* @return {Array.<WebElement>} The elements containing the binding
54+
* @return {Array.<WebElement>} The elements containing the binding.
5555
*/
5656
clientSideScripts.findBindings = function() {
5757
var bindings = document.getElementsByClassName('ng-binding');
@@ -70,10 +70,10 @@ clientSideScripts.findBindings = function() {
7070
/**
7171
* Find a row within an ng-repeat.
7272
*
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.
7575
*
76-
* @return {Element} The row element
76+
* @return {Element} The row element.
7777
*/
7878
clientSideScripts.findRepeaterRow = function() {
7979
var repeater = arguments[0];
@@ -97,11 +97,11 @@ clientSideScripts.findBindings = function() {
9797
/**
9898
* Find an element within an ng-repeat by its row and column.
9999
*
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}}'.
103103
*
104-
* @return {Element} The element
104+
* @return {Element} The element.
105105
*/
106106
clientSideScripts.findRepeaterElement = function() {
107107
var matches = [];
@@ -144,10 +144,10 @@ clientSideScripts.findRepeaterElement = function() {
144144
/**
145145
* Find the elements in a column of an ng-repeat.
146146
*
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}}'.
149149
*
150-
* @return {Array.<Element>} The elements in the column
150+
* @return {Array.<Element>} The elements in the column.
151151
*/
152152
clientSideScripts.findRepeaterColumn = function() {
153153
var matches = [];
@@ -189,7 +189,7 @@ clientSideScripts.findRepeaterColumn = function() {
189189
/**
190190
* Find an input element by model name.
191191
*
192-
* arguments[0] {string} The model name
192+
* arguments[0] {string} The model name.
193193
*
194194
* @return {Element} The first matching input element.
195195
*/
@@ -208,7 +208,7 @@ clientSideScripts.findInput = function() {
208208
/**
209209
* Find an select element by model name.
210210
*
211-
* arguments[0] {string} The model name
211+
* arguments[0] {string} The model name.
212212
*
213213
* @return {Element} The first matching select element.
214214
*/
@@ -227,7 +227,7 @@ clientSideScripts.findSelect = function() {
227227
/**
228228
* Find an selected option element by model name.
229229
*
230-
* arguments[0] {string} The model name
230+
* arguments[0] {string} The model name.
231231
*
232232
* @return {Element} The first matching input element.
233233
*/
@@ -248,27 +248,25 @@ clientSideScripts.findSelectedOption = function() {
248248
* Tests whether the angular global variable is present on a page. Retries
249249
* twice in case the page is just loading slowly.
250250
*
251-
* arguments none
252-
*
253-
* @return {boolean} true if angular was found.
251+
* arguments none.
254252
*/
255253
clientSideScripts.testForAngular = function() {
256254
var callback = arguments[arguments.length - 1];
257255
var retry = function(n) {
258256
if (window.angular && window.angular.resumeBootstrap) {
259257
callback(true);
260258
} else if (n < 1) {
261-
callback(false)
259+
callback(false);
262260
} else {
263261
window.setTimeout(function() {retry(n - 1)}, 1000);
264262
}
265-
}
263+
};
266264
if (window.angular && window.angular.resumeBootstrap) {
267265
callback(true);
268266
} else {
269267
retry(3);
270268
}
271-
}
269+
};
272270

273271

274272
/**
@@ -350,14 +348,14 @@ Protractor.prototype.clearMockModules = function() {
350348
*/
351349
Protractor.prototype.get = function(destination) {
352350
this.driver.get('about:blank');
353-
this.driver.executeScript('window.name += "' + DEFER_LABEL + '";' +
351+
this.driver.executeScript('window.name += "' + DEFER_LABEL + '";' +
354352
'window.location.href = "' + destination + '"');
355353

356354
// Make sure the page is an Angular page.
357355
this.driver.executeAsyncScript(clientSideScripts.testForAngular).
358356
then(function(hasAngular) {
359357
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 ' +
361359
destination);
362360
}
363361
});
@@ -389,7 +387,7 @@ exports.wrapDriver = function(webdriver) {
389387
/**
390388
* Locators.
391389
*/
392-
var ProtractorBy = function() {}
390+
var ProtractorBy = function() {};
393391
var WebdriverBy = function() {};
394392

395393
/**
@@ -403,7 +401,7 @@ util.inherits(ProtractorBy, WebdriverBy);
403401
* Usage:
404402
* <span>{{status}}</span>
405403
* var status = ptor.findElement(protractor.By.binding('{{status}}'));
406-
*
404+
*
407405
* Note: This ignores parent element restrictions if called with
408406
* WebElement.findElement.
409407
*/
@@ -420,7 +418,7 @@ ProtractorBy.prototype.binding = function(bindingDescriptor) {
420418
}
421419
};
422420
};
423-
421+
424422
/**
425423
* Usage:
426424
* <select ng-model="user" ng-options="user.name for user in users"></select>
@@ -497,7 +495,7 @@ ProtractorBy.prototype.repeater = function(repeatDescriptor) {
497495
webdriver.By.js(clientSideScripts.findRepeaterColumn),
498496
repeatDescriptor, binding);
499497
}
500-
}
498+
};
501499
}
502500
};
503501
};

0 commit comments

Comments
 (0)