summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/selenium
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/selenium')
-rw-r--r--tests/FunctionalTests/selenium/prado-functional-test.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/FunctionalTests/selenium/prado-functional-test.js b/tests/FunctionalTests/selenium/prado-functional-test.js
index be2ea795..f9889a72 100644
--- a/tests/FunctionalTests/selenium/prado-functional-test.js
+++ b/tests/FunctionalTests/selenium/prado-functional-test.js
@@ -1,4 +1,45 @@
+/**
+ * Override selenium implementation.
+ */
+Selenium.prototype.getAttribute = function(target) {
+ return this.page().findAttribute(target);
+};
+
+
+/**
+ * Override selenium implementation.
+ */
+Selenium.prototype.isVisible = function(locator) {
+ var element;
+ element = this.page().findElement(locator);
+
+ if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ var visibility = element.style["visibility"];
+ else
+ var visibility = this.findEffectiveStyleProperty(element, "visibility");
+
+ var _isDisplayed = this._isDisplayed(element);
+ return (visibility != "hidden" && _isDisplayed);
+};
+
+
+/**
+ * Override selenium implementation.
+ */
+Selenium.prototype._isDisplayed = function(element) {
+ if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ var display = element.style["display"];
+ else
+ var display = this.findEffectiveStyleProperty(element, "display");
+ if (display == "none") return false;
+ if (element.parentNode.style) {
+ return this._isDisplayed(element.parentNode);
+ }
+ return true;
+};
+
+
function runNextTest() {
if (!runAllTests)
return;