Skip to content

Commit d4656c1

Browse files
authored
Merge pull request #109 from mozilla/hy/cryptominers_blocked_shown_info_panel
hy/Test Cryptominers are blocked and shown in Standard mode Info panel
2 parents 49a1933 + d80efdd commit d4656c1

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pytest
2+
3+
4+
@pytest.fixture()
5+
def suite_id():
6+
return ("5833", "Security and Privacy")
7+
8+
9+
@pytest.fixture()
10+
def set_prefs(add_prefs: dict):
11+
"""Set prefs"""
12+
prefs = []
13+
prefs.extend(add_prefs)
14+
return prefs
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from time import sleep
2+
3+
import pytest
4+
from selenium.webdriver import Firefox
5+
from modules.browser_object_navigation import Navigation
6+
7+
CRYPTOMINERS_URL = "https://senglehardt.com/test/trackingprotection/test_pages/fingerprinting_and_cryptomining.html"
8+
9+
@pytest.fixture()
10+
def add_prefs():
11+
return []
12+
13+
14+
def test_cryptominers_blocked_and_shown_in_info_panel(driver: Firefox):
15+
"""
16+
C450232: Cryptominers are blocked and shown in Standard mode in the Information pannel
17+
"""
18+
# Access URL, needed sleep otherwise cryptomining will be displayed as unblocked
19+
nav = Navigation(driver)
20+
sleep(4)
21+
driver.get(CRYPTOMINERS_URL)
22+
23+
# Click on the shield icon and verify that cryptominers are blocked
24+
with driver.context(driver.CONTEXT_CHROME):
25+
nav.get_element("shield-icon").click()
26+
assert nav.get_element("cryptominers").is_displayed()

0 commit comments

Comments
 (0)