Skip to content

Commit b7c01d2

Browse files
committed
initial commit
1 parent 2479ebb commit b7c01d2

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

modules/data/navigation.components.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,41 @@
220220
"selectorData": "identity-popup-more-info",
221221
"strategy": "id",
222222
"groups": []
223+
},
224+
225+
"tracker-title": {
226+
"selectorData": "protections-popup-mainView-panel-header-span",
227+
"strategy": "id",
228+
"groups": []
229+
},
230+
231+
"tracker-cross-site-tracking": {
232+
"selectorData": "protections-popup-category-cookies",
233+
"strategy": "id",
234+
"groups": []
235+
},
236+
237+
"tracker-tracking-content": {
238+
"selectorData": "protections-popup-category-trackers",
239+
"strategy": "id",
240+
"groups": []
241+
},
242+
243+
"tracking-social-media": {
244+
"selectorData": "protections-popup-category-socialblock",
245+
"strategy": "id",
246+
"groups": []
247+
},
248+
249+
"tracking-finger-prints": {
250+
"selectorData": "protections-popup-category-fingerprinters",
251+
"strategy": "id",
252+
"groups": []
253+
},
254+
255+
"tracking-crypto-miners": {
256+
"selectorData": "protections-popup-category-cryptominers",
257+
"strategy": "id",
258+
"groups": []
223259
}
224260
}

modules/page_base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,13 @@ def hide_popup_by_child_node(
606606
with self.driver.context(self.context_id):
607607
self.driver.execute_script(script, node)
608608

609+
def open_tracker_panel(self) -> Page:
610+
"""
611+
Clicks the shield icon and opens the panel associated with it
612+
"""
613+
self.get_element("shield-icon").click()
614+
return self
615+
609616
@property
610617
def loaded(self):
611618
"""
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import logging
2+
from time import sleep
3+
4+
import pytest
5+
from selenium.webdriver import Firefox
6+
7+
from modules.browser_object import Navigation, PanelUi, TabBar
8+
from modules.page_object import GenericPage
9+
10+
11+
@pytest.fixture()
12+
def add_prefs():
13+
return [("browser.contentblocking.category", "standard")]
14+
15+
16+
def test_third_party_content_blocked_private_browsing(driver: Firefox):
17+
"""
18+
C446323: Ensure that third party content is blocked correctly
19+
"""
20+
panel_ui = PanelUi(driver).open()
21+
nav = Navigation(driver)
22+
first_tracker_website = GenericPage(
23+
driver,
24+
url="https://senglehardt.com/test/trackingprotection/test_pages/tracking_protection.html",
25+
)
26+
second_tracker_website = GenericPage(
27+
driver, url="https://itisatrap.org/firefox/its-a-tracker.html"
28+
)
29+
30+
panel_ui.open_private_window()
31+
nav.switch_to_new_window()
32+
33+
first_tracker_website.open()
34+
driver.set_context(driver.CONTEXT_CHROME)
35+
36+
shield_icon = nav.get_element("shield-icon")
37+
38+
# this could be labelled differently in different versions
39+
assert (
40+
shield_icon.get_attribute("data-l10n-id")
41+
== "tracking-protection-icon-no-trackers-detected-container"
42+
), "The label detected did not correspond to the expected one: tracking-protection-icon-no-trackers-detected-container"
43+
nav.open_tracker_panel()
44+
45+
tracker_panel_title = nav.get_element("tracker-title")
46+
logging.info(tracker_panel_title.get_attribute("innerHTML"))
47+
48+
nav.get_element("tracker-cross-site-tracking").click()

0 commit comments

Comments
 (0)