@@ -252,7 +252,8 @@ export class ProtractorBrowser extends Webdriver {
252
252
253
253
constructor (
254
254
webdriverInstance : webdriver . WebDriver , opt_baseUrl ?: string ,
255
- opt_rootElement ?: string , opt_untrackOutstandingTimeouts ?: boolean ) {
255
+ opt_rootElement ?: string , opt_untrackOutstandingTimeouts ?: boolean ,
256
+ opt_ng12Hybrid ?: boolean ) {
256
257
super ( ) ;
257
258
// These functions should delegate to the webdriver instance, but should
258
259
// wait for Angular to sync up before performing the action. This does not
@@ -286,7 +287,7 @@ export class ProtractorBrowser extends Webdriver {
286
287
this . ready = null ;
287
288
this . plugins_ = new Plugins ( { } ) ;
288
289
this . resetUrl = DEFAULT_RESET_URL ;
289
- this . ng12Hybrid = false ;
290
+ this . ng12Hybrid = opt_ng12Hybrid ;
290
291
291
292
this . driver . getCapabilities ( ) . then ( ( caps : webdriver . Capabilities ) => {
292
293
// Internet Explorer does not accept data URLs, which are the default
@@ -901,7 +902,8 @@ export class ProtractorBrowser extends Webdriver {
901
902
* browser.get('http://angular.github.io/protractor/#/api');
902
903
* expect(browser.getLocationAbsUrl())
903
904
* .toBe('http://angular.github.io/protractor/#/api');
904
- * @returns {webdriver.promise.Promise<string> } The current absolute url from AngularJS.
905
+ * @returns {webdriver.promise.Promise<string> } The current absolute url from
906
+ * AngularJS.
905
907
*/
906
908
getLocationAbsUrl ( ) : webdriver . promise . Promise < any > {
907
909
this . waitForAngular ( ) ;
@@ -1236,15 +1238,20 @@ export class ProtractorBrowser extends Webdriver {
1236
1238
* Create a new instance of Browser by wrapping a webdriver instance.
1237
1239
*
1238
1240
* @param {webdriver.WebDriver } webdriver The configured webdriver instance.
1239
- * @param {string= } opt_baseUrl A URL to prepend to relative gets.
1240
- * @param {boolean= } opt_untrackOutstandingTimeouts Whether Browser should
1241
+ * @param {string= } baseUrl A URL to prepend to relative gets.
1242
+ * @param {string= } rootElement The
1243
+ * @param {boolean= } untrackOutstandingTimeouts Whether Browser should
1241
1244
* stop tracking outstanding $timeouts.
1245
+ * @param {boolean= } ng12Hybrid Whether Browser should interpret any apps it
1246
+ * comes across as hybrid angular1/angular2 apps
1242
1247
* @returns {Browser } a new Browser instance
1243
1248
*/
1244
1249
static wrapDriver (
1245
1250
webdriver : webdriver . WebDriver , baseUrl ?: string , rootElement ?: string ,
1246
- untrackOutstandingTimeouts ?: boolean ) : ProtractorBrowser {
1251
+ untrackOutstandingTimeouts ?: boolean ,
1252
+ ng12Hybrid ?: boolean ) : ProtractorBrowser {
1247
1253
return new ProtractorBrowser (
1248
- webdriver , baseUrl , rootElement , untrackOutstandingTimeouts ) ;
1254
+ webdriver , baseUrl , rootElement , untrackOutstandingTimeouts ,
1255
+ ng12Hybrid ) ;
1249
1256
}
1250
1257
}
0 commit comments