Skip to content

Commit d80efdd

Browse files
Hani YacoubHani Yacoub
authored andcommitted
adding fixture and editing conftest
1 parent 4c1a219 commit d80efdd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/security_and_privacy/conftest.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33

44
@pytest.fixture()
55
def suite_id():
6-
return ("X", "Security and Privacy")
6+
return ("5833", "Security and Privacy")
77

88

99
@pytest.fixture()
10-
def add_prefs():
11-
return []
12-
13-
14-
@pytest.fixture()
15-
def set_prefs(add_prefs=None):
10+
def set_prefs(add_prefs: dict):
1611
"""Set prefs"""
1712
prefs = []
18-
if add_prefs is not None:
19-
prefs.extend(add_prefs)
13+
prefs.extend(add_prefs)
2014
return prefs

tests/security_and_privacy/test_cryptominers_blocked_and_shown_in_info_panel.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
from time import sleep
2+
3+
import pytest
24
from selenium.webdriver import Firefox
35
from modules.browser_object_navigation import Navigation
46

5-
cryptominers_url = "https://senglehardt.com/test/trackingprotection/test_pages/fingerprinting_and_cryptomining.html"
7+
CRYPTOMINERS_URL = "https://senglehardt.com/test/trackingprotection/test_pages/fingerprinting_and_cryptomining.html"
8+
9+
@pytest.fixture()
10+
def add_prefs():
11+
return []
612

713

814
def test_cryptominers_blocked_and_shown_in_info_panel(driver: Firefox):
@@ -12,7 +18,7 @@ def test_cryptominers_blocked_and_shown_in_info_panel(driver: Firefox):
1218
# Access URL, needed sleep otherwise cryptomining will be displayed as unblocked
1319
nav = Navigation(driver)
1420
sleep(4)
15-
driver.get(cryptominers_url)
21+
driver.get(CRYPTOMINERS_URL)
1622

1723
# Click on the shield icon and verify that cryptominers are blocked
1824
with driver.context(driver.CONTEXT_CHROME):

0 commit comments

Comments
 (0)