Skip to content

Commit a35033e

Browse files
committed
merge main in
2 parents a4907ee + 8600804 commit a35033e

File tree

8 files changed

+152
-5
lines changed

8 files changed

+152
-5
lines changed

modules/data/about_prefs.components.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,36 @@
222222
"groups": []
223223
},
224224

225+
"custom-radio": {
226+
"selectorData": "customRadio",
227+
"strategy": "id",
228+
"groups": []
229+
},
230+
231+
"cookies-checkbox": {
232+
"selectorData": "contentBlockingBlockCookiesCheckbox",
233+
"strategy": "id",
234+
"groups": []
235+
},
236+
237+
"tracking-checkbox": {
238+
"selectorData": "contentBlockingTrackingProtectionCheckbox",
239+
"strategy": "id",
240+
"groups": []
241+
},
242+
243+
"known-fingerprints-checkbox": {
244+
"selectorData": "contentBlockingFingerprintersCheckbox",
245+
"strategy": "id",
246+
"groups": []
247+
},
248+
249+
"suspected-fingerprints-checkbox": {
250+
"selectorData": "contentBlockingFingerprintingProtectionCheckbox",
251+
"strategy": "id",
252+
"groups": []
253+
},
254+
225255
"language-dropdown": {
226256
"selectorData": "primaryBrowserLocale",
227257
"strategy": "id",

modules/data/navigation.components.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,23 @@
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": []
199+
},
200+
201+
"no-trackers-detected": {
202+
"selectorData": "protections-popup-no-trackers-found-description",
203+
"strategy": "id",
204+
"groups": []
187205
}
188206
}

tests/address_bar_and_search/test_google_search_counts_us.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
from modules.util import Utilities
99

1010

11-
# unstable: for some reason cannot pass in Taskcluster Linux VM
12-
@pytest.mark.unstable
1311
def test_google_search_counts_us(driver: Firefox):
1412
"""
1513
C1365026, Test Google Search counts - urlbar US
@@ -18,10 +16,11 @@ def test_google_search_counts_us(driver: Firefox):
1816
nav = Navigation(driver).open()
1917
nav.search("festival")
2018
sleep(5)
21-
about_telemetry = AboutTelemetry(driver).open()
2219
u = Utilities()
2320

2421
# Click on Raw JSON, switch tab and click on Raw Data
22+
about_telemetry = AboutTelemetry(driver).open()
23+
sleep(2)
2524
about_telemetry.get_element("category-raw").click()
2625
about_telemetry.switch_tab()
2726
about_telemetry.get_element("rawdata-tab").click()
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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from time import sleep
2+
3+
import pytest
4+
from selenium.webdriver import Firefox
5+
from modules.browser_object_navigation import Navigation
6+
from modules.page_object_about_prefs import AboutPrefs
7+
8+
CRYPTOMINERS_URL = "https://senglehardt.com/test/trackingprotection/test_pages/fingerprinting_and_cryptomining.html"
9+
10+
@pytest.fixture()
11+
def add_prefs():
12+
return []
13+
14+
def test_blocking_cryptominers(driver: Firefox):
15+
# instantiate objects
16+
nav = Navigation(driver).open()
17+
about_prefs = AboutPrefs(driver, category="privacy").open()
18+
19+
# Select custom option and keep just cryptominers checked
20+
about_prefs.get_element("custom-radio").click()
21+
about_prefs.get_element("cookies-checkbox").click()
22+
about_prefs.get_element("tracking-checkbox").click()
23+
about_prefs.get_element("known-fingerprints-checkbox").click()
24+
about_prefs.get_element("suspected-fingerprints-checkbox").click()
25+
sleep(2)
26+
27+
# Access url and click on the shield icon and verify that cryptominers are blocked
28+
driver.get(CRYPTOMINERS_URL)
29+
with driver.context(driver.CONTEXT_CHROME):
30+
nav.get_element("shield-icon").click()
31+
assert nav.get_element("cryptominers").is_displayed()
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()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
from modules.browser_object_navigation import Navigation
4+
5+
NOTRACKERS_URL = "http://example.com/"
6+
7+
@pytest.fixture()
8+
def add_prefs():
9+
return []
10+
11+
12+
def test_no_trackers_detected(driver: Firefox):
13+
"""
14+
C446391 No trackers are detected
15+
"""
16+
# instantiate object and access url
17+
nav = Navigation(driver)
18+
driver.get(NOTRACKERS_URL)
19+
20+
# Click on the shield icon and verify that trackers are detected
21+
with driver.context(driver.CONTEXT_CHROME):
22+
nav.get_element("shield-icon").click()
23+
assert nav.get_element("no-trackers-detected").is_displayed()

tests/sync_and_fxa/test_existing_fxa.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ def fxa_test_account():
2020
return ("[email protected]", "Test123???")
2121

2222

23-
@pytest.mark.unstable
2423
def test_sync_existing_fxa(
25-
driver: Firefox, fxa_test_account: Tuple[str, str], restmail_session, get_otp_code
24+
driver: Firefox,
25+
fxa_test_account: Tuple[str, str],
26+
restmail_session,
27+
get_otp_code,
28+
screenshot,
2629
):
30+
"""C131098: User is able to log in with existing FxAccount"""
2731
(username, password) = fxa_test_account
2832
panel_ui = PanelUi(driver)
2933
panel_ui.click_sync_sign_in_button()
@@ -40,4 +44,6 @@ def test_sync_existing_fxa(
4044
fxa.fill_otp_code(otp)
4145
except (NoSuchElementException, TimeoutException):
4246
pass
47+
with driver.context(driver.CONTEXT_CHROME):
48+
screenshot("test_sync_existing_fxa_chrome")
4349
panel_ui.confirm_sync_in_progress()

0 commit comments

Comments
 (0)