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

Commit

Permalink
fix: remove elementExplorer api and command line
Browse files Browse the repository at this point in the history
Protractor debugger and element explorer cannot be used for Node.js 8+ and were removed in version 7.
  • Loading branch information
alan-agius4 authored and Keen Yee Liau committed May 14, 2020
1 parent c1e31e8 commit df3dd64
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 97 deletions.
46 changes: 0 additions & 46 deletions bin/elementexplorer.js

This file was deleted.

45 changes: 0 additions & 45 deletions docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,51 +258,6 @@ used from the browser's console.
> window.clientSideScripts.findInputs('username', document.getElementById('#myEl'));
```

**Testing Out Protractor Interactively**

When debugging or first writing test suites, you may find it helpful to
try out Protractor commands without starting up the entire test suite. You can
do this with the element explorer.

To run element explorer, simply run protractor as you normally would, but pass in
the flag --elementExplorer:

protractor --elementExplorer

This will load up the URL on WebDriver and put the terminal into a REPL loop.
You will see a > prompt. The `browser`, `element` and `protractor` variables will
be available. Enter a command such as:

> browser.get('http://www.angularjs.org')

or

> element(by.id('foobar')).getText()

Typing tab at a blank prompt will fill in a suggestion for finding
elements. You can also use the `list(locator)` command to list all elements
matching a locator.

Element explorer will start chrome by default. However, you can specify
another browser, change browser settings, or specify any other config that you
normally would with your protractor test. To do this, pass configs to
protractor like you normally would,
but with the `--elementExplorer` flag set:

protractor [configFile] [options] --elementExplorer

For example, to connect to ChromeDriver directly, use

protractor --directConnect --elementExplorer

Element explore will ignore your specs, not set up your framework (e.g. jasmine,
mocha, cucumber), and only allow you to pass in 1 capability, but will honor
every other parameter in your config.

Note `baseUrl` is used here as the initial page, i.e. element explorer will try
to navigate to `baseUrl` automatically on start.


## Taking Screenshots

WebDriver can snap a screenshot with `browser.takeScreenshot()`. This can be a
Expand Down
5 changes: 1 addition & 4 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ let allowedNames = [
'nodeDebug',
'debuggerServerPort',
'frameworkPath',
'elementExplorer',
'debug',
'logLevel',
'disableChecks',
Expand Down Expand Up @@ -134,7 +133,6 @@ let yargsOptions: any = {
framework: 'Test framework to use: jasmine, mocha, or custom',
resultJsonOutputFile: 'Path to save JSON test result',
troubleshoot: 'Turn on troubleshooting output',
elementExplorer: 'Interactively test Protractor commands',
debuggerServerPort: 'Start a debugger server at specified port instead of repl',
disableChecks: 'Disable cli checks',
logLevel: 'Define Protractor log level [ERROR, WARN, INFO, DEBUG]'
Expand All @@ -148,7 +146,6 @@ let yargsOptions: any = {
build: 'capabilities.build',
grep: 'jasmineNodeOpts.grep',
'invert-grep': 'jasmineNodeOpts.invertGrep',
explorer: 'elementExplorer'
},
strings: {'capabilities.tunnel-identifier': ''}
};
Expand Down Expand Up @@ -232,7 +229,7 @@ if (!configFile) {
}
}

if (!configFile && !argv.elementExplorer && args.length < 3) {
if (!configFile && args.length < 3) {
console.log(
'**you must either specify a configuration file ' +
'or at least 3 options. See below for the options:\n');
Expand Down
3 changes: 1 addition & 2 deletions lib/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ let initFn = function(configFile: string, additionalConfig: Config) {
});
})
.then(() => {
// 3) If we're in `elementExplorer` mode, run only that.
if (config.elementExplorer || config.framework === 'explorer') {
if (config.framework === 'explorer') {
if (config.multiCapabilities.length != 1) {
throw new Error('Must specify only 1 browser while using elementExplorer');
} else {
Expand Down

0 comments on commit df3dd64

Please # to comment.