summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
authorwei <>2006-06-01 01:33:53 +0000
committerwei <>2006-06-01 01:33:53 +0000
commit631bf1089dc00225b2b25acbd50b09df30f9c043 (patch)
tree6906ca0c386d694050c2e42864ac8bad51b1125e /tests/FunctionalTests
parent6796911286d4b519bee507477398c3ae3e9097a7 (diff)
Override selenium getAttribute implementation.
Diffstat (limited to 'tests/FunctionalTests')
-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;