From 36f2998c91e0bc1023af94df36821cd70ad3635d Mon Sep 17 00:00:00 2001
From: shortcutme <tamas@zeronet.io>
Date: Mon, 26 Nov 2018 00:12:12 +0100
Subject: [PATCH] Test if js works in raw and normal mode

---
 src/Test/TestWeb.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Test/TestWeb.py b/src/Test/TestWeb.py
index 08052e45..10e1829d 100644
--- a/src/Test/TestWeb.py
+++ b/src/Test/TestWeb.py
@@ -65,6 +65,7 @@ class TestWeb:
         # Switch to inner frame
         browser.switch_to.frame(browser.find_element_by_id("inner-iframe"))
         assert "wrapper_nonce" in getContextUrl(browser)
+        assert browser.find_element_by_id("script_output").text == "Result: Works"
         browser.switch_to.default_content()
 
         # Clicking on links without target
@@ -95,3 +96,10 @@ class TestWeb:
         assert "wrapper_nonce" in getContextUrl(browser)  # We try to use nonce-ed html without iframe
         assert "<iframe" in browser.page_source  # Only allow to use nonce once-time
         browser.switch_to.default_content()
+
+    def testRaw(self, browser, site_url):
+        browser.get("%s/raw/1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr/test/security.html" % site_url)
+        WebDriverWait(browser, 10).until(title_is("Security tests"))
+        assert getContextUrl(browser) == "%s/raw/1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr/test/security.html" % site_url
+
+        assert browser.find_element_by_id("script_output").text == "Result: Fail"