Skip to content

Commit f7b5b30

Browse files
committed
Move URL constants
1 parent 0f63f73 commit f7b5b30

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/security_and_privacy/test_phishing_and_malware_warnings.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
from modules.browser_object_tabbar import TabBar
88

9+
PHISHING_URL = "http://www.itisatrap.org/firefox/its-a-trap.html"
10+
MALWARE_URL = "http://www.itisatrap.org/firefox/its-an-attack.html"
11+
912

1013
@pytest.fixture()
1114
def add_prefs():
@@ -35,10 +38,9 @@ def test_phishing_and_malware_warning_errors(driver: Firefox):
3538
tabs = TabBar(driver)
3639

3740
# Test phishing warning page
38-
phishing_url = "http://www.itisatrap.org/firefox/its-a-trap.html"
39-
phishing_error_title = get_error_title(driver, phishing_url)
41+
phishing_error_title = get_error_title(driver, PHISHING_URL)
4042
assert phishing_error_title == "Deceptive site ahead", (
41-
f"Expected error title 'Deceptive site ahead' not found at {phishing_url}. "
43+
f"Expected error title 'Deceptive site ahead' not found at {PHISHING_URL}. "
4244
f"Actual: {phishing_error_title}"
4345
)
4446

@@ -48,9 +50,8 @@ def test_phishing_and_malware_warning_errors(driver: Firefox):
4850
driver.switch_to.window(driver.window_handles[1])
4951

5052
# Test malware warning page
51-
malware_url = "http://www.itisatrap.org/firefox/its-an-attack.html"
52-
malware_error_title = get_error_title(driver, malware_url)
53+
malware_error_title = get_error_title(driver, MALWARE_URL)
5354
assert malware_error_title == "Visiting this website may harm your computer", (
54-
f"Expected error title 'Visiting this website may harm your computer' not found at {malware_url}. "
55+
f"Expected error title 'Visiting this website may harm your computer' not found at {MALWARE_URL}. "
5556
f"Actual: {malware_error_title}"
5657
)

0 commit comments

Comments
 (0)