From e589e733e555cdc58315147af2064e77439e7801 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Tue, 21 Oct 2025 12:33:04 +0300 Subject: [PATCH 01/11] Test URLs copied from address bar contain https tags --- .../test_copied_url_contains_https.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/address_bar_and_search/test_copied_url_contains_https.py diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py new file mode 100644 index 000000000..62e833a51 --- /dev/null +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -0,0 +1,14 @@ +import pytest + + +@pytest.fixture() +def test_case(): + return "3028769" + + +def test_copied_url_contains_https(): + """ + C3028712 - URLs copied from address bar contain https tags + """ + + # \ No newline at end of file From 67cc88355f481c4ab968c71d4f1addb05621328c Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Tue, 21 Oct 2025 16:30:09 +0300 Subject: [PATCH 02/11] URLs copied from address bar contain https tags --- modules/browser_object_navigation.py | 33 +++++++++++++++++++ .../test_copied_url_contains_https.py | 29 ++++++++++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/modules/browser_object_navigation.py b/modules/browser_object_navigation.py index 655e54090..0829ef47a 100644 --- a/modules/browser_object_navigation.py +++ b/modules/browser_object_navigation.py @@ -750,3 +750,36 @@ def verify_autoplay_state(self, expected: Literal["allow", "block"]) -> None: else: self.element_visible("permission-popup-audio-video-blocked") self.element_visible("autoplay-icon-blocked") + + @BasePage.context_chrome + def press_ctrl_key(self, key: str) -> BasePage: + """ + Press Ctrl/Cmd + the specified key in the Awesome Bar. + + Args: + key (str): The key to press along with Ctrl/Cmd (e.g., "c" or "v"). + """ + modifier = Keys.COMMAND if self.sys_platform() == "Darwin" else Keys.CONTROL + self.perform_key_combo(modifier, key) + return self + + @BasePage.context_chrome + def verify_https_hidden_in_address_bar(self) -> None: + """ + Wait until the HTTPS prefix is hidden in the address bar display. + """ + self.wait.until( + lambda d: "https" not in self.get_element("awesome-bar").get_attribute("value") + ) + + @BasePage.context_chrome + def verify_address_bar_value_prefix(self, prefix: str) -> None: + """ + Wait until the value in the address bar starts with the given prefix. + + Args: + prefix (str): Expected starting string (e.g., "https://"). + """ + self.wait.until( + lambda d: self.get_element("awesome-bar").get_attribute("value").startswith(prefix) + ) \ No newline at end of file diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index 62e833a51..2cc534130 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -1,4 +1,10 @@ import pytest +from selenium.webdriver import Firefox, Keys + +from modules.browser_object import Navigation + +TEST_WEBSITE = "https://www.firefox.com/" +TEXT = "https" @pytest.fixture() @@ -6,9 +12,28 @@ def test_case(): return "3028769" -def test_copied_url_contains_https(): +def test_copied_url_contains_https(driver: Firefox): """ C3028712 - URLs copied from address bar contain https tags """ - # \ No newline at end of file + # Instantiate objects + nav = Navigation(driver) + + # Input a URL in the address bar and hit enter + nav.type_in_awesome_bar(TEST_WEBSITE + Keys.ENTER) + + # Check that HTTPS is NOT displayed in the address bar for the website + nav.verify_https_hidden_in_address_bar() + + # Click on the URL bar once and hit CTRL/CMD+C to copy the link + nav.click_in_awesome_bar() + nav.press_ctrl_key("c") + + # Open a new tab and paste (CTRL/CMD+V) the link + nav.open_and_switch_to_new_window("tab") + nav.click_in_awesome_bar() + nav.press_ctrl_key("v") + + # Check that full link, including https://, is pasted in the address bar + nav.verify_address_bar_value_prefix("https://") From 4c3d7c21a81e7af7289cd7b62038a2b2fd631926 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Wed, 22 Oct 2025 11:27:57 +0300 Subject: [PATCH 03/11] Edit test --- modules/browser_object_navigation.py | 12 ------------ modules/page_base.py | 1 + .../test_copied_url_contains_https.py | 4 ++-- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/modules/browser_object_navigation.py b/modules/browser_object_navigation.py index 0829ef47a..08bf37ae7 100644 --- a/modules/browser_object_navigation.py +++ b/modules/browser_object_navigation.py @@ -751,18 +751,6 @@ def verify_autoplay_state(self, expected: Literal["allow", "block"]) -> None: self.element_visible("permission-popup-audio-video-blocked") self.element_visible("autoplay-icon-blocked") - @BasePage.context_chrome - def press_ctrl_key(self, key: str) -> BasePage: - """ - Press Ctrl/Cmd + the specified key in the Awesome Bar. - - Args: - key (str): The key to press along with Ctrl/Cmd (e.g., "c" or "v"). - """ - modifier = Keys.COMMAND if self.sys_platform() == "Darwin" else Keys.CONTROL - self.perform_key_combo(modifier, key) - return self - @BasePage.context_chrome def verify_https_hidden_in_address_bar(self) -> None: """ diff --git a/modules/page_base.py b/modules/page_base.py index e1d4fca55..f00cb9166 100644 --- a/modules/page_base.py +++ b/modules/page_base.py @@ -171,6 +171,7 @@ def expect_not(self, condition) -> Page: self.wait.until_not(condition) return self + @context_chrome def perform_key_combo(self, *keys) -> Page: """ Use ActionChains to perform key combos. Modifier keys should come first in the function call. diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index 2cc534130..e16d8e0f4 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -28,12 +28,12 @@ def test_copied_url_contains_https(driver: Firefox): # Click on the URL bar once and hit CTRL/CMD+C to copy the link nav.click_in_awesome_bar() - nav.press_ctrl_key("c") + nav.perform_key_combo(Keys.COMMAND, "c") # Open a new tab and paste (CTRL/CMD+V) the link nav.open_and_switch_to_new_window("tab") nav.click_in_awesome_bar() - nav.press_ctrl_key("v") + nav.perform_key_combo(Keys.COMMAND, "v") # Check that full link, including https://, is pasted in the address bar nav.verify_address_bar_value_prefix("https://") From 924a6522e52dcc95ea1bd1e1de84d06dfd3f6bf9 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Wed, 22 Oct 2025 11:35:50 +0300 Subject: [PATCH 04/11] Edit test name --- tests/address_bar_and_search/test_copied_url_contains_https.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index e16d8e0f4..ed29d1b90 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -9,7 +9,7 @@ @pytest.fixture() def test_case(): - return "3028769" + return "3028712" def test_copied_url_contains_https(driver: Firefox): From 745aa3535c48a32fee7ab637d2dab589c4557089 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Wed, 22 Oct 2025 12:34:14 +0300 Subject: [PATCH 05/11] edit test --- modules/page_base.py | 14 +++++++++++++- .../test_copied_url_contains_https.py | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/page_base.py b/modules/page_base.py index f00cb9166..7d15b4b45 100644 --- a/modules/page_base.py +++ b/modules/page_base.py @@ -171,7 +171,6 @@ def expect_not(self, condition) -> Page: self.wait.until_not(condition) return self - @context_chrome def perform_key_combo(self, *keys) -> Page: """ Use ActionChains to perform key combos. Modifier keys should come first in the function call. @@ -191,6 +190,19 @@ def perform_key_combo(self, *keys) -> Page: return self + @context_chrome + def perform_key_combo_chrome(self, *keys) -> Page: + """ + Perform a keyboard shortcut in the browser chrome context (e.g., address bar). + + This method should be used for actions that target browser UI elements such as the + awesome bar or toolbar buttons — not web content. + + Example: + self.perform_key_combo_chrome(Keys.COMMAND, "c") # Copy from address bar + """ + return self.perform_key_combo(*keys) + def load_element_manifest(self, manifest_loc): """Populate self.elements with the parse of the elements JSON""" logging.info(f"Loading element manifest: {manifest_loc}") diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index ed29d1b90..a02cbadd6 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -28,12 +28,12 @@ def test_copied_url_contains_https(driver: Firefox): # Click on the URL bar once and hit CTRL/CMD+C to copy the link nav.click_in_awesome_bar() - nav.perform_key_combo(Keys.COMMAND, "c") + nav.perform_key_combo_chrome(Keys.COMMAND, "c") # Open a new tab and paste (CTRL/CMD+V) the link nav.open_and_switch_to_new_window("tab") nav.click_in_awesome_bar() - nav.perform_key_combo(Keys.COMMAND, "v") + nav.perform_key_combo_chrome(Keys.COMMAND, "v") # Check that full link, including https://, is pasted in the address bar nav.verify_address_bar_value_prefix("https://") From d5dc7c73299afbeeb60c7bd284497bc51f24ef76 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Thu, 23 Oct 2025 15:29:50 +0300 Subject: [PATCH 06/11] changes --- .../test_copied_url_contains_https.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index a02cbadd6..675020920 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -2,6 +2,7 @@ from selenium.webdriver import Firefox, Keys from modules.browser_object import Navigation +from modules.browser_object_tabbar import TabBar TEST_WEBSITE = "https://www.firefox.com/" TEXT = "https" @@ -19,6 +20,7 @@ def test_copied_url_contains_https(driver: Firefox): # Instantiate objects nav = Navigation(driver) + tabs = TabBar(driver) # Input a URL in the address bar and hit enter nav.type_in_awesome_bar(TEST_WEBSITE + Keys.ENTER) @@ -28,12 +30,12 @@ def test_copied_url_contains_https(driver: Firefox): # Click on the URL bar once and hit CTRL/CMD+C to copy the link nav.click_in_awesome_bar() - nav.perform_key_combo_chrome(Keys.COMMAND, "c") + nav.perform_key_combo(Keys.CONTROL, "c") # Open a new tab and paste (CTRL/CMD+V) the link nav.open_and_switch_to_new_window("tab") nav.click_in_awesome_bar() - nav.perform_key_combo_chrome(Keys.COMMAND, "v") + nav.perform_key_combo(Keys.CONTROL, "v") # Check that full link, including https://, is pasted in the address bar nav.verify_address_bar_value_prefix("https://") From 17976d3af868bd27325fdc28c59c3e663857d38a Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Thu, 23 Oct 2025 16:59:37 +0300 Subject: [PATCH 07/11] Edit perform_key_combo --- modules/page_base.py | 5 +++-- .../address_bar_and_search/test_copied_url_contains_https.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/page_base.py b/modules/page_base.py index 7d15b4b45..fb8151caa 100644 --- a/modules/page_base.py +++ b/modules/page_base.py @@ -176,8 +176,9 @@ def perform_key_combo(self, *keys) -> Page: Use ActionChains to perform key combos. Modifier keys should come first in the function call. Usage example: perform_key_combo(Keys.CONTROL, Keys.ALT, "c") presses CTRL+ALT+c. """ - while Keys.CONTROL in keys and self.sys_platform == "Darwin": - keys[keys.index(Keys.CONTROL)] = Keys.COMMAND + if self.sys_platform() == "Darwin": + keys = tuple(Keys.COMMAND if k == Keys.CONTROL else k for k in keys) + for k in keys[:-1]: self.actions.key_down(k) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index 675020920..eb71854c8 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -30,12 +30,12 @@ def test_copied_url_contains_https(driver: Firefox): # Click on the URL bar once and hit CTRL/CMD+C to copy the link nav.click_in_awesome_bar() - nav.perform_key_combo(Keys.CONTROL, "c") + nav.perform_key_combo_chrome(Keys.CONTROL, "c") # Open a new tab and paste (CTRL/CMD+V) the link nav.open_and_switch_to_new_window("tab") nav.click_in_awesome_bar() - nav.perform_key_combo(Keys.CONTROL, "v") + nav.perform_key_combo_chrome(Keys.CONTROL, "v") # Check that full link, including https://, is pasted in the address bar nav.verify_address_bar_value_prefix("https://") From 231f6f153bdf5cfd080d90a55d32a55e7c3dd56e Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Mon, 27 Oct 2025 11:20:20 +0200 Subject: [PATCH 08/11] Edit comments --- .../address_bar_and_search/test_copied_url_contains_https.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index eb71854c8..66c5d7ff5 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -28,11 +28,11 @@ def test_copied_url_contains_https(driver: Firefox): # Check that HTTPS is NOT displayed in the address bar for the website nav.verify_https_hidden_in_address_bar() - # Click on the URL bar once and hit CTRL/CMD+C to copy the link + # Click on the URL bar once and hit CTRL/CMD+c to copy the link nav.click_in_awesome_bar() nav.perform_key_combo_chrome(Keys.CONTROL, "c") - # Open a new tab and paste (CTRL/CMD+V) the link + # Open a new tab and paste (CTRL/CMD+v) the link nav.open_and_switch_to_new_window("tab") nav.click_in_awesome_bar() nav.perform_key_combo_chrome(Keys.CONTROL, "v") From 5eab2a372321cc8efa602e6e036cd7c79fc9e056 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Mon, 27 Oct 2025 14:27:35 +0200 Subject: [PATCH 09/11] edit code --- tests/address_bar_and_search/test_copied_url_contains_https.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index 66c5d7ff5..cc16f84dd 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -2,7 +2,6 @@ from selenium.webdriver import Firefox, Keys from modules.browser_object import Navigation -from modules.browser_object_tabbar import TabBar TEST_WEBSITE = "https://www.firefox.com/" TEXT = "https" @@ -20,7 +19,6 @@ def test_copied_url_contains_https(driver: Firefox): # Instantiate objects nav = Navigation(driver) - tabs = TabBar(driver) # Input a URL in the address bar and hit enter nav.type_in_awesome_bar(TEST_WEBSITE + Keys.ENTER) From 834e8efae9c1d775e7e44721599aa88356aef951 Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Thu, 30 Oct 2025 15:09:33 +0200 Subject: [PATCH 10/11] Replace a function --- tests/address_bar_and_search/test_copied_url_contains_https.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index cc16f84dd..2824848a8 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -21,7 +21,7 @@ def test_copied_url_contains_https(driver: Firefox): nav = Navigation(driver) # Input a URL in the address bar and hit enter - nav.type_in_awesome_bar(TEST_WEBSITE + Keys.ENTER) + nav.search(TEST_WEBSITE) # Check that HTTPS is NOT displayed in the address bar for the website nav.verify_https_hidden_in_address_bar() From 4f001e7368d976823e4f7bb83940a199b235e2fe Mon Sep 17 00:00:00 2001 From: Hani Yacoub Date: Fri, 31 Oct 2025 14:33:18 +0200 Subject: [PATCH 11/11] Edit comment --- tests/address_bar_and_search/test_copied_url_contains_https.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/address_bar_and_search/test_copied_url_contains_https.py b/tests/address_bar_and_search/test_copied_url_contains_https.py index 2824848a8..dd7363123 100644 --- a/tests/address_bar_and_search/test_copied_url_contains_https.py +++ b/tests/address_bar_and_search/test_copied_url_contains_https.py @@ -17,7 +17,7 @@ def test_copied_url_contains_https(driver: Firefox): C3028712 - URLs copied from address bar contain https tags """ - # Instantiate objects + # Instantiate object nav = Navigation(driver) # Input a URL in the address bar and hit enter