Skip to content

Commit fd7a681

Browse files
authored
Merge pull request #114 from mozilla/as/tls-v1.2-protocol
As/tls protocol
2 parents 4455851 + b4bf613 commit fd7a681

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

modules/data/navigation.components.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,23 @@
202202
"selectorData": "protections-popup-no-trackers-found-description",
203203
"strategy": "id",
204204
"groups": []
205+
},
206+
207+
"lock-icon": {
208+
"selectorData": "identity-icon",
209+
"strategy": "id",
210+
"groups": []
211+
},
212+
213+
"connection-secure-button": {
214+
"selectorData": "identity-popup-security-button",
215+
"strategy": "id",
216+
"groups": []
217+
},
218+
219+
"more-information-button": {
220+
"selectorData": "identity-popup-more-info",
221+
"strategy": "id",
222+
"groups": []
205223
}
206224
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
from selenium.webdriver.common.by import By
4+
from selenium.webdriver.support import expected_conditions as EC
5+
from selenium.webdriver.support.wait import WebDriverWait
6+
7+
from modules.browser_object_navigation import Navigation
8+
9+
TLS_URL = "https://tls-v1-2.badssl.com:1012/"
10+
11+
12+
@pytest.fixture()
13+
def add_prefs():
14+
return []
15+
16+
17+
def test_tls_v1_2_protocol(driver: Firefox):
18+
"""
19+
C192739 - TLS v1.2 protocol is handled correctly and returns the proper information
20+
"""
21+
nav = Navigation(driver)
22+
driver.get(TLS_URL)
23+
24+
tls_content = WebDriverWait(driver, 10).until(
25+
EC.presence_of_element_located((By.ID, "content"))
26+
)
27+
28+
expected_content = "tls-v1-2.\nbadssl.com"
29+
assert (
30+
tls_content.text == expected_content
31+
), f"Expected '{expected_content}' but found '{tls_content.text}' at {TLS_URL}"
32+
33+
with driver.context(driver.CONTEXT_CHROME):
34+
nav.get_element("lock-icon").click()
35+
nav.get_element("connection-secure-button").click()
36+
nav.get_element("more-information-button").click()
37+
38+
driver.switch_to.window(driver.window_handles[-1])
39+
40+
technical_details = WebDriverWait(driver, 10).until(
41+
EC.presence_of_element_located((By.ID, "security-technical-shortform"))
42+
)
43+
44+
expected_technical_details = ("Connection Encrypted (TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 256 bit keys, "
45+
"TLS 1.2)")
46+
assert (
47+
technical_details.get_attribute("value") == expected_technical_details
48+
), f"Expected '{expected_technical_details}' but found '{technical_details.get_attribute('value')}'"

0 commit comments

Comments
 (0)