1
1
import * as q from 'q' ;
2
2
import * as webdriver from 'selenium-webdriver' ;
3
3
4
+ import { ProtractorBrowser } from './browser' ;
4
5
import { Config } from './config' ;
5
6
import { ConfigParser } from './configParser' ;
6
7
import { Logger } from './logger' ;
@@ -105,6 +106,8 @@ export interface ProtractorPlugin {
105
106
* This is called inside browser.get() directly after the page loads, and before
106
107
* angular bootstraps.
107
108
*
109
+ * @param {ProtractorBrowser } browser The browser instance which is loading a page.
110
+ *
108
111
* @this {Object} bound to module.exports
109
112
*
110
113
* @throws {* } If this function throws an error, a failed assertion is added to
@@ -114,13 +117,15 @@ export interface ProtractorPlugin {
114
117
* protractor will wait for the promise to resolve before continuing. If
115
118
* the promise is rejected, a failed assertion is added to the test results.
116
119
*/
117
- onPageLoad ?( ) : void | webdriver . promise . Promise < void > ;
120
+ onPageLoad ?( browser : ProtractorBrowser ) : void | webdriver . promise . Promise < void > ;
118
121
119
122
/**
120
123
* This is called inside browser.get() directly after angular is done
121
124
* bootstrapping/synchronizing. If browser.ignoreSynchronization is true, this
122
125
* will not be called.
123
126
*
127
+ * @param {ProtractorBrowser } browser The browser instance which is loading a page.
128
+ *
124
129
* @this {Object} bound to module.exports
125
130
*
126
131
* @throws {* } If this function throws an error, a failed assertion is added to
@@ -130,14 +135,16 @@ export interface ProtractorPlugin {
130
135
* protractor will wait for the promise to resolve before continuing. If
131
136
* the promise is rejected, a failed assertion is added to the test results.
132
137
*/
133
- onPageStable ?( ) : void | webdriver . promise . Promise < void > ;
138
+ onPageStable ?( browser : ProtractorBrowser ) : void | webdriver . promise . Promise < void > ;
134
139
135
140
/**
136
141
* Between every webdriver action, Protractor calls browser.waitForAngular() to
137
142
* make sure that Angular has no outstanding $http or $timeout calls.
138
143
* You can use waitForPromise() to have Protractor additionally wait for your
139
144
* custom promise to be resolved inside of browser.waitForAngular().
140
145
*
146
+ * @param {ProtractorBrowser } browser The browser instance which needs invoked `waitForAngular`.
147
+ *
141
148
* @this {Object} bound to module.exports
142
149
*
143
150
* @throws {* } If this function throws an error, a failed assertion is added to
@@ -150,7 +157,7 @@ export interface ProtractorPlugin {
150
157
* something other than a promise is returned, protractor will continue
151
158
* onto the next command.
152
159
*/
153
- waitForPromise ?( ) : webdriver . promise . Promise < void > ;
160
+ waitForPromise ?( browser : ProtractorBrowser ) : webdriver . promise . Promise < void > ;
154
161
155
162
/**
156
163
* Between every webdriver action, Protractor calls browser.waitForAngular() to
@@ -159,6 +166,8 @@ export interface ProtractorPlugin {
159
166
* custom condition to be truthy. If specified, this function will be called
160
167
* repeatedly until truthy.
161
168
*
169
+ * @param {ProtractorBrowser } browser The browser instance which needs invoked `waitForAngular`.
170
+ *
162
171
* @this {Object} bound to module.exports
163
172
*
164
173
* @throws {* } If this function throws an error, a failed assertion is added to
@@ -170,7 +179,7 @@ export interface ProtractorPlugin {
170
179
* is returned, a failed assertion is added to the test results, and Protractor
171
180
* will continue onto the next command.
172
181
*/
173
- waitForCondition ?( ) : webdriver . promise . Promise < boolean > | boolean ;
182
+ waitForCondition ?( browser : ProtractorBrowser ) : webdriver . promise . Promise < boolean > | boolean ;
174
183
175
184
/**
176
185
* Used to turn off default checks for angular stability
0 commit comments