## 🚀 Feature Proposal

#7753 added basic support for WebAuthn automation in the form of the `addVirtualAuthenticator` and `removeVirtualAuthenticator` methods. Implement the rest of the methods: `addCredential`, `getCredential`, `removeCredential`, `removeAllCredentials`, `setUserVerified`.

## Motivation

Support more WebAuthn use-cases, like logging in with a specific credential, handling user verification failures, and inspecting generated credentials.

## Example

For a page like this

```html
<button id="login">Log in with WebAuthn</button>
<span id="result"></span>
```

```javascript
document.getElmentById("login").addEventListener("click", () => {
  navigator.credentials.get({...}).then(assertion => {
    document.getElementById("result").innerText = "Success!";
  })
});
```

A test could be written like so:

```java
// Set up the virtual authenticator.
HasVirtualAuthenticator virtualAuthenticatorManager = ((HasVirtualAuthenticator) driver);
VirtualAuthenticatorOptions options = new VirtualAuthenticatorOptions();
VirtualAuthenticator authenticator =
    virtualAuthenticatorManager.addVirtualAuthenticator(options);

// New code: inject a credential into the authenticator.
// Without this API the developer would have to generate a credential through
// navigator.credentials.create({...}) on the javascript side and would have less
// control over the resulting PK.
Credential credential = Credential.createNonResidentCredential(...params);
virtualAuthenticatorManager.addCredential(authenticator, credential);

// Assert login successful:
driver.findElement(By.id("login")).click();
WebElement result = driver.findElement(By.id("result"));
new WebDriverWait(driver, 60, 1000).until(
    driver -> !result.getText().equals(""));
assertThat(result.getText()).isEqualTo("Success!");
```
static CommandPayload GET_ELEMENT_VALUE_OF_CSS_PROPERTY(String id, String name) {
    return new CommandPayload(GET_ELEMENT_VALUE_OF_CSS_PROPERTY, ImmutableMap.of("id", id, "propertyName", name));
  }
  String ELEMENT_EQUALS = "elementEquals";
  String SCREENSHOT = "screenshot";
  String ELEMENT_SCREENSHOT = "elementScreenshot";
  static CommandPayload ELEMENT_SCREENSHOT(String id) {
    return new CommandPayload(ELEMENT_SCREENSHOT, ImmutableMap.of("id", id));
  }
  String ACCEPT_ALERT = "acceptAlert";
  String DISMISS_ALERT = "dismissAlert";
  String GET_ALERT_TEXT = "getAlertText";
  String SET_ALERT_VALUE = "setAlertValue";
  static CommandPayload SET_ALERT_VALUE(String keysToSend) {
    return new CommandPayload(SET_ALERT_VALUE, ImmutableMap.of("text", keysToSend));
  }
  String SET_ALERT_CREDENTIALS = "setAlertCredentials";
  String SET_TIMEOUT = "setTimeout";
  static CommandPayload SET_IMPLICIT_WAIT_TIMEOUT(long time, TimeUnit unit) {
    return new CommandPayload(
        SET_TIMEOUT, ImmutableMap.of("implicit", TimeUnit.MILLISECONDS.convert(time, unit)));
  }
  static CommandPayload SET_SCRIPT_TIMEOUT(long time, TimeUnit unit) {
    return new CommandPayload(
        SET_TIMEOUT, ImmutableMap.of("script", TimeUnit.MILLISECONDS.convert(time, unit)));
  }
  static CommandPayload SET_PAGE_LOAD_TIMEOUT(long time, TimeUnit unit) {
    return new CommandPayload(
        SET_TIMEOUT, ImmutableMap.of("pageLoad", TimeUnit.MILLISECONDS.convert(time, unit)));
  }