@@ -30,11 +30,11 @@ export interface ProtractorPlugin {
30
30
* @throws {* } If this function throws an error, a failed assertion is added to
31
31
* the test results.
32
32
*
33
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
33
+ * @return {Promise= } Can return a promise, in which case protractor will wait
34
34
* for the promise to resolve before continuing. If the promise is
35
35
* rejected, a failed assertion is added to the test results.
36
36
*/
37
- setup ?: ( ) => q . Promise < any > ;
37
+ setup ?( ) : void | Promise < void > ;
38
38
39
39
/**
40
40
* This is called before the test have been run but after the test framework has
@@ -46,11 +46,11 @@ export interface ProtractorPlugin {
46
46
* @throws {* } If this function throws an error, a failed assertion is added to
47
47
* the test results.
48
48
*
49
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
49
+ * @return {Promise= } Can return a promise, in which case protractor will wait
50
50
* for the promise to resolve before continuing. If the promise is
51
51
* rejected, a failed assertion is added to the test results.
52
52
*/
53
- onPrepare ?: ( ) => q . Promise < any > ;
53
+ onPrepare ?( ) : void | Promise < void > ;
54
54
55
55
/**
56
56
* This is called after the tests have been run, but before the WebDriver
@@ -61,11 +61,11 @@ export interface ProtractorPlugin {
61
61
* @throws {* } If this function throws an error, a failed assertion is added to
62
62
* the test results.
63
63
*
64
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
64
+ * @return {Promise= } Can return a promise, in which case protractor will wait
65
65
* for the promise to resolve before continuing. If the promise is
66
66
* rejected, a failed assertion is added to the test results.
67
67
*/
68
- teardown ?: ( ) => q . Promise < any > ;
68
+ teardown ?( ) : void | Promise < void > ;
69
69
70
70
/**
71
71
* Called after the test results have been finalized and any jobs have been
@@ -75,11 +75,11 @@ export interface ProtractorPlugin {
75
75
*
76
76
* @throws {* } If this function throws an error, it is outputted to the console
77
77
*
78
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
78
+ * @return {Promise= } Can return a promise, in which case protractor will wait
79
79
* for the promise to resolve before continuing. If the promise is
80
80
* rejected, an error is logged to the console.
81
81
*/
82
- postResults ?: ( ) => q . Promise < any > ;
82
+ postResults ?( ) : void | Promise < void > ;
83
83
84
84
/**
85
85
* Called after each test block (in Jasmine, this means an `it` block)
@@ -93,12 +93,12 @@ export interface ProtractorPlugin {
93
93
* @throws {* } If this function throws an error, a failed assertion is added to
94
94
* the test results.
95
95
*
96
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
96
+ * @return {Promise= } Can return a promise, in which case protractor will wait
97
97
* for the promise to resolve before outputting test results. Protractor
98
98
* will *not* wait before executing the next test, however. If the promise
99
99
* is rejected, a failed assertion is added to the test results.
100
100
*/
101
- postTest ?: ( passed : boolean , testInfo : any ) => q . Promise < any > ;
101
+ postTest ?( passed : boolean , testInfo : any ) : void | Promise < void > ;
102
102
103
103
/**
104
104
* This is called inside browser.get() directly after the page loads, and before
@@ -109,11 +109,11 @@ export interface ProtractorPlugin {
109
109
* @throws {* } If this function throws an error, a failed assertion is added to
110
110
* the test results.
111
111
*
112
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
113
- * for the promise to resolve before continuing. If the promise is
114
- * rejected, a failed assertion is added to the test results.
112
+ * @return {webdriver.promise. Promise= } Can return a promise, in which case
113
+ * protractor will wait for the promise to resolve before continuing. If
114
+ * the promise is rejected, a failed assertion is added to the test results.
115
115
*/
116
- onPageLoad ?: ( ) => q . Promise < any > ;
116
+ onPageLoad ?( ) : void | webdriver . promise . Promise < void > ;
117
117
118
118
/**
119
119
* This is called inside browser.get() directly after angular is done
@@ -125,11 +125,11 @@ export interface ProtractorPlugin {
125
125
* @throws {* } If this function throws an error, a failed assertion is added to
126
126
* the test results.
127
127
*
128
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
129
- * for the promise to resolve before continuing. If the promise is
130
- * rejected, a failed assertion is added to the test results.
128
+ * @return {webdriver.promise. Promise= } Can return a promise, in which case
129
+ * protractor will wait for the promise to resolve before continuing. If
130
+ * the promise is rejected, a failed assertion is added to the test results.
131
131
*/
132
- onPageStable ?: ( ) => q . Promise < any > ;
132
+ onPageStable ?( ) : void | webdriver . promise . Promise < void > ;
133
133
134
134
/**
135
135
* Between every webdriver action, Protractor calls browser.waitForAngular() to
@@ -142,33 +142,34 @@ export interface ProtractorPlugin {
142
142
* @throws {* } If this function throws an error, a failed assertion is added to
143
143
* the test results.
144
144
*
145
- * @return {Q. Promise= } Can return a promise, in which case protractor will wait
146
- * for the promise to resolve before continuing. If the promise is
147
- * rejected, a failed assertion is added to the test results, and protractor
148
- * will continue onto the next command. If nothing is returned or something
149
- * other than a promise is returned, protractor will continue onto the next
150
- * command.
145
+ * @return {webdriver.promise. Promise= } Can return a promise, in which case
146
+ * protractor will wait for the promise to resolve before continuing. If the
147
+ * promise is rejected, a failed assertion is added to the test results, and
148
+ * protractor will continue onto the next command. If nothing is returned or
149
+ * something other than a promise is returned, protractor will continue
150
+ * onto the next command.
151
151
*/
152
- waitForPromise ?: ( ) => q . Promise < any > ;
152
+ waitForPromise ?( ) : webdriver . promise . Promise < void > ;
153
153
154
154
/**
155
155
* Between every webdriver action, Protractor calls browser.waitForAngular() to
156
156
* make sure that Angular has no outstanding $http or $timeout calls.
157
157
* You can use waitForCondition() to have Protractor additionally wait for your
158
- * custom condition to be truthy.
158
+ * custom condition to be truthy. If specified, this function will be called
159
+ * repeatedly until truthy.
159
160
*
160
161
* @this {Object} bound to module.exports
161
162
*
162
163
* @throws {* } If this function throws an error, a failed assertion is added to
163
164
* the test results.
164
165
*
165
- * @return {Q. Promise<boolean>|boolean } If truthy, Protractor will continue onto
166
- * the next command. If falsy, webdriver will continuously re-run this
167
- * function until it is truthy. If a rejected promise is returned, a failed
168
- * assertion is added to the test results, and protractor will continue onto
169
- * the next command.
166
+ * @return {webdriver.promise. Promise<boolean>|boolean } If truthy, Protractor
167
+ * will continue onto the next command. If falsy, webdriver will
168
+ * continuously re-run this function until it is truthy. If a rejected promise
169
+ * is returned, a failed assertion is added to the test results, and Protractor
170
+ * will continue onto the next command.
170
171
*/
171
- waitForCondition ?: ( ) => q . Promise < any > ;
172
+ waitForCondition ?( ) : webdriver . promise . Promise < boolean > | boolean ;
172
173
173
174
/**
174
175
* Used to turn off default checks for angular stability
@@ -222,7 +223,7 @@ export interface ProtractorPlugin {
222
223
*
223
224
* @throws {Error } Throws an error if called after results have been reported
224
225
*/
225
- addFailure ?: ( message ?: string , info ?: { specName ?: string , stackTrace ?: string } ) => void ;
226
+ addFailure ?( message ?: string , info ?: { specName ?: string , stackTrace ?: string } ) : void ;
226
227
227
228
/**
228
229
* Adds a passed assertion to the test's results. Note: this is added by the
@@ -235,7 +236,7 @@ export interface ProtractorPlugin {
235
236
*
236
237
* @throws {Error } Throws an error if called after results have been reported
237
238
*/
238
- addSuccess ?: ( info ?: { specName ?: string } ) => void ;
239
+ addSuccess ?( info ?: { specName ?: string } ) : void ;
239
240
240
241
/**
241
242
* Warns the user that something is problematic. Note: this is added by the
@@ -247,7 +248,7 @@ export interface ProtractorPlugin {
247
248
* Defaults to `PLUGIN_NAME + ' Plugin Tests'`.
248
249
* Defaults to `{}`.
249
250
*/
250
- addWarning ?: ( message ?: string , info ?: { specName ?: string } ) => void ;
251
+ addWarning ?( message ?: string , info ?: { specName ?: string } ) : void ;
251
252
}
252
253
253
254
/**
0 commit comments