File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
tests/security_and_privacy Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 220
220
"selectorData" : " menuitem[data-l10n-id=\" home-mode-choice-default-fx\" ]" ,
221
221
"strategy" : " css" ,
222
222
"groups" : []
223
+ },
224
+
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" : []
223
253
}
224
254
}
Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments