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] Fix the syntax error preventing a test suite from running #8371

Merged
merged 3 commits into from
Jun 4, 2020
Merged

[javascript] Fix the syntax error preventing a test suite from running #8371

merged 3 commits into from
Jun 4, 2020

Conversation

seanpoulter
Copy link
Contributor

Description

When I run the JavaScript tests from the HEAD of the master branch, a syntax error is reported saying the describe block does not support an async function. 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.

Proposed Changes

Actual Behaviour

Suite error: [safari] finding elements
  Message:
    Error: describe expects a function argument; received [object AsyncFunction]
  Stack:
    Error: describe expects a function argument; received [object AsyncFunction]
        at <Jasmine>
        at Suite.<anonymous> (javascript/node/selenium-webdriver/test/element_finding_test.js:414:5)
        at <Jasmine>
        at javascript/node/selenium-webdriver/test/element_finding_test.js:41:3
        at javascript/node/selenium-webdriver/lib/test/index.js:49:5
        at Suite.<anonymous> (javascript/node/selenium-webdriver/testing/index.js:410:9)
        at <Jasmine>
        at Object.suite (javascript/node/selenium-webdriver/testing/index.js:392:7)
        at suite (javascript/node/selenium-webdriver/lib/test/index.js:39:11)
        at Object.<anonymous> (javascript/node/selenium-webdriver/test/element_finding_test.js:28:1)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Module.require (internal/modules/cjs/loader.js:849:19)
        at require (internal/modules/cjs/helpers.js:74:18)
        at node_modules/jasmine/lib/jasmine.js:89:5
        at <Jasmine>
        at Jasmine.loadSpecs (node_modules/jasmine/lib/jasmine.js:88:18)
        at Jasmine.execute (node_modules/jasmine/lib/jasmine.js:257:8)
        at main (node_modules/@bazel/jasmine/src/jasmine_runner.js:188:11)
        at Object.<anonymous> (node_modules/@bazel/jasmine/src/jasmine_runner.js:210:22)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Object.<anonymous> (javascript/node/selenium-webdriver/tests_loader.js:32:24)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
        at internal/main/run_main_module.js:17:11

Suite error: [chrome] finding elements
  Message:
    Error: describe expects a function argument; received [object AsyncFunction]
  Stack:
    Error: describe expects a function argument; received [object AsyncFunction]
        at <Jasmine>
        at Suite.<anonymous> (javascript/node/selenium-webdriver/test/element_finding_test.js:414:5)
        at <Jasmine>
        at javascript/node/selenium-webdriver/test/element_finding_test.js:41:3
        at javascript/node/selenium-webdriver/lib/test/index.js:49:5
        at Suite.<anonymous> (javascript/node/selenium-webdriver/testing/index.js:410:9)
        at <Jasmine>
        at Object.suite (javascript/node/selenium-webdriver/testing/index.js:392:7)
        at suite (javascript/node/selenium-webdriver/lib/test/index.js:39:11)
        at Object.<anonymous> (javascript/node/selenium-webdriver/test/element_finding_test.js:28:1)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Module.require (internal/modules/cjs/loader.js:849:19)
        at require (internal/modules/cjs/helpers.js:74:18)
        at node_modules/jasmine/lib/jasmine.js:89:5
        at <Jasmine>
        at Jasmine.loadSpecs (node_modules/jasmine/lib/jasmine.js:88:18)
        at Jasmine.execute (node_modules/jasmine/lib/jasmine.js:257:8)
        at main (node_modules/@bazel/jasmine/src/jasmine_runner.js:188:11)
        at Object.<anonymous> (node_modules/@bazel/jasmine/src/jasmine_runner.js:210:22)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Object.<anonymous> (javascript/node/selenium-webdriver/tests_loader.js:32:24)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
        at internal/main/run_main_module.js:17:11

Suite error: [firefox] finding elements
  Message:
    Error: describe expects a function argument; received [object AsyncFunction]
  Stack:
    Error: describe expects a function argument; received [object AsyncFunction]
        at <Jasmine>
        at Suite.<anonymous> (javascript/node/selenium-webdriver/test/element_finding_test.js:414:5)
        at <Jasmine>
        at javascript/node/selenium-webdriver/test/element_finding_test.js:41:3
        at javascript/node/selenium-webdriver/lib/test/index.js:49:5
        at Suite.<anonymous> (javascript/node/selenium-webdriver/testing/index.js:410:9)
        at <Jasmine>
        at Object.suite (javascript/node/selenium-webdriver/testing/index.js:392:7)
        at suite (javascript/node/selenium-webdriver/lib/test/index.js:39:11)
        at Object.<anonymous> (javascript/node/selenium-webdriver/test/element_finding_test.js:28:1)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Module.require (internal/modules/cjs/loader.js:849:19)
        at require (internal/modules/cjs/helpers.js:74:18)
        at node_modules/jasmine/lib/jasmine.js:89:5
        at <Jasmine>
        at Jasmine.loadSpecs (node_modules/jasmine/lib/jasmine.js:88:18)
        at Jasmine.execute (node_modules/jasmine/lib/jasmine.js:257:8)
        at main (node_modules/@bazel/jasmine/src/jasmine_runner.js:188:11)
        at Object.<anonymous> (node_modules/@bazel/jasmine/src/jasmine_runner.js:210:22)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Object.<anonymous> (javascript/node/selenium-webdriver/tests_loader.js:32:24)
        at Module._compile (internal/modules/cjs/loader.js:956:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
        at Module.load (internal/modules/cjs/loader.js:812:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
        at internal/main/run_main_module.js:17:11

...

927 specs, 16 failures, 34 pending specs
Finished in 203.679 seconds

Proposed Behaviour

Four fewer failures. 😉

936 specs, 12 failures, 35 pending specs
Finished in 228.628 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.

Thank you @seanpoulter !

@seanpoulter
Copy link
Contributor Author

Sorry for the force-push. I caught an old author/committer email address. 😓

@seanpoulter
Copy link
Contributor Author

Any idea how to fix the build error? Looks like it might be an E instead of an e or a missing build step. 🤷 https://travis-ci.com/github/SeleniumHQ/selenium/jobs/341854655

@harsha509
Copy link
Member

Hi @seanpoulter ,

We need to build node:atoms before running the tests. Previously it was like

    ./go --verbose node:atoms
    cd javascript/node/selenium-webdriver; npm install; npm run $NPM

it was replaced recent with bazel

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

i think we need to also build atoms with bazel before running the tests.

Regards,
Harsha

@seanpoulter
Copy link
Contributor Author

It's only one character breaking the TravisCI build. 🤦 See #8374.

@seanpoulter
Copy link
Contributor Author

Thanks for updating the branch David. Now we only have 3 failures in the JavaScript build related to the relative locators. It isn't obvious to me how to fix those so I've created #8375 to discuss it (if you want help, otherwise feel free to close it).

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.

We should merge this and iterate on the relative locators implementation in a separate PR and in the linked issue.
Thanks @seanpoulter!

@diemol diemol merged commit 482963e into SeleniumHQ:master Jun 4, 2020
@seanpoulter
Copy link
Contributor Author

Thanks Diego. Who should I talk to about the relative locators? 😀

@diemol
Copy link
Member

diemol commented Jun 14, 2020

Easiest is to come to the IRC/Slack workspace, ping us in the #selenium or @selenium-tlc channels.
IRC/Slack channel

titusfortner pushed a commit to titusfortner/selenium that referenced this pull request Aug 13, 2020
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.

4 participants