This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -359,7 +359,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
359359 this . ignoreSynchronization = false ;
360360 this . getPageTimeout = DEFAULT_GET_PAGE_TIMEOUT ;
361361 this . params = { } ;
362- this . plugins_ = new Plugins ( { } ) ;
363362 this . resetUrl = DEFAULT_RESET_URL ;
364363 this . debugHelper = new DebugHelper ( this ) ;
365364
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as webdriver from 'selenium-webdriver';
44import { Config } from './config' ;
55import { ConfigParser } from './configParser' ;
66import { Logger } from './logger' ;
7+ import { protractor } from './ptor' ;
78
89let logger = new Logger ( 'plugins' ) ;
910
@@ -457,8 +458,13 @@ export class Plugins {
457458 logError ( e ) ;
458459 }
459460 } ;
460- return promiseType == PromiseType . Q ? q . Promise ( resolver ) :
461- new webdriver . promise . Promise ( resolver ) ;
461+ if ( promiseType == PromiseType . Q ) {
462+ return q . Promise ( resolver ) ;
463+ } else if ( protractor . browser . controlFlowIsEnabled ( ) ) {
464+ return new webdriver . promise . Promise ( resolver ) ;
465+ } else {
466+ return new Promise ( resolver ) ;
467+ }
462468 }
463469
464470 /**
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ var passingTests = [
3939 'node built/cli.js spec/angular2Conf.js' ,
4040 'node built/cli.js spec/hybridConf.js' ,
4141 'node built/cli.js spec/built/noCFSmokeConf.js' ,
42+ 'node built/cli.js spec/built/noCFPluginConf.js' ,
4243 'node scripts/driverProviderAttachSession.js' ,
4344 'node scripts/errorTest.js' ,
4445 // Interactive Element Explorer tasks
Original file line number Diff line number Diff line change 1+ import { browser , protractor } from '../../..' ;
2+
3+ describe ( 'category' , function ( ) {
4+ it ( 'name' , async function ( ) {
5+ await browser . get ( 'index.html' ) ;
6+ await expect ( ( protractor as any ) . ON_PAGE_LOAD ) . toBe ( true ) ;
7+ } ) ;
8+ } ) ;
Original file line number Diff line number Diff line change 1+ import * as q from 'q' ;
2+ import { Config , protractor } from '../..' ;
3+ const env = require ( '../environment.js' ) ;
4+
5+ export let config : Config = {
6+ seleniumAddress : env . seleniumAddress ,
7+
8+ framework : 'jasmine' ,
9+
10+ specs : [
11+ 'noCF/plugin_spec.js'
12+ ] ,
13+
14+ capabilities : env . capabilities ,
15+
16+ baseUrl : env . baseUrl + '/ng1/' ,
17+
18+ plugins : [ {
19+ inline : {
20+ onPageLoad : function ( ) {
21+ return q . delay ( 100 ) . then ( function ( ) {
22+ ( protractor as any ) . ON_PAGE_LOAD = true ;
23+ } ) ;
24+ }
25+ }
26+ } ] ,
27+
28+ SELENIUM_PROMISE_MANAGER : false
29+ } ;
You can’t perform that action at this time.
0 commit comments