File tree Expand file tree Collapse file tree 4 files changed +80
-0
lines changed
tests/security_and_privacy Expand file tree Collapse file tree 4 files changed +80
-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 184
184
"selectorData" : " //div[@data-text-ad]//a" ,
185
185
"strategy" : " xpath" ,
186
186
"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" : []
187
199
}
188
200
}
Original file line number Diff line number Diff line change
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 []
Original file line number Diff line number Diff line change
1
+ from time import sleep
2
+ from selenium .webdriver import Firefox
3
+
4
+ from modules .browser_object_navigation import Navigation
5
+ from modules .page_object_about_prefs import AboutPrefs
6
+
7
+ url = "https://senglehardt.com/test/trackingprotection/test_pages/fingerprinting_and_cryptomining.html"
8
+
9
+
10
+ def test_blocking_cryptominers (driver : Firefox ):
11
+ # instantiate objects
12
+ nav = Navigation (driver ).open ()
13
+ about_prefs = AboutPrefs (driver , category = "privacy" ).open ()
14
+
15
+ # Select custom option and keep just cryptominers checked
16
+ about_prefs .get_element ("custom-radio" ).click ()
17
+ about_prefs .get_element ("cookies-checkbox" ).click ()
18
+ about_prefs .get_element ("tracking-checkbox" ).click ()
19
+ about_prefs .get_element ("known-fingerprints-checkbox" ).click ()
20
+ about_prefs .get_element ("suspected-fingerprints-checkbox" ).click ()
21
+
22
+ # Access url and click on the shield icon and verify that cryptominers are blocked
23
+ driver .get (url )
24
+ with driver .context (driver .CONTEXT_CHROME ):
25
+ nav .get_element ("shield-icon" ).click ()
26
+ assert nav .get_element ("cryptominers" ).is_displayed ()
You can’t perform that action at this time.
0 commit comments