summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/selenium/prado-functional-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/selenium/prado-functional-test.js')
-rw-r--r--tests/FunctionalTests/selenium/prado-functional-test.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/FunctionalTests/selenium/prado-functional-test.js b/tests/FunctionalTests/selenium/prado-functional-test.js
index 37e26516..be2ea795 100644
--- a/tests/FunctionalTests/selenium/prado-functional-test.js
+++ b/tests/FunctionalTests/selenium/prado-functional-test.js
@@ -172,4 +172,21 @@ function get_color_status(element)
if(color == failColor) return "failed";
if(color == doneColor) return "done";
return "";
-} \ No newline at end of file
+}
+
+
+
+
+Selenium.prototype.assertHTMLPresent = function(expectedValue) {
+ var actualValue = this.page().currentDocument.body.innerHTML;
+ if(actualValue.indexOf(expectedValue) >= 0)
+ return;
+ Assert.fail("Unable to find '"+(expectedValue.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "\""))+"' in document.body");
+};
+
+Selenium.prototype.assertHTMLNotPresent = function(expectedValue) {
+ var actualValue = this.page().currentDocument.body.innerHTML;
+ if(actualValue.indexOf(expectedValue) < 0)
+ return;
+ Assert.fail("'"+(expectedValue.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "\""))+"' was found in document.body");
+}; \ No newline at end of file