selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🚀 Feature]: Adding BiDi in DefinitelyTyped

Open dtopuzov opened this issue 2 years ago • 8 comments

Feature and motivation

First I want to thank you for introducing Bidi Support and Browsing context commands. It will be great if the features above are present in DefinitelyTyped so we can use it in TypeScript projects.

Usage example

    beforeEach(async function () {
      driver = await env
        .builder()
        .setFirefoxOptions(new firefox.Options().enableBidi())
        .build()
    })

Do not compile in TS project because enableBidi() is not present in DefinitelyTyped.

dtopuzov avatar Feb 20 '23 08:02 dtopuzov

@dtopuzov, 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!

github-actions[bot] avatar Feb 20 '23 08:02 github-actions[bot]

This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Dec 18 '23 10:12 github-actions[bot]

@pujagani is this the responsibility of Selenium project, or is this something that anyone can contribute to the project by taking what has already been implemented in our repo and adding it to that other repo?

I'm not sure we should be tracking this here since there will always be things we can put over there. What do you think?

titusfortner avatar Dec 31 '23 16:12 titusfortner

Anyone can help contribute to the project and it might be a good candidate for first-bug sort of work too. You are right, tracking this is hard because tracking Selenium's BiDi work itself is hard and then tracking something that is part of a different project is harder.

pujagani avatar Jan 09 '24 05:01 pujagani

If I understand this correctly, what goes into DefinitelyTyped is the type definitions for TypeScript. Then, for new code, this should be added by the person adding that code.

For existing code, we should create issues for missing types. Overall, I think this is the responsibility of the project, or at least point out what is missing.

Are the docs that show how to add these things?

diemol avatar Jan 09 '24 13:01 diemol

@diemol you are right, DefinitelyTyped is a community effort to provide typings for packages that do not provide such together with the package.

I think it will be better if the Selenium project provides its official typings together with selenium-webdriver npm package. Hope that will give more consistency between what is available as APIs in JavaScript and what is exposed in typings for TS projects (why not even re-write selenium-webdriver package itself in TypeScript).

Current definitions at DefinitelyTyped are ok in general (no major issues, just some missing pieces like this one). I hope once we have official BiDi support in Selenium we will have some way to use it in TypeScript projects too.

I think TypeScript support is important for the success of the Selenium project because most modern web development is Typescript (Angular/React/Vue) and engineers prefer writing tests in the same language they implemented the product.

dtopuzov avatar Jan 09 '24 19:01 dtopuzov

It's an open issue — https://github.com/SeleniumHQ/selenium/issues/10942 @harsha509 was looking into it at one point, but I know he's got a lot on his plate right now.

@AutomatedTester what does @nightwatchjs do? Is there an interest from your end on changing what we are doing?

titusfortner avatar Jan 09 '24 19:01 titusfortner

This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Oct 15 '24 20:10 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Oct 30 '24 10:10 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 29 '24 22:11 github-actions[bot]

Why don't we put the type definitions in our repo instead? @harsha509 do we still want to move to TypeScript?

diemol avatar Jul 22 '25 12:07 diemol

Why don't we put the type definitions in our repo instead? @harsha509 do we still want to move to TypeScript?

HI @diemol ,

I have already moved entire bindings to TS (except atoms). Currently fixing type issues and migrating tests.

Thanks, Sri

harsha509 avatar Jul 25 '25 16:07 harsha509

That is great, @harsha509!

diemol avatar Aug 20 '25 10:08 diemol

@harsha509 what more needs to be done for this issue, or can we close it?

titusfortner avatar Dec 17 '25 15:12 titusfortner