|
1 | 1 | import {BPClient} from 'blocking-proxy'; |
2 | | -import {ActionSequence, By, Capabilities, Command as WdCommand, FileDetector, ICommandName, Navigation, Options, promise as wdpromise, Session, TargetLocator, TouchSequence, until, WebDriver, WebElement, WebElementPromise} from 'selenium-webdriver'; |
| 2 | +import {By, Command as WdCommand, ICommandName, Navigation, promise as wdpromise, Session, WebDriver, WebElement, WebElementPromise} from 'selenium-webdriver'; |
3 | 3 | import * as url from 'url'; |
4 | 4 | import {extend as extendWD, ExtendedWebDriver} from 'webdriver-js-extender'; |
5 | 5 |
|
6 | | -import {DebugHelper} from './debugger'; |
7 | 6 | import {build$, build$$, ElementArrayFinder, ElementFinder} from './element'; |
8 | 7 | import {IError} from './exitCodes'; |
9 | 8 | import {ProtractorExpectedConditions} from './expectedConditions'; |
@@ -309,11 +308,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { |
309 | 308 | */ |
310 | 309 | ng12Hybrid: boolean; |
311 | 310 |
|
312 | | - /** |
313 | | - * A helper that manages debugging tests. |
314 | | - */ |
315 | | - debugHelper: DebugHelper; |
316 | | - |
317 | 311 | // This index type allows looking up methods by name so we can do mixins. |
318 | 312 | [key: string]: any; |
319 | 313 |
|
@@ -358,7 +352,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { |
358 | 352 | this.getPageTimeout = DEFAULT_GET_PAGE_TIMEOUT; |
359 | 353 | this.params = {}; |
360 | 354 | this.resetUrl = DEFAULT_RESET_URL; |
361 | | - this.debugHelper = new DebugHelper(this); |
362 | 355 |
|
363 | 356 | let ng12Hybrid_ = false; |
364 | 357 | Object.defineProperty(this, 'ng12Hybrid', { |
@@ -1038,118 +1031,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { |
1038 | 1031 | clientSideScripts.getLocationAbsUrl, 'Protractor.getLocationAbsUrl()', rootEl)); |
1039 | 1032 | } |
1040 | 1033 |
|
1041 | | - /** |
1042 | | - * Adds a task to the control flow to pause the test and inject helper |
1043 | | - * functions |
1044 | | - * into the browser, so that debugging may be done in the browser console. |
1045 | | - * |
1046 | | - * This should be used under node in debug mode, i.e. with |
1047 | | - * protractor debug <configuration.js> |
1048 | | - * |
1049 | | - * @example |
1050 | | - * While in the debugger, commands can be scheduled through webdriver by |
1051 | | - * entering the repl: |
1052 | | - * debug> repl |
1053 | | - * > element(by.input('user')).sendKeys('Laura'); |
1054 | | - * > browser.debugger(); |
1055 | | - * Press Ctrl + c to leave debug repl |
1056 | | - * debug> c |
1057 | | - * |
1058 | | - * This will run the sendKeys command as the next task, then re-enter the |
1059 | | - * debugger. |
1060 | | - */ |
1061 | | - debugger() { |
1062 | | - // jshint debug: true |
1063 | | - return this.driver.executeScript(clientSideScripts.installInBrowser) |
1064 | | - .then(() => wdpromise.controlFlow().execute(() => { |
1065 | | - debugger; |
1066 | | - }, 'add breakpoint to control flow')); |
1067 | | - } |
1068 | | - |
1069 | | - /** |
1070 | | - * See browser.explore(). |
1071 | | - */ |
1072 | | - enterRepl(opt_debugPort?: number) { |
1073 | | - return this.explore(opt_debugPort); |
1074 | | - } |
1075 | | - |
1076 | | - /** |
1077 | | - * Beta (unstable) explore function for entering the repl loop from |
1078 | | - * any point in the control flow. Use browser.explore() in your test. |
1079 | | - * Does not require changes to the command line (no need to add 'debug'). |
1080 | | - * Note, if you are wrapping your own instance of Protractor, you must |
1081 | | - * expose globals 'browser' and 'protractor' for pause to work. |
1082 | | - * |
1083 | | - * @example |
1084 | | - * element(by.id('foo')).click(); |
1085 | | - * browser.explore(); |
1086 | | - * // Execution will stop before the next click action. |
1087 | | - * element(by.id('bar')).click(); |
1088 | | - * |
1089 | | - * @param {number=} opt_debugPort Optional port to use for the debugging |
1090 | | - * process |
1091 | | - */ |
1092 | | - explore(opt_debugPort?: number) { |
1093 | | - let debuggerClientPath = __dirname + '/debugger/clients/explorer.js'; |
1094 | | - let onStartFn = (firstTime: boolean) => { |
1095 | | - logger.info(); |
1096 | | - if (firstTime) { |
1097 | | - logger.info('------- Element Explorer -------'); |
1098 | | - logger.info( |
1099 | | - 'Starting WebDriver debugger in a child process. Element ' + |
1100 | | - 'Explorer is still beta, please report issues at ' + |
1101 | | - 'github.com/angular/protractor'); |
1102 | | - logger.info(); |
1103 | | - logger.info('Type <tab> to see a list of locator strategies.'); |
1104 | | - logger.info('Use the `list` helper function to find elements by strategy:'); |
1105 | | - logger.info(' e.g., list(by.binding(\'\')) gets all bindings.'); |
1106 | | - logger.info(); |
1107 | | - } |
1108 | | - }; |
1109 | | - this.debugHelper.initBlocking(debuggerClientPath, onStartFn, opt_debugPort); |
1110 | | - } |
1111 | | - |
1112 | | - /** |
1113 | | - * Beta (unstable) pause function for debugging webdriver tests. Use |
1114 | | - * browser.pause() in your test to enter the protractor debugger from that |
1115 | | - * point in the control flow. |
1116 | | - * Does not require changes to the command line (no need to add 'debug'). |
1117 | | - * Note, if you are wrapping your own instance of Protractor, you must |
1118 | | - * expose globals 'browser' and 'protractor' for pause to work. |
1119 | | - * |
1120 | | - * @example |
1121 | | - * element(by.id('foo')).click(); |
1122 | | - * browser.pause(); |
1123 | | - * // Execution will stop before the next click action. |
1124 | | - * element(by.id('bar')).click(); |
1125 | | - * |
1126 | | - * @param {number=} opt_debugPort Optional port to use for the debugging |
1127 | | - * process |
1128 | | - */ |
1129 | | - pause(opt_debugPort?: number): wdpromise.Promise<any> { |
1130 | | - if (this.debugHelper.isAttached()) { |
1131 | | - logger.info('Encountered browser.pause(), but debugger already attached.'); |
1132 | | - return wdpromise.when(true); |
1133 | | - } |
1134 | | - let debuggerClientPath = __dirname + '/debugger/clients/wddebugger.js'; |
1135 | | - let onStartFn = (firstTime: boolean) => { |
1136 | | - logger.info(); |
1137 | | - logger.info('Encountered browser.pause(). Attaching debugger...'); |
1138 | | - if (firstTime) { |
1139 | | - logger.info(); |
1140 | | - logger.info('------- WebDriver Debugger -------'); |
1141 | | - logger.info( |
1142 | | - 'Starting WebDriver debugger in a child process. Pause is ' + |
1143 | | - 'still beta, please report issues at github.com/angular/protractor'); |
1144 | | - logger.info(); |
1145 | | - logger.info('press c to continue to the next webdriver command'); |
1146 | | - logger.info('press ^D to detach debugger and resume code execution'); |
1147 | | - logger.info(); |
1148 | | - } |
1149 | | - }; |
1150 | | - this.debugHelper.init(debuggerClientPath, onStartFn, opt_debugPort); |
1151 | | - } |
1152 | | - |
1153 | 1034 | /** |
1154 | 1035 | * Determine if the control flow is enabled. |
1155 | 1036 | * |
|
0 commit comments