From 7ad44eef93a2797fdfa14f05f0ff0bb8c4a2525f Mon Sep 17 00:00:00 2001 From: titusfortner Date: Wed, 17 Jan 2024 09:45:06 -0600 Subject: [PATCH] [java] add click dialog support to Federated Credential Management implementation --- .../openqa/selenium/remote/DriverCommand.java | 1 + .../remote/codec/AbstractHttpCommandCodec.java | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/java/src/org/openqa/selenium/remote/DriverCommand.java b/java/src/org/openqa/selenium/remote/DriverCommand.java index 19be5283c5919..2ca33e85ed44b 100644 --- a/java/src/org/openqa/selenium/remote/DriverCommand.java +++ b/java/src/org/openqa/selenium/remote/DriverCommand.java @@ -152,6 +152,7 @@ public interface DriverCommand { // https://fedidcg.github.io/FedCM/#automation String CANCEL_DIALOG = "cancelDialog"; String SELECT_ACCOUNT = "selectAccount"; + String CLICK_DIALOG = "clickDialog"; String GET_ACCOUNTS = "getAccounts"; String GET_FEDCM_TITLE = "getFedCmTitle"; String GET_FEDCM_DIALOG_TYPE = "getFedCmDialogType"; diff --git a/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java b/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java index 7dfa0390c0556..77987b49d7020 100644 --- a/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java +++ b/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java @@ -25,6 +25,7 @@ import static org.openqa.selenium.remote.DriverCommand.ADD_VIRTUAL_AUTHENTICATOR; import static org.openqa.selenium.remote.DriverCommand.CANCEL_DIALOG; import static org.openqa.selenium.remote.DriverCommand.CLEAR_ELEMENT; +import static org.openqa.selenium.remote.DriverCommand.CLICK_DIALOG; import static org.openqa.selenium.remote.DriverCommand.CLICK_ELEMENT; import static org.openqa.selenium.remote.DriverCommand.CLOSE; import static org.openqa.selenium.remote.DriverCommand.DELETE_ALL_COOKIES; @@ -196,14 +197,14 @@ public AbstractHttpCommandCodec() { defineCommand(SET_USER_VERIFIED, post(webauthnId + "/uv")); // Federated Credential Management API - String fedcm = sessionId + "/fedcm"; - defineCommand(CANCEL_DIALOG, post(fedcm + "/canceldialog")); - defineCommand(SELECT_ACCOUNT, post(fedcm + "/selectaccount")); - defineCommand(GET_ACCOUNTS, get(fedcm + "/accountlist")); - defineCommand(GET_FEDCM_TITLE, get(fedcm + "/gettitle")); - defineCommand(GET_FEDCM_DIALOG_TYPE, get(fedcm + "/getdialogtype")); - defineCommand(SET_DELAY_ENABLED, post(fedcm + "/setdelayenabled")); - defineCommand(RESET_COOLDOWN, post(fedcm + "/resetCooldown")); + defineCommand(CANCEL_DIALOG, post("/fedcm/canceldialog")); + defineCommand(SELECT_ACCOUNT, post("/fedcm/selectaccount")); + defineCommand(CLICK_DIALOG, post("/fedcm/clickdialogbutton")); + defineCommand(GET_ACCOUNTS, get("/fedcm/accountlist")); + defineCommand(GET_FEDCM_TITLE, get("/fedcm/gettitle")); + defineCommand(GET_FEDCM_DIALOG_TYPE, get("/fedcm/getdialogtype")); + defineCommand(SET_DELAY_ENABLED, post("/fedcm/setdelayenabled")); + defineCommand(RESET_COOLDOWN, post("/fedcm/resetcooldown")); defineCommand(GET_DOWNLOADABLE_FILES, get(sessionId + "/se/files")); defineCommand(DOWNLOAD_FILE, post(sessionId + "/se/files"));