Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

feat(debugging): Add webdriver logging and highlight delay #4039

Merged
merged 1 commit into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/bpRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export class BlockingProxyRunner {
'--seleniumAddress',
this.config.seleniumAddress,
];
if (this.config.webDriverLogDir) {
args.push('--logDir', this.config.webDriverLogDir);
}
if (this.config.highlightDelay) {
args.push('--highlightDelay', this.config.highlightDelay.toString());
}
this.bpProcess = fork(BP_PATH, args, {silent: true});
logger.info('Starting BlockingProxy with args: ' + args.toString());
this.bpProcess
Expand Down
19 changes: 19 additions & 0 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,25 @@ export interface Config {
*/
ignoreUncaughtExceptions?: boolean;

/**
* If set, will create a log file in the given directory with a readable log of
* the webdriver commands it executes.
*
* This is an experimental feature. Enabling this will also turn on Blocking Proxy
* synchronization, which is also experimental.
*/
webDriverLogDir?: string;

/**
* If set, Protractor will pause the specified amount of time (in milliseconds)
* before interactions with browser elements (ie, sending keys, clicking). It will
* also highlight the element it's about to interact with.
*
* This is an experimental feature. Enabling this will also turn on Blocking Proxy
* synchronization, which is also experimental.
*/
highlightDelay?: number;

// ---------------------------------------------------------------------------
// ----- The test framework
// --------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ export class Runner extends EventEmitter {
(wdpromise as any).USE_PROMISE_MANAGER = this.config_.SELENIUM_PROMISE_MANAGER;
}

if (this.config_.webDriverLogDir || this.config_.highlightDelay) {
this.config_.useBlockingProxy = true;
}

// 0) Wait for debugger
return q(this.ready_)
.then(() => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@types/node": "^6.0.46",
"@types/q": "^0.0.32",
"@types/selenium-webdriver": "~2.53.39",
"blocking-proxy": "0.0.3",
"blocking-proxy": "0.0.4",
"chalk": "^1.1.3",
"glob": "^7.0.3",
"jasmine": "^2.5.3",
Expand Down