Bug 1414776 - [fxui] Change testcases from mozqa.com to badssl.com and mixed-content-tests-mozilla.org.
MozReview-Commit-ID: 1iD8HUShPZF
--- a/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
@@ -10,17 +10,17 @@ from marionette_harness import Marionett
class TestDVCertificate(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestDVCertificate, self).setUp()
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.browser.navbar.locationbar.identity_popup
- self.url = 'https://ssl-dv.mozqa.com'
+ self.url = 'https://mozilla-intermediate.badssl.com'
def tearDown(self):
try:
self.browser.switch_to()
self.identity_popup.close(force=True)
self.puppeteer.windows.close_all([self.browser])
finally:
super(TestDVCertificate, self).tearDown()
@@ -36,18 +36,19 @@ class TestDVCertificate(PuppeteerMixin,
self.locationbar.open_identity_popup()
# Check the identity popup doorhanger
self.assertEqual(self.identity_popup.element.get_attribute('connection'), 'secure')
cert = self.browser.tabbar.selected_tab.certificate
# The shown host equals to the certificate
- self.assertEqual(self.identity_popup.view.main.host.get_property('textContent'),
- cert['commonName'])
+ self.assertRegexpMatches(self.identity_popup.view.main.host.get_property('textContent'),
+ '.*badssl\.com$')
+ self.assertRegexpMatches(cert['commonName'], '.*badssl\.com$')
# Only the secure label is visible in the main view
secure_label = self.identity_popup.view.main.secure_connection_label
self.assertNotEqual(secure_label.value_of_css_property('display'), 'none')
insecure_label = self.identity_popup.view.main.insecure_connection_label
self.assertEqual(insecure_label.value_of_css_property('display'), 'none')
@@ -70,16 +71,16 @@ class TestDVCertificate(PuppeteerMixin,
def opener(mn):
self.identity_popup.view.security.more_info_button.click()
page_info_window = self.browser.open_page_info_window(opener)
deck = page_info_window.deck
self.assertEqual(deck.selected_panel, deck.security)
- self.assertEqual(deck.security.domain.get_property('value'),
- cert['commonName'])
+ self.assertRegexpMatches(deck.security.domain.get_property('value'),
+ '.*badssl\.com$')
self.assertEqual(deck.security.owner.get_property('value'),
page_info_window.localize_property('securityNoOwner'))
self.assertEqual(deck.security.verifier.get_property('value'),
cert['issuerOrganization'])
--- a/testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
@@ -2,24 +2,25 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from firefox_puppeteer import PuppeteerMixin
from marionette_harness import MarionetteTestCase
class TestMixedContentPage(PuppeteerMixin, MarionetteTestCase):
+
def setUp(self):
super(TestMixedContentPage, self).setUp()
self.marionette.set_pref('security.mixed_content.upgrade_display_content', False)
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
- self.url = 'https://mozqa.com/data/firefox/security/mixedcontent.html'
+ self.url = 'https://mixed.badssl.com'
def tearDown(self):
try:
self.identity_popup.close(force=True)
finally:
super(TestMixedContentPage, self).tearDown()
def test_mixed_content(self):
--- a/testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
+++ b/testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
@@ -7,17 +7,17 @@ from marionette_driver import By, Wait
from marionette_harness import MarionetteTestCase
class TestMixedScriptContentBlocking(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestMixedScriptContentBlocking, self).setUp()
- self.url = 'https://mozqa.com/data/firefox/security/mixed_content_blocked/index.html'
+ self.url = 'https://mixed-content-tests-mozilla.org/mozqa/mixed_content_blocked/'
self.test_elements = [
('result1', 'Insecure script one'),
('result2', 'Insecure script from iFrame'),
('result3', 'Insecure plugin'),
('result4', 'Insecure stylesheet'),
]
--- a/testing/firefox-ui/tests/functional/security/test_security_notification.py
+++ b/testing/firefox-ui/tests/functional/security/test_security_notification.py
@@ -12,21 +12,21 @@ from marionette_harness import Marionett
class TestSecurityNotification(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestSecurityNotification, self).setUp()
self.urls = [
# Invalid cert page
- 'https://ssl-expired.mozqa.com',
+ 'https://expired.badssl.com',
# Secure page
- 'https://ssl-ev.mozqa.com/',
+ 'https://ssl-ev.mozqa.com',
# Insecure page
- 'http://no-ssl.mozqa.com'
+ 'http://http.badssl.com'
]
self.identity_box = self.browser.navbar.locationbar.identity_box
def test_invalid_cert(self):
with self.marionette.using_context('content'):
# Go to a site that has an invalid (expired) cert
self.assertRaises(MarionetteException, self.marionette.navigate, self.urls[0])
--- a/testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
@@ -10,17 +10,17 @@ from marionette_driver.errors import Mar
from marionette_harness import MarionetteTestCase
class TestSSLDisabledErrorPage(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestSSLDisabledErrorPage, self).setUp()
- self.url = 'https://tlsv1-0.mozqa.com'
+ self.url = 'https://tls-v1-0.badssl.com:1010'
self.puppeteer.utils.sanitize({"sessions": True})
# Disable SSL 3.0, TLS 1.0 and TLS 1.1 for secure connections
# by forcing the use of TLS 1.2
# see: http://kb.mozillazine.org/Security.tls.version.*#Possible_values_and_their_effects
self.marionette.set_pref('security.tls.version.min', 3)
self.marionette.set_pref('security.tls.version.max', 3)
@@ -44,17 +44,17 @@ class TestSSLDisabledErrorPage(Puppeteer
title = self.marionette.find_element(By.CLASS_NAME, 'title-text')
nss_failure2title = self.browser.localize_entity('nssFailure2.title')
self.assertEquals(title.get_property('textContent'), nss_failure2title)
# Verify the error message is correct
short_description = self.marionette.find_element(By.ID, 'errorShortDescText')
self.assertIn('SSL_ERROR_UNSUPPORTED_VERSION',
short_description.get_property('textContent'))
- self.assertIn('mozqa.com', short_description.get_property('textContent'))
# Verify that the "Restore" button appears and works
reset_button = self.marionette.find_element(By.ID, 'prefResetButton')
reset_button.click()
# With the preferences reset, the page has to load correctly
- Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
- expected.element_present(By.LINK_TEXT, 'http://quality.mozilla.org'))
+ el = Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
+ expected.element_present(By.TAG_NAME, 'h1'))
+ self.assertIn('tls-v1-0', el.get_property('innerText'))
--- a/testing/firefox-ui/tests/functional/security/test_ssl_status_after_restart.py
+++ b/testing/firefox-ui/tests/functional/security/test_ssl_status_after_restart.py
@@ -9,29 +9,24 @@ from marionette_harness import Marionett
class TestSSLStatusAfterRestart(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestSSLStatusAfterRestart, self).setUp()
self.test_data = (
{
- 'url': 'https://ssl-dv.mozqa.com',
+ 'url': 'https://mozilla-intermediate.badssl.com',
'identity': '',
'type': 'secure'
},
{
'url': 'https://ssl-ev.mozqa.com/',
'identity': 'Mozilla Corporation',
'type': 'secure-ev'
- },
- {
- 'url': 'https://ssl-ov.mozqa.com/',
- 'identity': '',
- 'type': 'secure'
}
)
# Set browser to restore previous session
self.marionette.set_pref('browser.startup.page', 3)
# Disable rcwn to make cache behavior deterministic
self.marionette.set_pref('network.http.rcwn.enable', False)
--- a/testing/firefox-ui/tests/functional/security/test_submit_unencrypted_info_warning.py
+++ b/testing/firefox-ui/tests/functional/security/test_submit_unencrypted_info_warning.py
@@ -9,17 +9,17 @@ from marionette_driver.marionette import
from marionette_harness import MarionetteTestCase
class TestSubmitUnencryptedInfoWarning(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestSubmitUnencryptedInfoWarning, self).setUp()
- self.url = 'https://ssl-dv.mozqa.com/data/firefox/security/unencryptedsearch.html'
+ self.url = 'https://mixed-form.badssl.com/'
self.test_string = 'mozilla'
# Disable rcwn to make cache behavior deterministic
self.marionette.set_pref('network.http.rcwn.enabled', False)
self.marionette.set_pref('security.warn_submit_insecure', True)
def tearDown(self):
try:
@@ -28,18 +28,18 @@ class TestSubmitUnencryptedInfoWarning(P
finally:
super(TestSubmitUnencryptedInfoWarning, self).tearDown()
def test_submit_unencrypted_info_warning(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
# Get the page's search box and submit button.
- searchbox = self.marionette.find_element(By.ID, 'q')
- button = self.marionette.find_element(By.ID, 'submit')
+ searchbox = self.marionette.find_element(By.ID, 'value')
+ button = self.marionette.find_element(By.CSS_SELECTOR, 'button')
# Use the page's search box to submit information.
searchbox.send_keys(self.test_string)
button.click()
# Get the expected warning text and replace its two instances of "##" with "\n\n".
message = self.browser.localize_property('formPostSecureToInsecureWarning.message')
message = message.replace('##', '\n\n')
@@ -58,11 +58,10 @@ class TestSubmitUnencryptedInfoWarning(P
Wait(self.marionette).until(expected.element_stale(searchbox))
# TODO: Bug 1140470: use replacement for mozmill's waitforPageLoad
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: mn.execute_script('return document.readyState == "DOMContentLoaded" ||'
' document.readyState == "complete";')
)
- # Check that search_term contains the test string.
- search_term = self.marionette.find_element(By.ID, 'search-term')
- self.assertEqual(search_term.get_property('textContent'), self.test_string)
+ self.assertEqual('http://http.badssl.com/resources/form-submitted.html',
+ self.marionette.get_url())
--- a/testing/firefox-ui/tests/functional/security/test_unknown_issuer.py
+++ b/testing/firefox-ui/tests/functional/security/test_unknown_issuer.py
@@ -9,17 +9,17 @@ from marionette_driver.errors import Mar
from marionette_harness import MarionetteTestCase
class TestUnknownIssuer(MarionetteTestCase):
def setUp(self):
super(TestUnknownIssuer, self).setUp()
- self.url = 'https://ssl-unknownissuer.mozqa.com'
+ self.url = 'https://untrusted-root.badssl.com/'
def test_unknown_issuer(self):
with self.marionette.using_context('content'):
# Go to a site that has a cert with an unknown issuer
self.assertRaises(MarionetteException, self.marionette.navigate, self.url)
# Wait for the DOM to receive events
time.sleep(1)
--- a/testing/firefox-ui/tests/functional/security/test_untrusted_connection_error_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_untrusted_connection_error_page.py
@@ -10,17 +10,17 @@ from marionette_driver.errors import Mar
from marionette_harness import MarionetteTestCase
class TestUntrustedConnectionErrorPage(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestUntrustedConnectionErrorPage, self).setUp()
- self.url = 'https://ssl-selfsigned.mozqa.com'
+ self.url = 'https://self-signed.badssl.com'
# Disable rcwn to make cache behavior deterministic
self.marionette.set_pref('network.http.rcwn.enabled', False)
def tearDown(self):
try:
self.marionette.clear_pref('network.http.rcwn.enabled')
finally: