jonhoo / fantoccini

A high-level API for programmatically interacting with web pages through WebDriver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webdriver might be part of public API

davidpdrsn opened this issue · comments

I was watching your most recent stream where you mentioned that webdriver isn't part of fantoccini's public API. I have a little experimental tool called cargo-public-api-crates which can find crates your public API, so naturally, I ran it.

It found this for webdriver:

webdriver
├── webdriver::command::WebDriverCommand
│   └── src/session.rs:38:0
└── webdriver::command::VoidWebDriverExtensionCommand
    └── src/session.rs:38:0

That is this impl which does appear to contain types from webdriver.

I'm wondering if this is something you're aware of and if its a false positive in my tool, or if this impl actually does leak the webdriver version.

Ah, interesting, your tool is entirely correct, that is a leak. The intent is for this impl to be a private impl of the trait, not a public one, but at the moment that's not a thing we can express. The way to fix this short-term is to add a private wrapper type for Wcmd and implement the trait for that instead, and then convert all the code that currently passes in Wcmds to issue_cmd to inject that wrapper type as well. It's pretty annoying, but it's what we'll have to do I suppose. Any chance you'd want to take a stab at that?