@@ -65,7 +65,10 @@ ProtractorBy.prototype.addLocator = function(name, script) {
65
65
return driver . findElements (
66
66
webdriver . By . js . apply ( webdriver . By , findElementArguments ) ) ;
67
67
} ,
68
- message : 'by.' + name + '("' + Array . prototype . join . call ( locatorArguments , '", "' ) + '")'
68
+ toString : function toString ( ) {
69
+ return 'by.' + name + '("' + Array . prototype .
70
+ join . call ( locatorArguments , '", "' ) + '")' ;
71
+ }
69
72
} ;
70
73
} ;
71
74
} ;
@@ -86,7 +89,7 @@ ProtractorBy.prototype.addLocator = function(name, script) {
86
89
* expect(span2.getText()).toBe('[email protected] ');
87
90
*
88
91
* @param {string } bindingDescriptor
89
- * @return {{findElementsOverride: findElementsOverride, message: string} }
92
+ * @return {{findElementsOverride: findElementsOverride, toString: Function| string} }
90
93
*/
91
94
ProtractorBy . prototype . binding = function ( bindingDescriptor ) {
92
95
return {
@@ -95,7 +98,9 @@ ProtractorBy.prototype.binding = function(bindingDescriptor) {
95
98
webdriver . By . js ( clientSideScripts . findBindings ,
96
99
bindingDescriptor , false , using ) ) ;
97
100
} ,
98
- message : 'by.binding("' + bindingDescriptor + '")'
101
+ toString : function toString ( ) {
102
+ return 'by.binding("' + bindingDescriptor + '")' ;
103
+ }
99
104
} ;
100
105
} ;
101
106
@@ -117,7 +122,7 @@ ProtractorBy.prototype.binding = function(bindingDescriptor) {
117
122
* expect(element(by.exactBinding('phone')).isPresent()).toBe(false);
118
123
*
119
124
* @param {string } bindingDescriptor
120
- * @return {{findElementsOverride: findElementsOverride, message: string} }
125
+ * @return {{findElementsOverride: findElementsOverride, toString: Function| string} }
121
126
*/
122
127
ProtractorBy . prototype . exactBinding = function ( bindingDescriptor ) {
123
128
return {
@@ -126,7 +131,9 @@ ProtractorBy.prototype.exactBinding = function(bindingDescriptor) {
126
131
webdriver . By . js ( clientSideScripts . findBindings ,
127
132
bindingDescriptor , true , using ) ) ;
128
133
} ,
129
- message : 'by.exactBinding("' + bindingDescriptor + '")'
134
+ toString : function toString ( ) {
135
+ return 'by.exactBinding("' + bindingDescriptor + '")' ;
136
+ }
130
137
} ;
131
138
} ;
132
139
@@ -150,7 +157,9 @@ ProtractorBy.prototype.model = function(model) {
150
157
return driver . findElements (
151
158
webdriver . By . js ( clientSideScripts . findByModel , model , using ) ) ;
152
159
} ,
153
- message : 'by.model("' + model + '")'
160
+ toString : function toString ( ) {
161
+ return 'by.model("' + model + '")' ;
162
+ }
154
163
} ;
155
164
} ;
156
165
@@ -164,7 +173,7 @@ ProtractorBy.prototype.model = function(model) {
164
173
* element(by.buttonText('Save'));
165
174
*
166
175
* @param {string } searchText
167
- * @return {{findElementsOverride: findElementsOverride, message: string} }
176
+ * @return {{findElementsOverride: findElementsOverride, toString: Function| string} }
168
177
*/
169
178
ProtractorBy . prototype . buttonText = function ( searchText ) {
170
179
return {
@@ -173,7 +182,9 @@ ProtractorBy.prototype.buttonText = function(searchText) {
173
182
webdriver . By . js ( clientSideScripts . findByButtonText ,
174
183
searchText , using ) ) ;
175
184
} ,
176
- message : 'by.buttonText("' + searchText + '")'
185
+ toString : function toString ( ) {
186
+ return 'by.buttonText("' + searchText + '")' ;
187
+ }
177
188
} ;
178
189
} ;
179
190
@@ -187,7 +198,7 @@ ProtractorBy.prototype.buttonText = function(searchText) {
187
198
* element(by.partialButtonText('Save'));
188
199
*
189
200
* @param {string } searchText
190
- * @return {{findElementsOverride: findElementsOverride, message: string} }
201
+ * @return {{findElementsOverride: findElementsOverride, toString: Function| string} }
191
202
*/
192
203
ProtractorBy . prototype . partialButtonText = function ( searchText ) {
193
204
return {
@@ -196,7 +207,9 @@ ProtractorBy.prototype.partialButtonText = function(searchText) {
196
207
webdriver . By . js ( clientSideScripts . findByPartialButtonText ,
197
208
searchText , using ) ) ;
198
209
} ,
199
- message : 'by.partialButtonText("' + searchText + '")'
210
+ toString : function toString ( ) {
211
+ return 'by.partialButtonText("' + searchText + '")' ;
212
+ }
200
213
} ;
201
214
} ;
202
215
@@ -259,24 +272,30 @@ ProtractorBy.prototype.repeater = function(repeatDescriptor) {
259
272
webdriver . By . js ( clientSideScripts . findAllRepeaterRows ,
260
273
repeatDescriptor , using ) ) ;
261
274
} ,
262
- message : 'by.repeater("' + repeatDescriptor + '")' ,
275
+ toString : function toString ( ) {
276
+ return 'by.repeater("' + repeatDescriptor + '")' ;
277
+ } ,
263
278
row : function ( index ) {
264
279
return {
265
280
findElementsOverride : function ( driver , using ) {
266
281
return driver . findElements (
267
282
webdriver . By . js ( clientSideScripts . findRepeaterRows ,
268
283
repeatDescriptor , index , using ) ) ;
269
284
} ,
270
- message : 'by.repeater(' + repeatDescriptor + '").row("' + index + '")"' ,
285
+ toString : function toString ( ) {
286
+ return 'by.repeater(' + repeatDescriptor + '").row("' + index + '")"' ;
287
+ } ,
271
288
column : function ( binding ) {
272
289
return {
273
290
findElementsOverride : function ( driver , using ) {
274
291
return driver . findElements (
275
292
webdriver . By . js ( clientSideScripts . findRepeaterElement ,
276
293
repeatDescriptor , index , binding , using ) ) ;
277
294
} ,
278
- message : 'by.repeater("' + repeatDescriptor + '").row("' + index +
279
- '").column("' + binding + '")'
295
+ toString : function toString ( ) {
296
+ return 'by.repeater("' + repeatDescriptor + '").row("' + index +
297
+ '").column("' + binding + '")' ;
298
+ }
280
299
} ;
281
300
}
282
301
} ;
@@ -288,17 +307,21 @@ ProtractorBy.prototype.repeater = function(repeatDescriptor) {
288
307
webdriver . By . js ( clientSideScripts . findRepeaterColumn ,
289
308
repeatDescriptor , binding , using ) ) ;
290
309
} ,
291
- message : 'by.repeater("' + repeatDescriptor + '").column("' + binding +
292
- '")' ,
310
+ toString : function toString ( ) {
311
+ return 'by.repeater("' + repeatDescriptor + '").column("' +
312
+ binding + '")' ;
313
+ } ,
293
314
row : function ( index ) {
294
315
return {
295
316
findElementsOverride : function ( driver , using ) {
296
317
return driver . findElements (
297
318
webdriver . By . js ( clientSideScripts . findRepeaterElement ,
298
319
repeatDescriptor , index , binding , using ) ) ;
299
320
} ,
300
- message : 'by.repeater("' + repeatDescriptor + '").column("' +
301
- binding + '").row("' + index + '")'
321
+ toString : function toString ( ) {
322
+ return 'by.repeater("' + repeatDescriptor + '").column("' +
323
+ binding + '").row("' + index + '")' ;
324
+ }
302
325
} ;
303
326
}
304
327
} ;
@@ -326,7 +349,9 @@ ProtractorBy.prototype.cssContainingText = function(cssSelector, searchText) {
326
349
webdriver . By . js ( clientSideScripts . findByCssContainingText ,
327
350
cssSelector , searchText , using ) ) ;
328
351
} ,
329
- message : 'by.cssContainingText("' + cssSelector + '", "' + searchText + '")'
352
+ toString : function toString ( ) {
353
+ return 'by.cssContainingText("' + cssSelector + '", "' + searchText + '")' ;
354
+ }
330
355
} ;
331
356
} ;
332
357
0 commit comments