11import * as q from 'q' ;
22import * as webdriver from 'selenium-webdriver' ;
33
4+ import { ProtractorBrowser } from './browser' ;
45import { Config } from './config' ;
56import { ConfigParser } from './configParser' ;
67import { Logger } from './logger' ;
@@ -105,6 +106,8 @@ export interface ProtractorPlugin {
105106 * This is called inside browser.get() directly after the page loads, and before
106107 * angular bootstraps.
107108 *
109+ * @param {ProtractorBrowser } browser The browser instance which is loading a page.
110+ *
108111 * @this {Object} bound to module.exports
109112 *
110113 * @throws {* } If this function throws an error, a failed assertion is added to
@@ -114,13 +117,15 @@ export interface ProtractorPlugin {
114117 * protractor will wait for the promise to resolve before continuing. If
115118 * the promise is rejected, a failed assertion is added to the test results.
116119 */
117- onPageLoad ?( ) : void | webdriver . promise . Promise < void > ;
120+ onPageLoad ?( browser : ProtractorBrowser ) : void | webdriver . promise . Promise < void > ;
118121
119122 /**
120123 * This is called inside browser.get() directly after angular is done
121124 * bootstrapping/synchronizing. If browser.ignoreSynchronization is true, this
122125 * will not be called.
123126 *
127+ * @param {ProtractorBrowser } browser The browser instance which is loading a page.
128+ *
124129 * @this {Object} bound to module.exports
125130 *
126131 * @throws {* } If this function throws an error, a failed assertion is added to
@@ -130,14 +135,16 @@ export interface ProtractorPlugin {
130135 * protractor will wait for the promise to resolve before continuing. If
131136 * the promise is rejected, a failed assertion is added to the test results.
132137 */
133- onPageStable ?( ) : void | webdriver . promise . Promise < void > ;
138+ onPageStable ?( browser : ProtractorBrowser ) : void | webdriver . promise . Promise < void > ;
134139
135140 /**
136141 * Between every webdriver action, Protractor calls browser.waitForAngular() to
137142 * make sure that Angular has no outstanding $http or $timeout calls.
138143 * You can use waitForPromise() to have Protractor additionally wait for your
139144 * custom promise to be resolved inside of browser.waitForAngular().
140145 *
146+ * @param {ProtractorBrowser } browser The browser instance which needs invoked `waitForAngular`.
147+ *
141148 * @this {Object} bound to module.exports
142149 *
143150 * @throws {* } If this function throws an error, a failed assertion is added to
@@ -150,7 +157,7 @@ export interface ProtractorPlugin {
150157 * something other than a promise is returned, protractor will continue
151158 * onto the next command.
152159 */
153- waitForPromise ?( ) : webdriver . promise . Promise < void > ;
160+ waitForPromise ?( browser : ProtractorBrowser ) : webdriver . promise . Promise < void > ;
154161
155162 /**
156163 * Between every webdriver action, Protractor calls browser.waitForAngular() to
@@ -159,6 +166,8 @@ export interface ProtractorPlugin {
159166 * custom condition to be truthy. If specified, this function will be called
160167 * repeatedly until truthy.
161168 *
169+ * @param {ProtractorBrowser } browser The browser instance which needs invoked `waitForAngular`.
170+ *
162171 * @this {Object} bound to module.exports
163172 *
164173 * @throws {* } If this function throws an error, a failed assertion is added to
@@ -170,7 +179,7 @@ export interface ProtractorPlugin {
170179 * is returned, a failed assertion is added to the test results, and Protractor
171180 * will continue onto the next command.
172181 */
173- waitForCondition ?( ) : webdriver . promise . Promise < boolean > | boolean ;
182+ waitForCondition ?( browser : ProtractorBrowser ) : webdriver . promise . Promise < boolean > | boolean ;
174183
175184 /**
176185 * Used to turn off default checks for angular stability
0 commit comments