Skip to content

Commit 55d0708

Browse files
authored
[py] Fix FedCM tests leaking state (SeleniumHQ#15583)
Dismiss FedCM dialog at the end of each test so subsequent tests can pass.
1 parent f9fe39c commit 55d0708

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

py/test/selenium/webdriver/common/fedcm_tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,35 @@ def test_trigger_and_verify_dialog_title(self, driver):
6262
driver.execute_script("triggerFedCm();")
6363
dialog = driver.fedcm_dialog()
6464
assert dialog.title == "Sign in to localhost with localhost"
65+
dialog.dismiss()
6566

6667
def test_trigger_and_verify_dialog_subtitle(self, driver):
6768
driver.execute_script("triggerFedCm();")
6869
dialog = driver.fedcm_dialog()
6970
assert dialog.subtitle is None
71+
dialog.dismiss()
7072

7173
def test_trigger_and_verify_dialog_type(self, driver):
7274
driver.execute_script("triggerFedCm();")
7375
dialog = driver.fedcm_dialog()
7476
assert dialog.type == "AccountChooser"
77+
dialog.dismiss()
7578

7679
def test_trigger_and_verify_account_list(self, driver):
7780
driver.execute_script("triggerFedCm();")
7881
dialog = driver.fedcm_dialog()
7982
accounts = dialog.get_accounts()
8083
assert len(accounts) > 0
8184
assert accounts[0].name == "John Doe"
85+
dialog.dismiss()
8286

8387
def test_select_account(self, driver):
8488
driver.execute_script("triggerFedCm();")
8589
dialog = driver.fedcm_dialog()
8690
dialog.select_account(1)
8791
driver.fedcm_dialog() # Wait for dialog to become interactable
8892
# dialog.click_continue()
93+
dialog.dismiss()
8994

9095
def test_dialog_cancel(self, driver):
9196
driver.execute_script("triggerFedCm();")
@@ -136,3 +141,4 @@ def test_verify_dialog_type_after_cooldown_reset(self, driver):
136141
driver.execute_script("triggerFedCm();")
137142
dialog = driver.fedcm_dialog()
138143
assert dialog.type == "AccountChooser"
144+
dialog.dismiss()

0 commit comments

Comments
 (0)