Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[javascript] Add missing dependencies to fix tests #8372

Merged
merged 2 commits into from
May 31, 2020
Merged

[javascript] Add missing dependencies to fix tests #8372

merged 2 commits into from
May 31, 2020

Conversation

seanpoulter
Copy link
Contributor

Description

When I run the JavaScript tests from the HEAD of the master branch, a ReferenceError is reported saying that error is not defined. The usage is:

      throw new error.InvalidArgumentError('...');

An example follows the PR template.

Motivation and Context

As a developer who would like to contribute to the JavaScript library, I would like the JavaScript build and tests to pass so I can make changes with confidence

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation. No
  • I have updated the documentation accordingly. Not applicable
  • I have added tests to cover my changes. Not applicable
  • All new and existing tests passed. No. The build and tests fail.

Demonstration

Before PR

When I run the tests using

bazel test //javascript/node/selenium-webdriver:tests

the output includes

5) [chrome] setDownloadPath throws if path is not a directory
  Message:
    ReferenceError: error is not defined
  Stack:
        at <Jasmine>
        at Driver.setDownloadPath (javascript/node/selenium-webdriver/chrome.js:468:7)
        at javascript/node/selenium-webdriver/test/chrome/devtools_test.js:88:53
        at assertInvalidArgumentError (javascript/node/selenium-webdriver/test/chrome/devtools_test.js:98:17)
        at UserContext.<anonymous> (javascript/node/selenium-webdriver/test/chrome/devtools_test.js:88:13)
        at <Jasmine>
        at processImmediate (internal/timers.js:439:21)

...

927 specs, 10 failures, 34 pending specs
Finished in 267.001 seconds

Modified Behaviour

There are fewer failures. Yay.

927 specs, 8 failures, 34 pending specs
Finished in 188.885 seconds

@seanpoulter seanpoulter changed the title [javascript] Add missing dependency [javascript] Add missing dependencies to fix tests May 31, 2020
@seanpoulter
Copy link
Contributor Author

seanpoulter commented May 31, 2020

May as well fix these related failures too:

Failures:
1) [chrome] setDownloadPath can enable downloads in headless mode
  Message:
    ReferenceError: command is not defined
  Stack:
        at <Jasmine>
        at Driver.sendDevToolsCommand (javascript/node/selenium-webdriver/chrome.js:437:13)
        at Driver.setDownloadPath (javascript/node/selenium-webdriver/chrome.js:475:17)
        at UserContext.<anonymous> (javascript/node/selenium-webdriver/test/chrome/devtools_test.js:69:7)

...

3) [chrome] can send commands to devtools
  Message:
    ReferenceError: command is not defined
  Stack:
        at <Jasmine>
        at Driver.sendDevToolsCommand (javascript/node/selenium-webdriver/chrome.js:437:13)
        at UserContext.<anonymous> (javascript/node/selenium-webdriver/test/chrome/devtools_test.js:45:18)
        at <Jasmine>
        at processTicksAndRejections (internal/process/task_queues.js:93:5)

With the fix, that brings it down to:

927 specs, 6 failures, 34 pending specs
Finished in 190.825 seconds

Copy link
Member

@harsha509 harsha509 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @seanpoulter!

@diemol diemol merged commit fc45ab7 into SeleniumHQ:master May 31, 2020
titusfortner pushed a commit to titusfortner/selenium that referenced this pull request Aug 13, 2020
* [javascript] Add missing dependency

* [javascript] Add missing dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants