Skip to content

Commit a76764e

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Test Cryptominers are blocked and shown in Standard mode in the Information pannel
1 parent 49a1933 commit a76764e

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

modules/data/navigation.components.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,18 @@
184184
"selectorData": "//div[@data-text-ad]//a",
185185
"strategy": "xpath",
186186
"groups": []
187+
},
188+
189+
"shield-icon": {
190+
"selectorData": "tracking-protection-icon-container",
191+
"strategy": "id",
192+
"groups": []
193+
},
194+
195+
"cryptominers": {
196+
"selectorData": ".protections-popup-category.subviewbutton.subviewbutton-iconic.subviewbutton-nav.blocked",
197+
"strategy": "css",
198+
"groups": []
187199
}
200+
188201
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pytest
2+
3+
4+
@pytest.fixture()
5+
def suite_id():
6+
return ("X", "Security and Privacy")
7+
8+
9+
@pytest.fixture()
10+
def set_prefs():
11+
"""Set prefs"""
12+
return []
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from time import sleep
2+
from selenium.webdriver import Firefox
3+
from modules.browser_object_navigation import Navigation
4+
5+
url = "https://senglehardt.com/test/trackingprotection/test_pages/fingerprinting_and_cryptomining.html"
6+
7+
8+
def test_cryptominers_blocked_and_shown_in_info_panel(driver: Firefox):
9+
"""
10+
C450232: Cryptominers are blocked and shown in Standard mode in the Information pannel
11+
"""
12+
# Access URL, needed sleep otherwise cryptomining will be displayed as unblocked
13+
nav = Navigation(driver)
14+
sleep(2)
15+
driver.get(url)
16+
17+
# Click on the shield icon and verify that cryptominers are blocked
18+
with driver.context(driver.CONTEXT_CHROME):
19+
nav.get_element("shield-icon").click()
20+
assert nav.get_element("cryptominers").is_displayed()

0 commit comments

Comments
 (0)