Skip to content

Commit

Permalink
Fix FedCM command definition
Browse files Browse the repository at this point in the history
This lets us re-enable the FedCM tests, which this change does we
well.

In addition, newer versions of Chrome look for a "login_url" field instead
of "signin_url", so this updates the fedcm.json file accordingly.

This test failure was pointed out here:
SeleniumHQ#12096 (comment)
  • Loading branch information
cbiesinger committed Jun 3, 2024
1 parent 1b827c2 commit 3ce6c63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
3 changes: 2 additions & 1 deletion common/src/web/fedcm/fedcm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"accounts_endpoint": "accounts.json",
"client_metadata_endpoint": "client_metadata.json",
"id_assertion_endpoint": "id_assertion",
"signin_url": "/signin"
"signin_url": "/signin",
"login_url": "/signin"
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,15 @@ public AbstractHttpCommandCodec() {
defineCommand(SET_USER_VERIFIED, post(webauthnId + "/uv"));

// Federated Credential Management API
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"));
String fedcm = sessionId + "/fedcm";
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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.testing.JupiterTestBase;
import org.openqa.selenium.testing.NotYetImplemented;

class FederatedCredentialManagementTest extends JupiterTestBase {

Expand Down Expand Up @@ -81,9 +80,6 @@ private int getSecurePort() {
}

@Test
@NotYetImplemented(
value = CHROME,
reason = "https://github.com/SeleniumHQ/selenium/pull/12096#issuecomment-2017760822")
void testDismissDialog() {
fedcmDriver.setDelayEnabled(false);
assertNull(fedcmDriver.getFederatedCredentialManagementDialog());
Expand Down Expand Up @@ -116,9 +112,6 @@ void testDismissDialog() {
}

@Test
@NotYetImplemented(
value = CHROME,
reason = "https://github.com/SeleniumHQ/selenium/pull/12096#issuecomment-2017760822")
void testSelectAccount() {
fedcmDriver.setDelayEnabled(false);
assertNull(fedcmDriver.getFederatedCredentialManagementDialog());
Expand Down

0 comments on commit 3ce6c63

Please sign in to comment.