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

[JS]: Missing documentation on running the firstscript.spec.js #1160

Open
N1lshui opened this issue Sep 8, 2022 · 5 comments · May be fixed by #1185
Open

[JS]: Missing documentation on running the firstscript.spec.js #1160

N1lshui opened this issue Sep 8, 2022 · 5 comments · May be fixed by #1185
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@N1lshui
Copy link

N1lshui commented Sep 8, 2022

What happened?

I'm not able to run Slenium with Javascript. I try to start my tes.js an dthere is this error

How can we reproduce the issue?

I don't know
test.js

Relevant log output

$ node test.js
[INFO] Searching for WebDriver executables installed on the current system...
[INFO] ... located firefox
[INFO] Running tests against [firefox]
C:\Users\nbirken\Documents\Selenium\js\node_modules\selenium-webdriver\testing\index.js:229
  after(function () {
  ^

ReferenceError: after is not defined
    at init (C:\Users\nbirken\Documents\Selenium\js\node_modules\selenium-webdriver\testing\index.js:229:3)
    at suite (C:\Users\nbirken\Documents\Selenium\js\node_modules\selenium-webdriver\testing\index.js:374:5)
    at Object.<anonymous> (C:\Users\nbirken\Documents\Selenium\js\test.js:5:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Operating System

Windows 10

Selenium version

4.0.0

What are the browser(s) and version(s) where you see this issue?

Firefox

What are the browser driver(s) and version(s) where you see this issue?

Firefox

Are you using Selenium Grid?

No response

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2022

@N1lshui, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@harsha509
Copy link
Member

Hi @N1lshui ,

Thank you for raising the issue.

Yes there is a missing info in document on running the test.
To execute, please install mocha by npm install mocha and run test using mocha test.js

As this is not an issue with selenium-webdriver i will move this issue to documentation!!!

Thanks,
Sri Harsha

@harsha509 harsha509 transferred this issue from SeleniumHQ/selenium Sep 8, 2022
@harsha509 harsha509 changed the title ReferenceError: after is not defined [JS]: Missing documentation on running the firstscript.spec.js Sep 8, 2022
@harsha509 harsha509 added documentation Improvements or additions to documentation help wanted Extra attention is needed good first issue Good for newcomers and removed needs-triaging I-defect labels Sep 8, 2022
@dublinsubway
Copy link

dublinsubway commented Sep 19, 2022

I can tackle this.

Would it be reasonable to add a last step to run the script here?

@titusfortner
Copy link
Member

You can add a comment at the bottom there in the JS tab for how to execute the code: https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md?plain=1#L243
(needs to be updated in all 4 language files)

Can also point people to our example repo for JS.... https://github.com/SeleniumHQ/seleniumhq.github.io/tree/trunk/examples/javascript
Which... prompts #1174 since it should be easy for a user to see how to run those on their machine.

Thanks for your help!

@dublinsubway dublinsubway linked a pull request Sep 30, 2022 that will close this issue
6 tasks
@dublinsubway
Copy link

Can also point people to our example repo for JS.... https://github.com/SeleniumHQ/seleniumhq.github.io/tree/trunk/examples/javascript
Which... prompts #1174 since it should be easy for a user to see how to run those on their machine.

There already is a link to see the code on GitHub at the bottom of the tab.
image
Do you think it's not enough?

I put the text in other languages in plain English as I, unfortunately, lack language skills, but since quite a chunk of Japanese page is in English anyway, it's acceptable, hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants