From ee23b282157ff9cfe39e4e77250b5a2f17c5545d Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Fri, 25 Jul 2025 11:30:30 +0300 Subject: [PATCH 1/8] Test stabilization autosaved generated password from context menu --- .../test_auto_saved_generated_password_context_menu.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index c66c43740..cbac783e9 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -1,3 +1,5 @@ +import time + import pytest from selenium.webdriver import Firefox @@ -37,14 +39,14 @@ def test_auto_saved_generated_password_context_menu(driver: Firefox): context_menu.click_and_hide_menu("context-menu-suggest-strong-password") # Select "Use a Securely Generated Password" in password field and check the "Update password" doorhanger - # is displayed with driver.context(driver.CONTEXT_CHROME): login_autofill.get_element("generated-securely-password").click() + nav.element_visible("password-notification-key") nav.click_on("password-notification-key") - update_doorhanger = autofill_popup_panel.get_element( - "password-update-doorhanger" + autofill_popup_panel.expect( + lambda _: UPDATE_DOORHANGER_TEXT + in autofill_popup_panel.get_element("password-update-doorhanger").text ) - assert update_doorhanger.text == UPDATE_DOORHANGER_TEXT # Navigate to about:logins page tabs.switch_to_new_tab() From 48b1f3bfd43571cef2a80fd9e8e49200a416f378 Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Fri, 25 Jul 2025 11:34:51 +0300 Subject: [PATCH 2/8] Remove redundant import --- .../test_auto_saved_generated_password_context_menu.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index cbac783e9..3df8ea94f 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -1,5 +1,3 @@ -import time - import pytest from selenium.webdriver import Firefox From 867871c9748553cc545756a8b4bce775a8cec7d3 Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Fri, 25 Jul 2025 13:04:59 +0300 Subject: [PATCH 3/8] Add a new condition --- .../test_auto_saved_generated_password_context_menu.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index 3df8ea94f..6a90c7dc3 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -39,6 +39,16 @@ def test_auto_saved_generated_password_context_menu(driver: Firefox): # Select "Use a Securely Generated Password" in password field and check the "Update password" doorhanger with driver.context(driver.CONTEXT_CHROME): login_autofill.get_element("generated-securely-password").click() + + # Wait for password field to actually get filled + login_autofill.expect( + lambda _: login_autofill.get_element("password-login-field").get_attribute( + "value" + ) + != "" + ) + + with driver.context(driver.CONTEXT_CHROME): nav.element_visible("password-notification-key") nav.click_on("password-notification-key") autofill_popup_panel.expect( From 6b56ee65042ee51ea676ec00b4570419abdda98d Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Mon, 28 Jul 2025 13:41:58 +0300 Subject: [PATCH 4/8] Make sure the Password saved banner dissapears before clicking the key icon --- SELECTOR_INFO.md | 7 +++++++ modules/data/navigation.components.json | 6 ++++++ .../test_auto_saved_generated_password_context_menu.py | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/SELECTOR_INFO.md b/SELECTOR_INFO.md index 928ada223..78d153dfe 100644 --- a/SELECTOR_INFO.md +++ b/SELECTOR_INFO.md @@ -3034,6 +3034,13 @@ Description: Developer tool icon Location: Navigation bar Path to .json: modules/data/navigation.components.json ``` +``` +Selector Name: password-saved-confirmation +Selector Data: confirmation-hint +Description: Password saved confirmation banner +Location: Navigation bar, bellow the Password key icon +Path to .json: modules/data/navigation.components.json +``` #### panel_ui ``` Selector name: panel-ui-button diff --git a/modules/data/navigation.components.json b/modules/data/navigation.components.json index d38804355..036397416 100644 --- a/modules/data/navigation.components.json +++ b/modules/data/navigation.components.json @@ -579,5 +579,11 @@ "selectorData": "developer-button", "strategy": "id", "groups": [] + }, + + "password-saved-confirmation": { + "selectorData": "confirmation-hint", + "strategy": "id", + "groups": [] } } diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index 6a90c7dc3..3aaf0a9be 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -48,8 +48,13 @@ def test_auto_saved_generated_password_context_menu(driver: Firefox): != "" ) + # Verify the update doorhanger is displayed with driver.context(driver.CONTEXT_CHROME): + # Wait for notification key to be visible nav.element_visible("password-notification-key") + + # Wait for the "Password saved" confirmation to disappear + nav.element_not_visible("password-saved-confirmation") nav.click_on("password-notification-key") autofill_popup_panel.expect( lambda _: UPDATE_DOORHANGER_TEXT From 80db347631aaf044cd31fbded6458451a8b45a54 Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Mon, 28 Jul 2025 14:49:56 +0300 Subject: [PATCH 5/8] Add doNotCache to group --- modules/data/navigation.components.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/data/navigation.components.json b/modules/data/navigation.components.json index 036397416..ce7800f88 100644 --- a/modules/data/navigation.components.json +++ b/modules/data/navigation.components.json @@ -584,6 +584,6 @@ "password-saved-confirmation": { "selectorData": "confirmation-hint", "strategy": "id", - "groups": [] + "groups": ["doNotCache"] } } From 74f48f8cdeb542db6af676fa773466a48741a6a5 Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Mon, 28 Jul 2025 15:13:10 +0300 Subject: [PATCH 6/8] Change condition --- .../test_auto_saved_generated_password_context_menu.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index 3aaf0a9be..e429c94cc 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -1,3 +1,5 @@ +from time import sleep + import pytest from selenium.webdriver import Firefox @@ -50,11 +52,7 @@ def test_auto_saved_generated_password_context_menu(driver: Firefox): # Verify the update doorhanger is displayed with driver.context(driver.CONTEXT_CHROME): - # Wait for notification key to be visible - nav.element_visible("password-notification-key") - - # Wait for the "Password saved" confirmation to disappear - nav.element_not_visible("password-saved-confirmation") + nav.element_clickable("password-notification-key") nav.click_on("password-notification-key") autofill_popup_panel.expect( lambda _: UPDATE_DOORHANGER_TEXT From 1c18bc5653e48987473508fc781d46f73b459b7a Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Mon, 28 Jul 2025 15:44:00 +0300 Subject: [PATCH 7/8] Sleep Test --- .../test_auto_saved_generated_password_context_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index e429c94cc..5d2b546c1 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -52,7 +52,7 @@ def test_auto_saved_generated_password_context_menu(driver: Firefox): # Verify the update doorhanger is displayed with driver.context(driver.CONTEXT_CHROME): - nav.element_clickable("password-notification-key") + sleep(3) nav.click_on("password-notification-key") autofill_popup_panel.expect( lambda _: UPDATE_DOORHANGER_TEXT From 3d29e1d04f1f243e88f82edc8ec9035847430262 Mon Sep 17 00:00:00 2001 From: soncuteanca Date: Mon, 28 Jul 2025 16:35:50 +0300 Subject: [PATCH 8/8] Remove locator if no longer needed --- SELECTOR_INFO.md | 7 ------- modules/data/navigation.components.json | 6 ------ .../test_auto_saved_generated_password_context_menu.py | 1 + 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/SELECTOR_INFO.md b/SELECTOR_INFO.md index 78d153dfe..928ada223 100644 --- a/SELECTOR_INFO.md +++ b/SELECTOR_INFO.md @@ -3034,13 +3034,6 @@ Description: Developer tool icon Location: Navigation bar Path to .json: modules/data/navigation.components.json ``` -``` -Selector Name: password-saved-confirmation -Selector Data: confirmation-hint -Description: Password saved confirmation banner -Location: Navigation bar, bellow the Password key icon -Path to .json: modules/data/navigation.components.json -``` #### panel_ui ``` Selector name: panel-ui-button diff --git a/modules/data/navigation.components.json b/modules/data/navigation.components.json index ce7800f88..d38804355 100644 --- a/modules/data/navigation.components.json +++ b/modules/data/navigation.components.json @@ -579,11 +579,5 @@ "selectorData": "developer-button", "strategy": "id", "groups": [] - }, - - "password-saved-confirmation": { - "selectorData": "confirmation-hint", - "strategy": "id", - "groups": ["doNotCache"] } } diff --git a/tests/password_manager/test_auto_saved_generated_password_context_menu.py b/tests/password_manager/test_auto_saved_generated_password_context_menu.py index 5d2b546c1..5c78c3c37 100644 --- a/tests/password_manager/test_auto_saved_generated_password_context_menu.py +++ b/tests/password_manager/test_auto_saved_generated_password_context_menu.py @@ -25,6 +25,7 @@ def test_auto_saved_generated_password_context_menu(driver: Firefox): """ C2248176 - Securely Generated Password is auto-saved when generated from password field context menu """ + # Instantiate objects context_menu = ContextMenu(driver) tabs = TabBar(driver)