angular2-credit-card-draw 1.0.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1844 +0,0 @@
1
- // Generated by typings
2
- // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/f9c44651705f574f6d4258fe5e1c335462bdcc19/angular-protractor/angular-protractor.d.ts
3
- declare namespace protractor {
4
- //region Wrapped webdriver Items
5
-
6
- class ActionSequence extends webdriver.ActionSequence {}
7
- class Builder extends webdriver.Builder {}
8
- class Capabilities extends webdriver.Capabilities {}
9
- class Command extends webdriver.Command {}
10
- class EventEmitter extends webdriver.EventEmitter {}
11
- class Session extends webdriver.Session {}
12
- class WebDriver extends webdriver.WebDriver {}
13
- class WebElement extends webdriver.WebElement {}
14
- class WebElementPromise extends webdriver.WebElementPromise { }
15
-
16
- var Browser: webdriver.IBrowser;
17
- var Button: webdriver.IButton;
18
- var Capability: webdriver.ICapability;
19
- var CommandName: webdriver.ICommandName;
20
- var Key: webdriver.IKey;
21
-
22
- namespace error {
23
- class Error extends webdriver.error.Error {}
24
- var ErrorCode: webdriver.error.IErrorCode;
25
- }
26
-
27
- namespace logging {
28
- class Preferences extends webdriver.logging.Preferences { }
29
- class Entry extends webdriver.logging.Entry { }
30
-
31
- var Type: webdriver.logging.IType;
32
- var Level: webdriver.logging.ILevelValues;
33
-
34
- function getLevel(nameOrValue: string): webdriver.logging.ILevel;
35
- function getLevel(nameOrValue: number): webdriver.logging.ILevel;
36
- }
37
-
38
- namespace promise {
39
- class Thenable<T> extends webdriver.promise.Thenable<T> { }
40
- class Promise<T> extends webdriver.promise.Promise<T> { }
41
- class Deferred<T> extends webdriver.promise.Deferred<T> { }
42
- class ControlFlow extends webdriver.promise.ControlFlow { }
43
- class CancellationError extends webdriver.promise.CancellationError { }
44
-
45
- /**
46
- * Given an array of promises, will return a promise that will be fulfilled
47
- * with the fulfillment values of the input array's values. If any of the
48
- * input array's promises are rejected, the returned promise will be rejected
49
- * with the same reason.
50
- *
51
- * @param {!Array.<(T|!webdriver.promise.Promise.<T>)>} arr An array of
52
- * promises to wait on.
53
- * @return {!webdriver.promise.Promise.<!Array.<T>>} A promise that is
54
- * fulfilled with an array containing the fulfilled values of the
55
- * input array, or rejected with the same reason as the first
56
- * rejected value.
57
- * @template T
58
- */
59
- function all(arr: webdriver.promise.Promise<any>[]): webdriver.promise.Promise<any[]>;
60
-
61
- /**
62
- * Invokes the appropriate callback function as soon as a promised
63
- * {@code value} is resolved. This function is similar to
64
- * {@link webdriver.promise.when}, except it does not return a new promise.
65
- * @param {*} value The value to observe.
66
- * @param {Function} callback The function to call when the value is
67
- * resolved successfully.
68
- * @param {Function=} opt_errback The function to call when the value is
69
- * rejected.
70
- */
71
- function asap(value: any, callback: Function, opt_errback?: Function): void;
72
-
73
- /**
74
- * @return {!webdriver.promise.ControlFlow} The currently active control flow.
75
- */
76
- function controlFlow(): webdriver.promise.ControlFlow;
77
-
78
- /**
79
- * Creates a new control flow. The provided callback will be invoked as the
80
- * first task within the new flow, with the flow as its sole argument. Returns
81
- * a promise that resolves to the callback result.
82
- * @param {function(!webdriver.promise.ControlFlow)} callback The entry point
83
- * to the newly created flow.
84
- * @return {!webdriver.promise.Promise} A promise that resolves to the callback
85
- * result.
86
- */
87
- function createFlow<R>(callback: (flow: webdriver.promise.ControlFlow) => R): webdriver.promise.Promise<R>;
88
-
89
- /**
90
- * Determines whether a {@code value} should be treated as a promise.
91
- * Any object whose "then" property is a function will be considered a promise.
92
- *
93
- * @param {*} value The value to test.
94
- * @return {boolean} Whether the value is a promise.
95
- */
96
- function isPromise(value: any): boolean;
97
-
98
- /**
99
- * Tests is a function is a generator.
100
- * @param {!Function} fn The function to test.
101
- * @return {boolean} Whether the function is a generator.
102
- */
103
- function isGenerator(fn: Function): boolean;
104
-
105
- /**
106
- * Creates a promise that will be resolved at a set time in the future.
107
- * @param {number} ms The amount of time, in milliseconds, to wait before
108
- * resolving the promise.
109
- * @return {!webdriver.promise.Promise} The promise.
110
- */
111
- function delayed(ms: number): webdriver.promise.Promise<void>;
112
-
113
- /**
114
- * Calls a function for each element in an array, and if the function returns
115
- * true adds the element to a new array.
116
- *
117
- * <p>If the return value of the filter function is a promise, this function
118
- * will wait for it to be fulfilled before determining whether to insert the
119
- * element into the new array.
120
- *
121
- * <p>If the filter function throws or returns a rejected promise, the promise
122
- * returned by this function will be rejected with the same reason. Only the
123
- * first failure will be reported; all subsequent errors will be silently
124
- * ignored.
125
- *
126
- * @param {!(Array.<TYPE>|webdriver.promise.Promise.<!Array.<TYPE>>)} arr The
127
- * array to iterator over, or a promise that will resolve to said array.
128
- * @param {function(this: SELF, TYPE, number, !Array.<TYPE>): (
129
- * boolean|webdriver.promise.Promise.<boolean>)} fn The function
130
- * to call for each element in the array.
131
- * @param {SELF=} opt_self The object to be used as the value of 'this' within
132
- * {@code fn}.
133
- * @template TYPE, SELF
134
- */
135
- function filter<T>(arr: T[], fn: (element: T, index: number, array: T[]) => any, opt_self?: any): webdriver.promise.Promise<T[]>;
136
- function filter<T>(arr: webdriver.promise.Promise<T[]>, fn: (element: T, index: number, array: T[]) => any, opt_self?: any): webdriver.promise.Promise<T[]>
137
-
138
- /**
139
- * Creates a new deferred object.
140
- * @return {!webdriver.promise.Deferred} The new deferred object.
141
- */
142
- function defer<T>(): webdriver.promise.Deferred<T>;
143
-
144
- /**
145
- * Creates a promise that has been resolved with the given value.
146
- * @param {*=} opt_value The resolved value.
147
- * @return {!webdriver.promise.Promise} The resolved promise.
148
- */
149
- function fulfilled<T>(opt_value?: T): webdriver.promise.Promise<T>;
150
-
151
- /**
152
- * Calls a function for each element in an array and inserts the result into a
153
- * new array, which is used as the fulfillment value of the promise returned
154
- * by this function.
155
- *
156
- * <p>If the return value of the mapping function is a promise, this function
157
- * will wait for it to be fulfilled before inserting it into the new array.
158
- *
159
- * <p>If the mapping function throws or returns a rejected promise, the
160
- * promise returned by this function will be rejected with the same reason.
161
- * Only the first failure will be reported; all subsequent errors will be
162
- * silently ignored.
163
- *
164
- * @param {!(Array.<TYPE>|webdriver.promise.Promise.<!Array.<TYPE>>)} arr The
165
- * array to iterator over, or a promise that will resolve to said array.
166
- * @param {function(this: SELF, TYPE, number, !Array.<TYPE>): ?} fn The
167
- * function to call for each element in the array. This function should
168
- * expect three arguments (the element, the index, and the array itself.
169
- * @param {SELF=} opt_self The object to be used as the value of 'this' within
170
- * {@code fn}.
171
- * @template TYPE, SELF
172
- */
173
- function map<T>(arr: T[], fn: (element: T, index: number, array: T[]) => any, opt_self?: any): webdriver.promise.Promise<T[]>
174
- function map<T>(arr: webdriver.promise.Promise<T[]>, fn: (element: T, index: number, array: T[]) => any, opt_self?: any): webdriver.promise.Promise<T[]>
175
-
176
- /**
177
- * Creates a promise that has been rejected with the given reason.
178
- * @param {*=} opt_reason The rejection reason; may be any value, but is
179
- * usually an Error or a string.
180
- * @return {!webdriver.promise.Promise} The rejected promise.
181
- */
182
- function rejected(opt_reason?: any): webdriver.promise.Promise<void>;
183
-
184
- /**
185
- * Wraps a function that is assumed to be a node-style callback as its final
186
- * argument. This callback takes two arguments: an error value (which will be
187
- * null if the call succeeded), and the success value as the second argument.
188
- * If the call fails, the returned promise will be rejected, otherwise it will
189
- * be resolved with the result.
190
- * @param {!Function} fn The function to wrap.
191
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
192
- * result of the provided function's callback.
193
- */
194
- function checkedNodeCall<T>(fn: Function, ...var_args: any[]): webdriver.promise.Promise<T>;
195
-
196
- /**
197
- * Consumes a {@code GeneratorFunction}. Each time the generator yields a
198
- * promise, this function will wait for it to be fulfilled before feeding the
199
- * fulfilled value back into {@code next}. Likewise, if a yielded promise is
200
- * rejected, the rejection error will be passed to {@code throw}.
201
- *
202
- * <p>Example 1: the Fibonacci Sequence.
203
- * <pre><code>
204
- * webdriver.promise.consume(function* fibonacci() {
205
- * var n1 = 1, n2 = 1;
206
- * for (var i = 0; i < 4; ++i) {
207
- * var tmp = yield n1 + n2;
208
- * n1 = n2;
209
- * n2 = tmp;
210
- * }
211
- * return n1 + n2;
212
- * }).then(function(result) {
213
- * console.log(result); // 13
214
- * });
215
- * </code></pre>
216
- *
217
- * <p>Example 2: a generator that throws.
218
- * <pre><code>
219
- * webdriver.promise.consume(function* () {
220
- * yield webdriver.promise.delayed(250).then(function() {
221
- * throw Error('boom');
222
- * });
223
- * }).thenCatch(function(e) {
224
- * console.log(e.toString()); // Error: boom
225
- * });
226
- * </code></pre>
227
- *
228
- * @param {!Function} generatorFn The generator function to execute.
229
- * @param {Object=} opt_self The object to use as "this" when invoking the
230
- * initial generator.
231
- * @param {...*} var_args Any arguments to pass to the initial generator.
232
- * @return {!webdriver.promise.Promise.<?>} A promise that will resolve to the
233
- * generator's final result.
234
- * @throws {TypeError} If the given function is not a generator.
235
- */
236
- function consume<T>(generatorFn: Function, opt_self?: any, ...var_args: any[]): webdriver.promise.Promise<T>;
237
-
238
- /**
239
- * Registers an observer on a promised {@code value}, returning a new promise
240
- * that will be resolved when the value is. If {@code value} is not a promise,
241
- * then the return promise will be immediately resolved.
242
- * @param {*} value The value to observe.
243
- * @param {Function=} opt_callback The function to call when the value is
244
- * resolved successfully.
245
- * @param {Function=} opt_errback The function to call when the value is
246
- * rejected.
247
- * @return {!webdriver.promise.Promise} A new promise.
248
- */
249
- function when<T, R>(value: T, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): webdriver.promise.Promise<R>;
250
- function when<T, R>(value: webdriver.promise.Promise<T>, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): webdriver.promise.Promise<R>;
251
-
252
- /**
253
- * Returns a promise that will be resolved with the input value in a
254
- * fully-resolved state. If the value is an array, each element will be fully
255
- * resolved. Likewise, if the value is an object, all keys will be fully
256
- * resolved. In both cases, all nested arrays and objects will also be
257
- * fully resolved. All fields are resolved in place; the returned promise will
258
- * resolve on {@code value} and not a copy.
259
- *
260
- * Warning: This function makes no checks against objects that contain
261
- * cyclical references:
262
- *
263
- * var value = {};
264
- * value['self'] = value;
265
- * webdriver.promise.fullyResolved(value); // Stack overflow.
266
- *
267
- * @param {*} value The value to fully resolve.
268
- * @return {!webdriver.promise.Promise} A promise for a fully resolved version
269
- * of the input value.
270
- */
271
- function fullyResolved<T>(value: any): webdriver.promise.Promise<T>;
272
-
273
- /**
274
- * Changes the default flow to use when no others are active.
275
- * @param {!webdriver.promise.ControlFlow} flow The new default flow.
276
- * @throws {Error} If the default flow is not currently active.
277
- */
278
- function setDefaultFlow(flow: webdriver.promise.ControlFlow): void;
279
- }
280
-
281
- namespace stacktrace {
282
- class Frame extends webdriver.stacktrace.Frame { }
283
- class Snapshot extends webdriver.stacktrace.Snapshot { }
284
-
285
- /**
286
- * Formats an error's stack trace.
287
- * @param {!(Error|goog.testing.JsUnitException)} error The error to format.
288
- * @return {!(Error|goog.testing.JsUnitException)} The formatted error.
289
- */
290
- function format(error: any): any;
291
-
292
- /**
293
- * Gets the native stack trace if available otherwise follows the call chain.
294
- * The generated trace will exclude all frames up to and including the call to
295
- * this function.
296
- * @return {!Array.<!webdriver.stacktrace.Frame>} The frames of the stack trace.
297
- */
298
- function get(): webdriver.stacktrace.Frame[];
299
-
300
- /**
301
- * Whether the current browser supports stack traces.
302
- *
303
- * @type {boolean}
304
- * @const
305
- */
306
- var BROWSER_SUPPORTED: boolean;
307
- }
308
-
309
- namespace until {
310
- class Condition<T> extends webdriver.until.Condition<T> { }
311
-
312
- /**
313
- * Creates a condition that will wait until the input driver is able to switch
314
- * to the designated frame. The target frame may be specified as:
315
- * <ol>
316
- * <li>A numeric index into {@code window.frames} for the currently selected
317
- * frame.
318
- * <li>A {@link webdriver.WebElement}, which must reference a FRAME or IFRAME
319
- * element on the current page.
320
- * <li>A locator which may be used to first locate a FRAME or IFRAME on the
321
- * current page before attempting to switch to it.
322
- * </ol>
323
- *
324
- * <p>Upon successful resolution of this condition, the driver will be left
325
- * focused on the new frame.
326
- *
327
- * @param {!(number|webdriver.WebElement|
328
- * webdriver.Locator|webdriver.By.Hash|
329
- * function(!webdriver.WebDriver): !webdriver.WebElement)} frame
330
- * The frame identifier.
331
- * @return {!until.Condition.<boolean>} A new condition.
332
- */
333
- function ableToSwitchToFrame(frame: number): webdriver.until.Condition<boolean>;
334
- function ableToSwitchToFrame(frame: webdriver.IWebElement): webdriver.until.Condition<boolean>;
335
- function ableToSwitchToFrame(frame: webdriver.Locator): webdriver.until.Condition<boolean>;
336
- function ableToSwitchToFrame(frame: (webdriver: webdriver.WebDriver) => webdriver.IWebElement): webdriver.until.Condition<boolean>;
337
- function ableToSwitchToFrame(frame: any): webdriver.until.Condition<boolean>;
338
-
339
- /**
340
- * Creates a condition that waits for an alert to be opened. Upon success, the
341
- * returned promise will be fulfilled with the handle for the opened alert.
342
- *
343
- * @return {!until.Condition.<!webdriver.Alert>} The new condition.
344
- */
345
- function alertIsPresent(): webdriver.until.Condition<webdriver.Alert>;
346
-
347
- /**
348
- * Creates a condition that will wait for the given element to be disabled.
349
- *
350
- * @param {!webdriver.WebElement} element The element to test.
351
- * @return {!until.Condition.<boolean>} The new condition.
352
- * @see webdriver.WebDriver#isEnabled
353
- */
354
- function elementIsDisabled(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
355
-
356
- /**
357
- * Creates a condition that will wait for the given element to be enabled.
358
- *
359
- * @param {!webdriver.WebElement} element The element to test.
360
- * @return {!until.Condition.<boolean>} The new condition.
361
- * @see webdriver.WebDriver#isEnabled
362
- */
363
- function elementIsEnabled(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
364
-
365
- /**
366
- * Creates a condition that will wait for the given element to be deselected.
367
- *
368
- * @param {!webdriver.WebElement} element The element to test.
369
- * @return {!until.Condition.<boolean>} The new condition.
370
- * @see webdriver.WebDriver#isSelected
371
- */
372
- function elementIsNotSelected(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
373
-
374
- /**
375
- * Creates a condition that will wait for the given element to be in the DOM,
376
- * yet not visible to the user.
377
- *
378
- * @param {!webdriver.WebElement} element The element to test.
379
- * @return {!until.Condition.<boolean>} The new condition.
380
- * @see webdriver.WebDriver#isDisplayed
381
- */
382
- function elementIsNotVisible(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
383
-
384
- /**
385
- * Creates a condition that will wait for the given element to be selected.
386
- * @param {!webdriver.WebElement} element The element to test.
387
- * @return {!until.Condition.<boolean>} The new condition.
388
- * @see webdriver.WebDriver#isSelected
389
- */
390
- function elementIsSelected(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
391
-
392
- /**
393
- * Creates a condition that will wait for the given element to become visible.
394
- *
395
- * @param {!webdriver.WebElement} element The element to test.
396
- * @return {!until.Condition.<boolean>} The new condition.
397
- * @see webdriver.WebDriver#isDisplayed
398
- */
399
- function elementIsVisible(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
400
-
401
- /**
402
- * Creates a condition that will loop until an element is
403
- * {@link webdriver.WebDriver#findElement found} with the given locator.
404
- *
405
- * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The locator
406
- * to use.
407
- * @return {!until.Condition.<!webdriver.WebElement>} The new condition.
408
- */
409
- function elementLocated(locator: webdriver.Locator): webdriver.until.Condition<webdriver.IWebElement>;
410
- function elementLocated(locator: any): webdriver.until.Condition<webdriver.IWebElement>;
411
-
412
- /**
413
- * Creates a condition that will wait for the given element's
414
- * {@link webdriver.WebDriver#getText visible text} to contain the given
415
- * substring.
416
- *
417
- * @param {!webdriver.WebElement} element The element to test.
418
- * @param {string} substr The substring to search for.
419
- * @return {!until.Condition.<boolean>} The new condition.
420
- * @see webdriver.WebDriver#getText
421
- */
422
- function elementTextContains(element: webdriver.IWebElement, substr: string): webdriver.until.Condition<boolean>;
423
-
424
- /**
425
- * Creates a condition that will wait for the given element's
426
- * {@link webdriver.WebDriver#getText visible text} to match the given
427
- * {@code text} exactly.
428
- *
429
- * @param {!webdriver.WebElement} element The element to test.
430
- * @param {string} text The expected text.
431
- * @return {!until.Condition.<boolean>} The new condition.
432
- * @see webdriver.WebDriver#getText
433
- */
434
- function elementTextIs(element: webdriver.IWebElement, text: string): webdriver.until.Condition<boolean>;
435
-
436
- /**
437
- * Creates a condition that will wait for the given element's
438
- * {@link webdriver.WebDriver#getText visible text} to match a regular
439
- * expression.
440
- *
441
- * @param {!webdriver.WebElement} element The element to test.
442
- * @param {!RegExp} regex The regular expression to test against.
443
- * @return {!until.Condition.<boolean>} The new condition.
444
- * @see webdriver.WebDriver#getText
445
- */
446
- function elementTextMatches(element: webdriver.IWebElement, regex: RegExp): webdriver.until.Condition<boolean>;
447
-
448
- /**
449
- * Creates a condition that will loop until at least one element is
450
- * {@link webdriver.WebDriver#findElement found} with the given locator.
451
- *
452
- * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The locator
453
- * to use.
454
- * @return {!until.Condition.<!Array.<!webdriver.WebElement>>} The new
455
- * condition.
456
- */
457
- function elementsLocated(locator: webdriver.Locator): webdriver.until.Condition<webdriver.IWebElement[]>;
458
- function elementsLocated(locator: any): webdriver.until.Condition<webdriver.IWebElement[]>;
459
-
460
- /**
461
- * Creates a condition that will wait for the given element to become stale. An
462
- * element is considered stale once it is removed from the DOM, or a new page
463
- * has loaded.
464
- *
465
- * @param {!webdriver.WebElement} element The element that should become stale.
466
- * @return {!until.Condition.<boolean>} The new condition.
467
- */
468
- function stalenessOf(element: webdriver.IWebElement): webdriver.until.Condition<boolean>;
469
-
470
- /**
471
- * Creates a condition that will wait for the current page's title to contain
472
- * the given substring.
473
- *
474
- * @param {string} substr The substring that should be present in the page
475
- * title.
476
- * @return {!until.Condition.<boolean>} The new condition.
477
- */
478
- function titleContains(substr: string): webdriver.until.Condition<boolean>;
479
-
480
- /**
481
- * Creates a condition that will wait for the current page's title to match the
482
- * given value.
483
- *
484
- * @param {string} title The expected page title.
485
- * @return {!until.Condition.<boolean>} The new condition.
486
- */
487
- function titleIs(title: string): webdriver.until.Condition<boolean>;
488
-
489
- /**
490
- * Creates a condition that will wait for the current page's title to match the
491
- * given regular expression.
492
- *
493
- * @param {!RegExp} regex The regular expression to test against.
494
- * @return {!until.Condition.<boolean>} The new condition.
495
- */
496
- function titleMatches(regex: RegExp): webdriver.until.Condition<boolean>;
497
- }
498
-
499
- namespace ExpectedConditions {
500
- /**
501
- * Negates the result of a promise.
502
- *
503
- * @param {webdriver.until.Condition<boolean>} expectedCondition
504
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns the negated value.
505
- */
506
- function not<T>(expectedCondition: webdriver.until.Condition<T>): webdriver.until.Condition<T>;
507
-
508
- /**
509
- * Chain a number of expected conditions using logical_and, short circuiting at the
510
- * first expected condition that evaluates to false.
511
- *
512
- * @param {...webdriver.until.Condition<boolean>[]} fns An array of expected conditions to 'and' together.
513
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise which evaluates
514
- * to the result of the logical and.
515
- */
516
- function and<T>(...fns: webdriver.until.Condition<T>[]): webdriver.until.Condition<T>;
517
-
518
- /**
519
- * Chain a number of expected conditions using logical_or, short circuiting at the
520
- * first expected condition that evaluates to true.
521
- *
522
- * @param {...webdriver.until.Condition<boolean>[]} fns An array of expected conditions to 'or' together.
523
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise which
524
- * evaluates to the result of the logical or.
525
- */
526
- function or<T>(...fns: webdriver.until.Condition<T>[]): webdriver.until.Condition<T>;
527
-
528
- /**
529
- * Expect an alert to be present.
530
- *
531
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
532
- * whether an alert is present.
533
- */
534
- function alertIsPresent<T>(): webdriver.until.Condition<T>;
535
-
536
- /**
537
- * An Expectation for checking an element is visible and enabled such that you can click it.
538
- *
539
- * @param {ElementFinder} element The element to check
540
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
541
- * whether the element is clickable.
542
- */
543
- function elementToBeClickable<T>(element: ElementFinder): webdriver.until.Condition<T>;
544
-
545
- /**
546
- * An expectation for checking if the given text is present in the element.
547
- * Returns false if the elementFinder does not find an element.
548
- *
549
- * @param {ElementFinder} element The element to check
550
- * @param {string} text The text to verify against
551
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
552
- * whether the text is present in the element.
553
- */
554
- function textToBePresentInElement<T>(element: ElementFinder, text: string): webdriver.until.Condition<T>;
555
-
556
- /**
557
- * An expectation for checking if the given text is present in the element’s value.
558
- * Returns false if the elementFinder does not find an element.
559
- *
560
- * @param {ElementFinder} element The element to check
561
- * @param {string} text The text to verify against
562
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
563
- * whether the text is present in the element's value.
564
- */
565
- function textToBePresentInElementValue<T>(
566
- element: ElementFinder, text: string
567
- ): webdriver.until.Condition<T>;
568
-
569
- /**
570
- * An expectation for checking that the title contains a case-sensitive substring.
571
- *
572
- * @param {string} title The fragment of title expected
573
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
574
- * whether the title contains the string.
575
- */
576
- function titleContains<T>(title: string): webdriver.until.Condition<T>;
577
-
578
- /**
579
- * An expectation for checking the title of a page.
580
- *
581
- * @param {string} title The expected title, which must be an exact match.
582
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
583
- * whether the title equals the string.
584
- */
585
- function titleIs<T>(title: string): webdriver.until.Condition<T>;
586
-
587
- /**
588
- * An expectation for checking that an element is present on the DOM of a page. This does not necessarily
589
- * mean that the element is visible. This is the opposite of 'stalenessOf'.
590
- *
591
- * @param {ElementFinder} elementFinder The element to check
592
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise
593
- * representing whether the element is present.
594
- */
595
- function presenceOf<T>(element: ElementFinder): webdriver.until.Condition<T>;
596
-
597
- /**
598
- * An expectation for checking that an element is not attached to the DOM of a page.
599
- * This is the opposite of 'presenceOf'.
600
- *
601
- * @param {ElementFinder} elementFinder The element to check
602
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
603
- * whether the element is stale.
604
- */
605
- function stalenessOf<T>(element: ElementFinder): webdriver.until.Condition<T>;
606
-
607
- /**
608
- * An expectation for checking that an element is present on the DOM of a page and visible.
609
- * Visibility means that the element is not only displayed but also has a height and width that is
610
- * greater than 0. This is the opposite of 'invisibilityOf'.
611
- *
612
- * @param {ElementFinder} elementFinder The element to check
613
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
614
- * whether the element is visible.
615
- */
616
- function visibilityOf<T>(element: ElementFinder): webdriver.until.Condition<T>;
617
-
618
- /**
619
- * An expectation for checking that an element is present on the DOM of a page. This does not necessarily
620
- * mean that the element is visible. This is the opposite of 'stalenessOf'.
621
- *
622
- * @param {ElementFinder} elementFinder The element to check
623
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
624
- * whether the element is invisible.
625
- */
626
- function invisibilityOf<T>(element: ElementFinder): webdriver.until.Condition<T>;
627
-
628
- /**
629
- * An expectation for checking the selection is selected.
630
- *
631
- * @param {ElementFinder} elementFinder The element to check
632
- * @return {!webdriver.until.Condition<boolean>} An expected condition that returns a promise representing
633
- * whether the element is selected.
634
- */
635
- function elementToBeSelected<T>(element: ElementFinder): webdriver.until.Condition<T>;
636
- }
637
-
638
- //endregion
639
-
640
- /**
641
- * Use as: element(locator)
642
- *
643
- * The ElementFinder can be treated as a WebElement for most purposes, in
644
- * particular, you may perform actions (i.e. click, getText) on them as you
645
- * would a WebElement. ElementFinders extend Promise, and once an action
646
- * is performed on an ElementFinder, the latest result from the chain can be
647
- * accessed using then. Unlike a WebElement, an ElementFinder will wait for
648
- * angular to settle before performing finds or actions.
649
- *
650
- * ElementFinder can be used to build a chain of locators that is used to find
651
- * an element. An ElementFinder does not actually attempt to find the element
652
- * until an action is called, which means they can be set up in helper files
653
- * before the page is available.
654
- *
655
- * @param {webdriver.Locator} locator An element locator.
656
- * @return {ElementFinder}
657
- */
658
- interface Element {
659
- (locator: webdriver.Locator): ElementFinder;
660
-
661
- /**
662
- * ElementArrayFinder is used for operations on an array of elements (as opposed
663
- * to a single element).
664
- *
665
- * @param {webdriver.Locator} locator An element locator.
666
- * @return {ElementArrayFinder}
667
- */
668
- all(locator: webdriver.Locator): ElementArrayFinder;
669
- }
670
-
671
- interface ElementFinder extends webdriver.IWebElement, webdriver.promise.IThenable<any> {
672
- /**
673
- * Calls to element may be chained to find elements within a parent.
674
- *
675
- * @alias element(locator).element(locator)
676
- * @view
677
- * <div class="parent">
678
- * <div class="child">
679
- * Child text
680
- * <div>{{person.phone}}</div>
681
- * </div>
682
- * </div>
683
- *
684
- * @example
685
- * // Chain 2 element calls.
686
- * var child = element(by.css('.parent')).
687
- * element(by.css('.child'));
688
- * expect(child.getText()).toBe('Child text\n555-123-4567');
689
- *
690
- * // Chain 3 element calls.
691
- * var triple = element(by.css('.parent')).
692
- * element(by.css('.child')).
693
- * element(by.binding('person.phone'));
694
- * expect(triple.getText()).toBe('555-123-4567');
695
- *
696
- * @param {webdriver.Locator} subLocator
697
- * @return {ElementFinder}
698
- */
699
- element(subLocator: webdriver.Locator): ElementFinder;
700
-
701
- /**
702
- * Calls to element may be chained to find an array of elements within a parent.
703
- *
704
- * @alias element(locator).all(locator)
705
- * @view
706
- * <div class="parent">
707
- * <ul>
708
- * <li class="one">First</li>
709
- * <li class="two">Second</li>
710
- * <li class="three">Third</li>
711
- * </ul>
712
- * </div>
713
- *
714
- * @example
715
- * var items = element(by.css('.parent')).all(by.tagName('li'))
716
- *
717
- * @param {webdriver.Locator} subLocator
718
- * @return {ElementArrayFinder}
719
- */
720
- all(subLocator: webdriver.Locator): ElementArrayFinder;
721
-
722
- /**
723
- * Shortcut for querying the document directly with css.
724
- *
725
- * @alias $(cssSelector)
726
- * @view
727
- * <div class="count">
728
- * <span class="one">First</span>
729
- * <span class="two">Second</span>
730
- * </div>
731
- *
732
- * @example
733
- * var item = $('.count .two');
734
- * expect(item.getText()).toBe('Second');
735
- *
736
- * @param {string} selector A css selector
737
- * @return {ElementFinder} which identifies the located
738
- * {@link webdriver.WebElement}
739
- */
740
- $(selector: string): ElementFinder;
741
-
742
- /**
743
- * Shortcut for querying the document directly with css.
744
- *
745
- * @alias $$(cssSelector)
746
- * @view
747
- * <div class="count">
748
- * <span class="one">First</span>
749
- * <span class="two">Second</span>
750
- * </div>
751
- *
752
- * @example
753
- * // The following protractor expressions are equivalent.
754
- * var list = element.all(by.css('.count span'));
755
- * expect(list.count()).toBe(2);
756
- *
757
- * list = $$('.count span');
758
- * expect(list.count()).toBe(2);
759
- * expect(list.get(0).getText()).toBe('First');
760
- * expect(list.get(1).getText()).toBe('Second');
761
- *
762
- * @param {string} selector a css selector
763
- * @return {ElementArrayFinder} which identifies the
764
- * array of the located {@link webdriver.WebElement}s.
765
- */
766
- $$(selector: string): ElementArrayFinder;
767
-
768
- /**
769
- * Determine whether the element is present on the page.
770
- *
771
- * @view
772
- * <span>{{person.name}}</span>
773
- *
774
- * @example
775
- * // Element exists.
776
- * expect(element(by.binding('person.name')).isPresent()).toBe(true);
777
- *
778
- * // Element not present.
779
- * expect(element(by.binding('notPresent')).isPresent()).toBe(false);
780
- *
781
- * @return {ElementFinder} which resolves to whether
782
- * the element is present on the page.
783
- */
784
- isPresent(): webdriver.promise.Promise<boolean>;
785
-
786
- /**
787
- * Override for WebElement.prototype.isElementPresent so that protractor waits
788
- * for Angular to settle before making the check.
789
- *
790
- * @see ElementFinder.isPresent
791
- *
792
- * @param {webdriver.Locator} subLocator Locator for element to look for.
793
- * @return {ElementFinder} which resolves to whether
794
- * the element is present on the page.
795
- */
796
- isElementPresent(subLocator: webdriver.Locator): webdriver.promise.Promise<boolean>;
797
-
798
- /**
799
- * @see ElementArrayFinder.prototype.locator
800
- *
801
- * @return {webdriver.Locator}
802
- */
803
- locator(): webdriver.Locator;
804
-
805
- /**
806
- * Returns the WebElement represented by this ElementFinder.
807
- * Throws the WebDriver error if the element doesn't exist.
808
- *
809
- * @example
810
- * The following three expressions are equivalent.
811
- * element(by.css('.parent')).getWebElement();
812
- * browser.waitForAngular(); browser.driver.findElement(by.css('.parent'));
813
- * browser.findElement(by.css('.parent'));
814
- *
815
- * @alias element(locator).getWebElement()
816
- * @return {webdriver.WebElement}
817
- */
818
- getWebElement(): webdriver.WebElement;
819
-
820
- /**
821
- * Evaluates the input as if it were on the scope of the current element.
822
- * @see ElementArrayFinder.evaluate
823
- *
824
- * @param {string} expression
825
- *
826
- * @return {ElementFinder} which resolves to the evaluated expression.
827
- */
828
- evaluate(expression: string): ElementFinder;
829
-
830
- /**
831
- * @see ElementArrayFinder.prototype.allowAnimations.
832
- * @param {string} value
833
- *
834
- * @return {ElementFinder} which resolves to whether animation is allowed.
835
- */
836
- allowAnimations(value: string): ElementFinder;
837
-
838
- /**
839
- * Create a shallow copy of ElementFinder.
840
- *
841
- * @return {!ElementFinder} A shallow copy of this.
842
- */
843
- clone(): ElementFinder;
844
- }
845
-
846
- interface ElementArrayFinder extends webdriver.promise.IThenable<ElementFinder[]> {
847
- /**
848
- * Returns the elements as an array of WebElements.
849
- */
850
- getWebElements(): webdriver.WebElement[];
851
-
852
-
853
- /**
854
- * Get an element within the ElementArrayFinder by index. The index starts at 0.
855
- * Negative indices are wrapped (i.e. -i means ith element from last)
856
- * This does not actually retrieve the underlying element.
857
- *
858
- * @alias element.all(locator).get(index)
859
- * @view
860
- * <ul class="items">
861
- * <li>First</li>
862
- * <li>Second</li>
863
- * <li>Third</li>
864
- * </ul>
865
- *
866
- * @example
867
- * var list = element.all(by.css('.items li'));
868
- * expect(list.get(0).getText()).toBe('First');
869
- * expect(list.get(1).getText()).toBe('Second');
870
- *
871
- * @param {number} index Element index.
872
- * @return {ElementFinder} finder representing element at the given index.
873
- */
874
- get(index: number): ElementFinder;
875
-
876
- /**
877
- * Get the first matching element for the ElementArrayFinder. This does not
878
- * actually retrieve the underlying element.
879
- *
880
- * @alias element.all(locator).first()
881
- * @view
882
- * <ul class="items">
883
- * <li>First</li>
884
- * <li>Second</li>
885
- * <li>Third</li>
886
- * </ul>
887
- *
888
- * @example
889
- * var first = element.all(by.css('.items li')).first();
890
- * expect(first.getText()).toBe('First');
891
- *
892
- * @return {ElementFinder} finder representing the first matching element
893
- */
894
- first(): ElementFinder;
895
-
896
- /**
897
- * Get the last matching element for the ElementArrayFinder. This does not
898
- * actually retrieve the underlying element.
899
- *
900
- * @alias element.all(locator).last()
901
- * @view
902
- * <ul class="items">
903
- * <li>First</li>
904
- * <li>Second</li>
905
- * <li>Third</li>
906
- * </ul>
907
- *
908
- * @example
909
- * var last = element.all(by.css('.items li')).last();
910
- * expect(last.getText()).toBe('Third');
911
- *
912
- * @return {ElementFinder} finder representing the last matching element
913
- */
914
- last(): ElementFinder;
915
-
916
- /**
917
- * Count the number of elements represented by the ElementArrayFinder.
918
- *
919
- * @alias element.all(locator).count()
920
- * @view
921
- * <ul class="items">
922
- * <li>First</li>
923
- * <li>Second</li>
924
- * <li>Third</li>
925
- * </ul>
926
- *
927
- * @example
928
- * var list = element.all(by.css('.items li'));
929
- * expect(list.count()).toBe(3);
930
- *
931
- * @return {!webdriver.promise.Promise} A promise which resolves to the
932
- * number of elements matching the locator.
933
- */
934
- count(): webdriver.promise.Promise<number>;
935
-
936
- /**
937
- * Calls the input function on each ElementFinder represented by the ElementArrayFinder.
938
- *
939
- * @alias element.all(locator).each(eachFunction)
940
- * @view
941
- * <ul class="items">
942
- * <li>First</li>
943
- * <li>Second</li>
944
- * <li>Third</li>
945
- * </ul>
946
- *
947
- * @example
948
- * element.all(by.css('.items li')).each(function(element) {
949
- * // Will print First, Second, Third.
950
- * element.getText().then(console.log);
951
- * });
952
- *
953
- * @param {function(ElementFinder)} fn Input function
954
- */
955
- each(fn: (element: ElementFinder, index: number) => void): void;
956
-
957
- /**
958
- * Apply a map function to each element within the ElementArrayFinder. The
959
- * callback receives the ElementFinder as the first argument and the index as
960
- * a second arg.
961
- *
962
- * @alias element.all(locator).map(mapFunction)
963
- * @view
964
- * <ul class="items">
965
- * <li class="one">First</li>
966
- * <li class="two">Second</li>
967
- * <li class="three">Third</li>
968
- * </ul>
969
- *
970
- * @example
971
- * var items = element.all(by.css('.items li')).map(function(elm, index) {
972
- * return {
973
- * index: index,
974
- * text: elm.getText(),
975
- * class: elm.getAttribute('class')
976
- * };
977
- * });
978
- * expect(items).toEqual([
979
- * {index: 0, text: 'First', class: 'one'},
980
- * {index: 1, text: 'Second', class: 'two'},
981
- * {index: 2, text: 'Third', class: 'three'}
982
- * ]);
983
- *
984
- * @param {function(ElementFinder, number)} mapFn Map function that
985
- * will be applied to each element.
986
- * @return {!webdriver.promise.Promise} A promise that resolves to an array
987
- * of values returned by the map function.
988
- */
989
- map<T>(mapFn: (element: ElementFinder, index: number) => T): webdriver.promise.Promise<T[]>;
990
- map<T, T2>(mapFn: (element: ElementFinder, index: number) => T2): webdriver.promise.Promise<T[]>;
991
-
992
- /**
993
- * Apply a filter function to each element within the ElementArrayFinder. Returns
994
- * a new ElementArrayFinder with all elements that pass the filter function. The
995
- * filter function receives the ElementFinder as the first argument
996
- * and the index as a second arg.
997
- * This does not actually retrieve the underlying list of elements, so it can
998
- * be used in page objects.
999
- *
1000
- * @alias element.all(locator).filter(filterFn)
1001
- * @view
1002
- * <ul class="items">
1003
- * <li class="one">First</li>
1004
- * <li class="two">Second</li>
1005
- * <li class="three">Third</li>
1006
- * </ul>
1007
- *
1008
- * @example
1009
- * element.all(by.css('.items li')).filter(function(elem, index) {
1010
- * return elem.getText().then(function(text) {
1011
- * return text === 'Third';
1012
- * });
1013
- * }).then(function(filteredElements) {
1014
- * filteredElements[0].click();
1015
- * });
1016
- *
1017
- * @param {function(ElementFinder, number): webdriver.WebElement.Promise} filterFn
1018
- * Filter function that will test if an element should be returned.
1019
- * filterFn can either return a boolean or a promise that resolves to a boolean.
1020
- * @return {!ElementArrayFinder} A ElementArrayFinder that represents an array
1021
- * of element that satisfy the filter function.
1022
- */
1023
- filter(filterFn: (element: ElementFinder, index: number) => any): ElementArrayFinder;
1024
-
1025
- /**
1026
- * Apply a reduce function against an accumulator and every element found
1027
- * using the locator (from left-to-right). The reduce function has to reduce
1028
- * every element into a single value (the accumulator). Returns promise of
1029
- * the accumulator. The reduce function receives the accumulator, current
1030
- * ElementFinder, the index, and the entire array of ElementFinders,
1031
- * respectively.
1032
- *
1033
- * @alias element.all(locator).reduce(reduceFn)
1034
- * @view
1035
- * <ul class="items">
1036
- * <li class="one">First</li>
1037
- * <li class="two">Second</li>
1038
- * <li class="three">Third</li>
1039
- * </ul>
1040
- *
1041
- * @example
1042
- * var value = element.all(by.css('.items li')).reduce(function(acc, elem) {
1043
- * return elem.getText().then(function(text) {
1044
- * return acc + text + ' ';
1045
- * });
1046
- * });
1047
- *
1048
- * expect(value).toEqual('First Second Third ');
1049
- *
1050
- * @param {function(number, ElementFinder, number, Array.<ElementFinder>)}
1051
- * reduceFn Reduce function that reduces every element into a single value.
1052
- * @param {*} initialValue Initial value of the accumulator.
1053
- * @return {!webdriver.promise.Promise} A promise that resolves to the final
1054
- * value of the accumulator.
1055
- */
1056
- reduce<T>(reduceFn: (acc: T, element: ElementFinder, index: number, arr: ElementFinder[]) => webdriver.promise.Promise<T>, initialValue: T): webdriver.promise.Promise<T>;
1057
- reduce<T>(reduceFn: (acc: T, element: ElementFinder, index: number, arr: ElementFinder[]) => T, initialValue: T): webdriver.promise.Promise<T>;
1058
-
1059
- /**
1060
- * Represents the ElementArrayFinder as an array of ElementFinders.
1061
- *
1062
- * @return {Array.<ElementFinder>} Return a promise, which resolves to a list
1063
- * of ElementFinders specified by the locator.
1064
- */
1065
- asElementFinders_(): webdriver.promise.Promise<ElementFinder[]>;
1066
-
1067
- /**
1068
- * Create a shallow copy of ElementArrayFinder.
1069
- *
1070
- * @return {!ElementArrayFinder} A shallow copy of this.
1071
- */
1072
- clone(): ElementArrayFinder;
1073
-
1074
- /**
1075
- * Calls to ElementArrayFinder may be chained to find an array of elements
1076
- * using the current elements in this ElementArrayFinder as the starting point.
1077
- * This function returns a new ElementArrayFinder which would contain the
1078
- * children elements found (and could also be empty).
1079
- *
1080
- * @alias element.all(locator).all(locator)
1081
- * @view
1082
- * <div id='id1' class="parent">
1083
- * <ul>
1084
- * <li class="foo">1a</li>
1085
- * <li class="baz">1b</li>
1086
- * </ul>
1087
- * </div>
1088
- * <div id='id2' class="parent">
1089
- * <ul>
1090
- * <li class="foo">2a</li>
1091
- * <li class="bar">2b</li>
1092
- * </ul>
1093
- * </div>
1094
- *
1095
- * @example
1096
- * var foo = element.all(by.css('.parent')).all(by.css('.foo'))
1097
- * expect(foo.getText()).toEqual(['1a', '2a'])
1098
- * var baz = element.all(by.css('.parent')).all(by.css('.baz'))
1099
- * expect(baz.getText()).toEqual(['1b'])
1100
- * var nonexistent = element.all(by.css('.parent')).all(by.css('.NONEXISTENT'))
1101
- * expect(nonexistent.getText()).toEqual([''])
1102
- *
1103
- * @param {webdriver.Locator} subLocator
1104
- * @return {ElementArrayFinder}
1105
- */
1106
- all(locator: webdriver.Locator): ElementArrayFinder;
1107
-
1108
- /**
1109
- * Shorthand function for finding arrays of elements by css.
1110
- *
1111
- * @type {function(string): ElementArrayFinder}
1112
- */
1113
- $$(selector: string): ElementArrayFinder;
1114
-
1115
- /**
1116
- * Returns an ElementFinder representation of ElementArrayFinder. It ensures
1117
- * that the ElementArrayFinder resolves to one and only one underlying element.
1118
- *
1119
- * @return {ElementFinder} An ElementFinder representation
1120
- * @private
1121
- */
1122
- toElementFinder_(): ElementFinder;
1123
-
1124
- /**
1125
- * Returns the most relevant locator.
1126
- *
1127
- * @example
1128
- * $('#ID1').locator() // returns by.css('#ID1')
1129
- * $('#ID1').$('#ID2').locator() // returns by.css('#ID2')
1130
- * $$('#ID1').filter(filterFn).get(0).click().locator() // returns by.css('#ID1')
1131
- *
1132
- * @return {webdriver.Locator}
1133
- */
1134
- locator(): webdriver.Locator;
1135
-
1136
- /**
1137
- * Evaluates the input as if it were on the scope of the current underlying
1138
- * elements.
1139
- *
1140
- * @view
1141
- * <span id="foo">{{variableInScope}}</span>
1142
- *
1143
- * @example
1144
- * var value = element(by.id('foo')).evaluate('variableInScope');
1145
- *
1146
- * @param {string} expression
1147
- *
1148
- * @return {ElementArrayFinder} which resolves to the
1149
- * evaluated expression for each underlying element.
1150
- * The result will be resolved as in
1151
- * {@link webdriver.WebDriver.executeScript}. In summary - primitives will
1152
- * be resolved as is, functions will be converted to string, and elements
1153
- * will be returned as a WebElement.
1154
- */
1155
- evaluate(expression: string): ElementArrayFinder;
1156
-
1157
- /**
1158
- * Determine if animation is allowed on the current underlying elements.
1159
- * @param {string} value
1160
- *
1161
- * @example
1162
- * // Turns off ng-animate animations for all elements in the <body>
1163
- * element(by.css('body')).allowAnimations(false);
1164
- *
1165
- * @return {ElementArrayFinder} which resolves to whether animation is allowed.
1166
- */
1167
- allowAnimations(value: boolean): ElementArrayFinder;
1168
-
1169
- /**
1170
- * Schedules a command to click on this element.
1171
- * @return {!webdriver.promise.Promise} A promise that will be resolved when
1172
- * the click command has completed.
1173
- */
1174
- click(): webdriver.promise.Promise<void>;
1175
-
1176
- /**
1177
- * Schedules a command to type a sequence on the DOM element represented by this
1178
- * instance.
1179
- * <p/>
1180
- * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is
1181
- * processed in the keysequence, that key state is toggled until one of the
1182
- * following occurs:
1183
- * <ul>
1184
- * <li>The modifier key is encountered again in the sequence. At this point the
1185
- * state of the key is toggled (along with the appropriate keyup/down events).
1186
- * </li>
1187
- * <li>The {@code webdriver.Key.NULL} key is encountered in the sequence. When
1188
- * this key is encountered, all modifier keys current in the down state are
1189
- * released (with accompanying keyup events). The NULL key can be used to
1190
- * simulate common keyboard shortcuts:
1191
- * <code>
1192
- * element.sendKeys("text was",
1193
- * webdriver.Key.CONTROL, "a", webdriver.Key.NULL,
1194
- * "now text is");
1195
- * // Alternatively:
1196
- * element.sendKeys("text was",
1197
- * webdriver.Key.chord(webdriver.Key.CONTROL, "a"),
1198
- * "now text is");
1199
- * </code></li>
1200
- * <li>The end of the keysequence is encountered. When there are no more keys
1201
- * to type, all depressed modifier keys are released (with accompanying keyup
1202
- * events).
1203
- * </li>
1204
- * </ul>
1205
- * <strong>Note:</strong> On browsers where native keyboard events are not yet
1206
- * supported (e.g. Firefox on OS X), key events will be synthesized. Special
1207
- * punctionation keys will be synthesized according to a standard QWERTY en-us
1208
- * keyboard layout.
1209
- *
1210
- * @param {...string} var_args The sequence of keys to
1211
- * type. All arguments will be joined into a single sequence (var_args is
1212
- * permitted for convenience).
1213
- * @return {!webdriver.promise.Promise} A promise that will be resolved when all
1214
- * keys have been typed.
1215
- */
1216
- sendKeys(...var_args: string[]): webdriver.promise.Promise<void>;
1217
-
1218
- /**
1219
- * Schedules a command to query for the tag/node name of this element.
1220
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
1221
- * element's tag name.
1222
- */
1223
- getTagName(): webdriver.promise.Promise<string[]>;
1224
-
1225
- /**
1226
- * Schedules a command to query for the computed style of the element
1227
- * represented by this instance. If the element inherits the named style from
1228
- * its parent, the parent will be queried for its value. Where possible, color
1229
- * values will be converted to their hex representation (e.g. #00ff00 instead of
1230
- * rgb(0, 255, 0)).
1231
- * <p/>
1232
- * <em>Warning:</em> the value returned will be as the browser interprets it, so
1233
- * it may be tricky to form a proper assertion.
1234
- *
1235
- * @param {string} cssStyleProperty The name of the CSS style property to look
1236
- * up.
1237
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
1238
- * requested CSS value.
1239
- */
1240
- getCssValue(cssStyleProperty: string): webdriver.promise.Promise<string[]>;
1241
-
1242
- /**
1243
- * Schedules a command to query for the value of the given attribute of the
1244
- * element. Will return the current value even if it has been modified after the
1245
- * page has been loaded. More exactly, this method will return the value of the
1246
- * given attribute, unless that attribute is not present, in which case the
1247
- * value of the property with the same name is returned. If neither value is
1248
- * set, null is returned. The "style" attribute is converted as best can be to a
1249
- * text representation with a trailing semi-colon. The following are deemed to
1250
- * be "boolean" attributes and will be returned as thus:
1251
- *
1252
- * <p>async, autofocus, autoplay, checked, compact, complete, controls, declare,
1253
- * defaultchecked, defaultselected, defer, disabled, draggable, ended,
1254
- * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope,
1255
- * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open,
1256
- * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking,
1257
- * selected, spellcheck, truespeed, willvalidate
1258
- *
1259
- * <p>Finally, the following commonly mis-capitalized attribute/property names
1260
- * are evaluated as expected:
1261
- * <ul>
1262
- * <li>"class"
1263
- * <li>"readonly"
1264
- * </ul>
1265
- * @param {string} attributeName The name of the attribute to query.
1266
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
1267
- * attribute's value.
1268
- */
1269
- getAttribute(attributeName: string): webdriver.promise.Promise<string[]>;
1270
-
1271
- /**
1272
- * Get the visible (i.e. not hidden by CSS) innerText of this element, including
1273
- * sub-elements, without any leading or trailing whitespace.
1274
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
1275
- * element's visible text.
1276
- */
1277
- getText(): webdriver.promise.Promise<string[]>;
1278
-
1279
- /**
1280
- * Schedules a command to compute the size of this element's bounding box, in
1281
- * pixels.
1282
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
1283
- * element's size as a {@code {width:number, height:number}} object.
1284
- */
1285
- getSize(): webdriver.promise.Promise<webdriver.ISize[]>;
1286
-
1287
- /**
1288
- * Schedules a command to compute the location of this element in page space.
1289
- * @return {!webdriver.promise.Promise} A promise that will be resolved to the
1290
- * element's location as a {@code {x:number, y:number}} object.
1291
- */
1292
- getLocation(): webdriver.promise.Promise<webdriver.ILocation[]>;
1293
-
1294
- /**
1295
- * Schedules a command to query whether the DOM element represented by this
1296
- * instance is enabled, as dicted by the {@code disabled} attribute.
1297
- * @return {!webdriver.promise.Promise} A promise that will be resolved with
1298
- * whether this element is currently enabled.
1299
- */
1300
- isEnabled(): webdriver.promise.Promise<boolean[]>;
1301
-
1302
- /**
1303
- * Schedules a command to query whether this element is selected.
1304
- * @return {!webdriver.promise.Promise} A promise that will be resolved with
1305
- * whether this element is currently selected.
1306
- */
1307
- isSelected(): webdriver.promise.Promise<boolean[]>;
1308
-
1309
- /**
1310
- * Schedules a command to submit the form containing this element (or this
1311
- * element if it is a FORM element). This command is a no-op if the element is
1312
- * not contained in a form.
1313
- * @return {!webdriver.promise.Promise} A promise that will be resolved when
1314
- * the form has been submitted.
1315
- */
1316
- submit(): webdriver.promise.Promise<void>;
1317
-
1318
- /**
1319
- * Schedules a command to clear the {@code value} of this element. This command
1320
- * has no effect if the underlying DOM element is neither a text INPUT element
1321
- * nor a TEXTAREA element.
1322
- * @return {!webdriver.promise.Promise} A promise that will be resolved when
1323
- * the element has been cleared.
1324
- */
1325
- clear(): webdriver.promise.Promise<void>;
1326
-
1327
- /**
1328
- * Schedules a command to test whether this element is currently displayed.
1329
- * @return {!webdriver.promise.Promise} A promise that will be resolved with
1330
- * whether this element is currently visible on the page.
1331
- */
1332
- isDisplayed(): webdriver.promise.Promise<boolean[]>;
1333
-
1334
- /**
1335
- * Schedules a command to retrieve the outer HTML of this element.
1336
- * @return {!webdriver.promise.Promise} A promise that will be resolved with
1337
- * the element's outer HTML.
1338
- */
1339
- getOuterHtml(): webdriver.promise.Promise<string[]>;
1340
-
1341
- /**
1342
- * @return {!webdriver.promise.Promise.<webdriver.WebElement.Id>} A promise
1343
- * that resolves to this element's JSON representation as defined by the
1344
- * WebDriver wire protocol.
1345
- * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol
1346
- */
1347
- getId(): webdriver.promise.Promise<webdriver.IWebElementId[]>
1348
-
1349
- /**
1350
- * Schedules a command to retrieve the inner HTML of this element.
1351
- * @return {!webdriver.promise.Promise} A promise that will be resolved with the
1352
- * element's inner HTML.
1353
- */
1354
- getInnerHtml(): webdriver.promise.Promise<string[]>;
1355
- }
1356
-
1357
- interface LocatorWithColumn extends webdriver.Locator {
1358
- column(index: number): webdriver.Locator;
1359
- column(name: string): webdriver.Locator;
1360
- }
1361
-
1362
- interface RepeaterLocator extends LocatorWithColumn {
1363
- row(index: number): LocatorWithColumn;
1364
- }
1365
-
1366
- interface IProtractorLocatorStrategy {
1367
- /**
1368
- * webdriver's By is an enum of locator functions, so we must set it to
1369
- * a prototype before inheriting from it.
1370
- */
1371
- className: typeof webdriver.By.className;
1372
- css: typeof webdriver.By.css;
1373
- id: typeof webdriver.By.id;
1374
- linkText: typeof webdriver.By.linkText;
1375
- js: typeof webdriver.By.js;
1376
- name: typeof webdriver.By.name;
1377
- partialLinkText: typeof webdriver.By.partialLinkText;
1378
- tagName: typeof webdriver.By.tagName;
1379
- xpath: typeof webdriver.By.xpath;
1380
-
1381
- /**
1382
- * Add a locator to this instance of ProtractorBy. This locator can then be
1383
- * used with element(by.locatorName(args)).
1384
- *
1385
- * @view
1386
- * <button ng-click="doAddition()">Go!</button>
1387
- *
1388
- * @example
1389
- * // Add the custom locator.
1390
- * by.addLocator('buttonTextSimple',
1391
- * function(buttonText, opt_parentElement, opt_rootSelector) {
1392
- * // This function will be serialized as a string and will execute in the
1393
- * // browser. The first argument is the text for the button. The second
1394
- * // argument is the parent element, if any.
1395
- * var using = opt_parentElement,
1396
- * buttons = using.querySelectorAll('button');
1397
- *
1398
- * // Return an array of buttons with the text.
1399
- * return Array.prototype.filter.call(buttons, function(button) {
1400
- * return button.textContent === buttonText;
1401
- * });
1402
- * });
1403
- *
1404
- * // Use the custom locator.
1405
- * element(by.buttonTextSimple('Go!')).click();
1406
- *
1407
- * @alias by.addLocator(locatorName, functionOrScript)
1408
- * @param {string} name The name of the new locator.
1409
- * @param {Function|string} script A script to be run in the context of
1410
- * the browser. This script will be passed an array of arguments
1411
- * that contains any args passed into the locator followed by the
1412
- * element scoping the search and the css selector for the root angular
1413
- * element. It should return an array of elements.
1414
- */
1415
- addLocator(name: string, script: string): void;
1416
- addLocator(name: string, script: Function): void;
1417
-
1418
- /**
1419
- * Find an element by binding.
1420
- *
1421
- * @view
1422
- * <span>{{person.name}}</span>
1423
- * <span ng-bind="person.email"></span>
1424
- *
1425
- * @example
1426
- * var span1 = element(by.binding('person.name'));
1427
- * expect(span1.getText()).toBe('Foo');
1428
- *
1429
- * var span2 = element(by.binding('person.email'));
1430
- * expect(span2.getText()).toBe('foo@bar.com');
1431
- *
1432
- * @param {string} bindingDescriptor
1433
- * @return {{findElementsOverride: findElementsOverride, toString: Function|string}}
1434
- */
1435
- binding(bindingDescriptor: string): webdriver.Locator;
1436
-
1437
- /**
1438
- * Find an element by exact binding.
1439
- *
1440
- * @view
1441
- * <span>{{ person.name }}</span>
1442
- * <span ng-bind="person-email"></span>
1443
- * <span>{{person_phone|uppercase}}</span>
1444
- *
1445
- * @example
1446
- * expect(element(by.exactBinding('person.name')).isPresent()).toBe(true);
1447
- * expect(element(by.exactBinding('person-email')).isPresent()).toBe(true);
1448
- * expect(element(by.exactBinding('person')).isPresent()).toBe(false);
1449
- * expect(element(by.exactBinding('person_phone')).isPresent()).toBe(true);
1450
- * expect(element(by.exactBinding('person_phone|uppercase')).isPresent()).toBe(true);
1451
- * expect(element(by.exactBinding('phone')).isPresent()).toBe(false);
1452
- *
1453
- * @param {string} bindingDescriptor
1454
- * @return {{findElementsOverride: findElementsOverride, toString: Function|string}}
1455
- */
1456
- exactBinding(bindingDescriptor: string): webdriver.Locator;
1457
-
1458
- /**
1459
- * Find an element by ng-model expression.
1460
- *
1461
- * @alias by.model(modelName)
1462
- * @view
1463
- * <input type="text" ng-model="person.name"/>
1464
- *
1465
- * @example
1466
- * var input = element(by.model('person.name'));
1467
- * input.sendKeys('123');
1468
- * expect(input.getAttribute('value')).toBe('Foo123');
1469
- *
1470
- * @param {string} model ng-model expression.
1471
- */
1472
- model(model: string): webdriver.Locator;
1473
-
1474
- /**
1475
- * Find a button by text.
1476
- *
1477
- * @view
1478
- * <button>Save</button>
1479
- *
1480
- * @example
1481
- * element(by.buttonText('Save'));
1482
- *
1483
- * @param {string} searchText
1484
- * @return {{findElementsOverride: findElementsOverride, toString: Function|string}}
1485
- */
1486
- buttonText(searchText: string): webdriver.Locator;
1487
-
1488
- /**
1489
- * Find a button by partial text.
1490
- *
1491
- * @view
1492
- * <button>Save my file</button>
1493
- *
1494
- * @example
1495
- * element(by.partialButtonText('Save'));
1496
- *
1497
- * @param {string} searchText
1498
- * @return {{findElementsOverride: findElementsOverride, toString: Function|string}}
1499
- */
1500
- partialButtonText(searchText: string): webdriver.Locator;
1501
-
1502
-
1503
- /**
1504
- * Find elements inside an ng-repeat.
1505
- *
1506
- * @view
1507
- * <div ng-repeat="cat in pets">
1508
- * <span>{{cat.name}}</span>
1509
- * <span>{{cat.age}}</span>
1510
- * </div>
1511
- *
1512
- * <div class="book-img" ng-repeat-start="book in library">
1513
- * <span>{{$index}}</span>
1514
- * </div>
1515
- * <div class="book-info" ng-repeat-end>
1516
- * <h4>{{book.name}}</h4>
1517
- * <p>{{book.blurb}}</p>
1518
- * </div>
1519
- *
1520
- * @example
1521
- * // Returns the DIV for the second cat.
1522
- * var secondCat = element(by.repeater('cat in pets').row(1));
1523
- *
1524
- * // Returns the SPAN for the first cat's name.
1525
- * var firstCatName = element(by.repeater('cat in pets').
1526
- * row(0).column('{{cat.name}}'));
1527
- *
1528
- * // Returns a promise that resolves to an array of WebElements from a column
1529
- * var ages = element.all(
1530
- * by.repeater('cat in pets').column('{{cat.age}}'));
1531
- *
1532
- * // Returns a promise that resolves to an array of WebElements containing
1533
- * // all top level elements repeated by the repeater. For 2 pets rows resolves
1534
- * // to an array of 2 elements.
1535
- * var rows = element.all(by.repeater('cat in pets'));
1536
- *
1537
- * // Returns a promise that resolves to an array of WebElements containing all
1538
- * // the elements with a binding to the book's name.
1539
- * var divs = element.all(by.repeater('book in library').column('book.name'));
1540
- *
1541
- * // Returns a promise that resolves to an array of WebElements containing
1542
- * // the DIVs for the second book.
1543
- * var bookInfo = element.all(by.repeater('book in library').row(1));
1544
- *
1545
- * // Returns the H4 for the first book's name.
1546
- * var firstBookName = element(by.repeater('book in library').
1547
- * row(0).column('{{book.name}}'));
1548
- *
1549
- * // Returns a promise that resolves to an array of WebElements containing
1550
- * // all top level elements repeated by the repeater. For 2 books divs
1551
- * // resolves to an array of 4 elements.
1552
- * var divs = element.all(by.repeater('book in library'));
1553
- */
1554
- repeater(repeatDescriptor: string): RepeaterLocator;
1555
-
1556
- /**
1557
- * Find elements by CSS which contain a certain string.
1558
- *
1559
- * @view
1560
- * <ul>
1561
- * <li class="pet">Dog</li>
1562
- * <li class="pet">Cat</li>
1563
- * </ul>
1564
- *
1565
- * @example
1566
- * // Returns the DIV for the dog, but not cat.
1567
- * var dog = element(by.cssContainingText('.pet', 'Dog'));
1568
- */
1569
- cssContainingText(cssSelector: string, searchText: string): webdriver.Locator;
1570
-
1571
- /**
1572
- * Find an element by ng-options expression.
1573
- *
1574
- * @alias by.options(optionsDescriptor)
1575
- * @view
1576
- * <select ng-model="color" ng-options="c for c in colors">
1577
- * <option value="0" selected="selected">red</option>
1578
- * <option value="1">green</option>
1579
- * </select>
1580
- *
1581
- * @example
1582
- * var allOptions = element.all(by.options('c for c in colors'));
1583
- * expect(allOptions.count()).toEqual(2);
1584
- * var firstOption = allOptions.first();
1585
- * expect(firstOption.getText()).toEqual('red');
1586
- *
1587
- * @param {string} optionsDescriptor ng-options expression.
1588
- */
1589
- options(optionsDescriptor: string): webdriver.Locator;
1590
- }
1591
-
1592
- var By: IProtractorLocatorStrategy;
1593
-
1594
- interface Protractor extends webdriver.WebDriver {
1595
-
1596
- /**
1597
- * The wrapped webdriver instance. Use this to interact with pages that do
1598
- * not contain Angular (such as a log-in screen).
1599
- *
1600
- * @type {webdriver.WebDriver}
1601
- */
1602
- driver: webdriver.WebDriver;
1603
-
1604
- /**
1605
- * Helper function for finding elements.
1606
- *
1607
- * @type {function(webdriver.Locator): ElementFinder}
1608
- */
1609
- element(locator: webdriver.Locator): ElementFinder;
1610
-
1611
- /**
1612
- * Shorthand function for finding elements by css.
1613
- *
1614
- * @type {function(string): ElementFinder}
1615
- */
1616
- $(selector: string): ElementFinder;
1617
-
1618
- /**
1619
- * Shorthand function for finding arrays of elements by css.
1620
- *
1621
- * @type {function(string): ElementArrayFinder}
1622
- */
1623
- $$(selector: string): ElementArrayFinder;
1624
-
1625
- /**
1626
- * All get methods will be resolved against this base URL. Relative URLs are =
1627
- * resolved the way anchor tags resolve.
1628
- *
1629
- * @type {string}
1630
- */
1631
- baseUrl: string;
1632
-
1633
- /**
1634
- * The css selector for an element on which to find Angular. This is usually
1635
- * 'body' but if your ng-app is on a subsection of the page it may be
1636
- * a subelement.
1637
- *
1638
- * @type {string}
1639
- */
1640
- rootEl: string;
1641
-
1642
- /**
1643
- * If true, Protractor will not attempt to synchronize with the page before
1644
- * performing actions. This can be harmful because Protractor will not wait
1645
- * until $timeouts and $http calls have been processed, which can cause
1646
- * tests to become flaky. This should be used only when necessary, such as
1647
- * when a page continuously polls an API using $timeout.
1648
- *
1649
- * @type {boolean}
1650
- */
1651
- ignoreSynchronization: boolean;
1652
-
1653
- /**
1654
- * Timeout in milliseconds to wait for pages to load when calling `get`.
1655
- *
1656
- * @type {number}
1657
- */
1658
- getPageTimeout: number;
1659
-
1660
- /**
1661
- * An object that holds custom test parameters.
1662
- *
1663
- * @type {Object}
1664
- */
1665
- params: any;
1666
-
1667
- /**
1668
- * The reset URL to use between page loads.
1669
- *
1670
- * @type {string}
1671
- */
1672
- resetUrl: string;
1673
-
1674
- /**
1675
- * Instruct webdriver to wait until Angular has finished rendering and has
1676
- * no outstanding $http calls before continuing.
1677
- *
1678
- * @return {!webdriver.promise.Promise} A promise that will resolve to the
1679
- * scripts return value.
1680
- */
1681
- waitForAngular(): webdriver.promise.Promise<any>;
1682
-
1683
- /**
1684
- * Add a module to load before Angular whenever Protractor.get is called.
1685
- * Modules will be registered after existing modules already on the page,
1686
- * so any module registered here will override preexisting modules with the same
1687
- * name.
1688
- *
1689
- * @example
1690
- * browser.addMockModule('modName', function() {
1691
- * angular.module('modName', []).value('foo', 'bar');
1692
- * });
1693
- *
1694
- * @param {!string} name The name of the module to load or override.
1695
- * @param {!string|Function} script The JavaScript to load the module.
1696
- * @param {...*} varArgs Any additional arguments will be provided to
1697
- * the script and may be referenced using the `arguments` object.
1698
- */
1699
- addMockModule(name: string, script: string, ...varArgs: any[]): void;
1700
- addMockModule(name: string, script: Function, ...varArgs: any[]): void;
1701
-
1702
- /**
1703
- * Clear the list of registered mock modules.
1704
- */
1705
- clearMockModules(): void;
1706
-
1707
- /**
1708
- * Remove a registered mock module.
1709
- *
1710
- * @example
1711
- * browser.removeMockModule('modName');
1712
- *
1713
- * @param {!string} name The name of the module to remove.
1714
- */
1715
- removeMockModule(name: string): void;
1716
-
1717
- /**
1718
- * @see webdriver.WebDriver.get
1719
- *
1720
- * Navigate to the given destination and loads mock modules before
1721
- * Angular. Assumes that the page being loaded uses Angular.
1722
- * If you need to access a page which does not have Angular on load, use
1723
- * the wrapped webdriver directly.
1724
- *
1725
- * @param {string} destination Destination URL.
1726
- * @param {number=} opt_timeout Number of milliseconds to wait for Angular to
1727
- * start.
1728
- */
1729
- get(destination: string, opt_timeout?: number): webdriver.promise.Promise<void>;
1730
-
1731
- /**
1732
- * See webdriver.WebDriver.refresh
1733
- *
1734
- * Makes a full reload of the current page and loads mock modules before
1735
- * Angular. Assumes that the page being loaded uses Angular.
1736
- * If you need to access a page which does not have Angular on load, use
1737
- * the wrapped webdriver directly.
1738
- *
1739
- * @param {number=} opt_timeout Number of seconds to wait for Angular to start.
1740
- */
1741
- refresh(opt_timeout?: number): webdriver.promise.Promise<void>;
1742
-
1743
- /**
1744
- * Browse to another page using in-page navigation.
1745
- *
1746
- * @param {string} url In page URL using the same syntax as $location.url()
1747
- * @returns {!webdriver.promise.Promise} A promise that will resolve once
1748
- * page has been changed.
1749
- */
1750
- setLocation(url: string): webdriver.promise.Promise<void>;
1751
-
1752
- /**
1753
- * Returns the current absolute url from AngularJS.
1754
- */
1755
- getLocationAbsUrl(): webdriver.promise.Promise<string>;
1756
-
1757
- /**
1758
- * Pauses the test and injects some helper functions into the browser, so that
1759
- * debugging may be done in the browser console.
1760
- *
1761
- * This should be used under node in debug mode, i.e. with
1762
- * protractor debug <configuration.js>
1763
- *
1764
- * @example
1765
- * While in the debugger, commands can be scheduled through webdriver by
1766
- * entering the repl:
1767
- * debug> repl
1768
- * Press Ctrl + C to leave rdebug repl
1769
- * > ptor.findElement(protractor.By.input('user').sendKeys('Laura'));
1770
- * > ptor.debugger();
1771
- * debug> c
1772
- *
1773
- * This will run the sendKeys command as the next task, then re-enter the
1774
- * debugger.
1775
- */
1776
- debugger(): void;
1777
-
1778
- /**
1779
- * Beta (unstable) pause function for debugging webdriver tests. Use
1780
- * browser.pause() in your test to enter the protractor debugger from that
1781
- * point in the control flow.
1782
- * Does not require changes to the command line (no need to add 'debug').
1783
- *
1784
- * @example
1785
- * element(by.id('foo')).click();
1786
- * browser.pause();
1787
- * // Execution will stop before the next click action.
1788
- * element(by.id('bar')).click();
1789
- *
1790
- * @param {number=} opt_debugPort Optional port to use for the debugging process
1791
- */
1792
- pause(opt_debugPort?: number): void;
1793
- }
1794
-
1795
- // Interface for the global browser object.
1796
- interface IBrowser extends Protractor {
1797
- /**
1798
- * Fork another instance of protractor for use in interactive tests.
1799
- *
1800
- * @param {boolean} opt_useSameUrl Whether to navigate to current url on creation
1801
- * @param {boolean} opt_copyMockModules Whether to apply same mock modules on creation
1802
- * @return {Protractor} a protractor instance.
1803
- */
1804
- forkNewDriverInstance(opt_useSameUrl?: boolean, opt_copyMockModules?: boolean): Protractor;
1805
-
1806
- /**
1807
- * Get the processed configuration object that is currently being run. This will contain
1808
- * the specs and capabilities properties of the current runner instance.
1809
- *
1810
- * Set by the runner.
1811
- *
1812
- * @return {webdriver.promise.Promise<any>} A promise which resolves to the capabilities object.
1813
- */
1814
- getProcessedConfig(): webdriver.promise.Promise<any>;
1815
- }
1816
-
1817
- /**
1818
- * Create a new instance of Protractor by wrapping a webdriver instance.
1819
- *
1820
- * @param {webdriver.WebDriver} webdriver The configured webdriver instance.
1821
- * @param {string=} opt_baseUrl A URL to prepend to relative gets.
1822
- * @return {Protractor}
1823
- */
1824
- function wrapDriver(webdriver: webdriver.WebDriver, opt_baseUrl?: string, opt_rootElement?: string): Protractor;
1825
- }
1826
-
1827
- interface cssSelectorHelper {
1828
- (cssLocator: string): protractor.ElementFinder;
1829
- }
1830
-
1831
- interface cssArraySelectorHelper {
1832
- (cssLocator: string): protractor.ElementArrayFinder;
1833
- }
1834
-
1835
- declare var browser: protractor.IBrowser;
1836
- declare var by: protractor.IProtractorLocatorStrategy;
1837
- declare var By: protractor.IProtractorLocatorStrategy;
1838
- declare var element: protractor.Element;
1839
- declare var $: cssSelectorHelper;
1840
- declare var $$: cssArraySelectorHelper;
1841
-
1842
- declare module 'protractor' {
1843
- export = protractor;
1844
- }