Skip to content

[🐛 Bug]: implicit wait example: tiny inconsistency across languages: javascript example does more than examples for other languages #1680

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

Closed
zipperer opened this issue Apr 21, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation needs-triaging

Comments

@zipperer
Copy link
Contributor

zipperer commented Apr 21, 2024

What happened?

This page that describes implicit waits includes code examples for Java, Python, CSharp, Ruby, and JavaScript. The JavaScript example both: (1) sets the value for the implicit wait and (2) demonstrates the benefit of setting a value for the implicit wait by finding an element that is not immediately available on the page. The examples for the other languages do (1) but not (2). So, there is a tiny inconsistency across the examples for the different languages. And that is the whole bug that this issue reports.

Below I paste four screenshots to show the examples for JavaScript, CSharp, Python, and Java. The screenshots differ on which tab I chose for language for the code example.

20240421-implicit-wait-example-javascript
20240421-implicit-wait-example-csharp
20240421-implicit-wait-example-python
20240421-implicit-wait-example-java

Suppose that this bug is worth doing anything about. Then, if we want the examples to be consistent across each of the languages, options include:

  • remove (2) from the JavaScript example
  • add (2) to the other examples

Option "remove (2) from the JavaScript example"

I claim: the source for that page is waits.en.md, and to remove (2) from the JavaScript example we could change

{{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/waits/waits.spec.js#L37-L41" >}} {{< /tab >}}

to

{{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/waits/waits.spec.js#L37" >}} {{< /tab >}}

i.e. change L37-L41 to L37.

Option "add (2) to the other examples"

On waits.en.md, change the gh-codeblock paths for the other languages to include an interval of lines that extends to the line that finds element with id "box0". For example, change

{{< tab header="Java" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50" >}} {{< /tab >}}

to

{{< tab header="Java" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50-L54" >}} {{< /tab >}}

i.e. change L50 to L50-L54. And perform a similar edit for Python, CSharp, and Ruby.

Best wishes,
Andrew

What browsers and operating systems are you seeing the problem on?

Browser: Brave v1.64.109
OS: macOS Big Sur v11.7.10

@zipperer zipperer added bug Something isn't working needs-triaging labels Apr 21, 2024
Copy link
Contributor

@zipperer, 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.

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

Thank you!

@zipperer
Copy link
Contributor Author

Suppose this bug is worth doing anything about. Then there are similar bugs to note:

On the same page, in the examples for explicit wait:

  • the example for Ruby differs from the others
    • the others specify a timeout of 2 seconds while the example for Ruby does not
  • the example for JavaScript does more than the others

Within the next section 'Customization', the Ruby example shows how to set a timeout.

@harsha509 harsha509 added documentation Improvements or additions to documentation and removed bug Something isn't working labels Apr 25, 2024
@zipperer
Copy link
Contributor Author

zipperer commented May 7, 2024

Thank you, @harsha509 :)

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 needs-triaging
Projects
None yet
Development

No branches or pull requests

2 participants