diff --git a/src/widgetastic/widget/base.py b/src/widgetastic/widget/base.py index 4ad2f414..9cd3c7a5 100644 --- a/src/widgetastic/widget/base.py +++ b/src/widgetastic/widget/base.py @@ -323,7 +323,7 @@ def __element__(self): It uses :py:meth:`__locator__` to retrieve the locator and then it looks up the WebElement on the parent's browser. - If hte ``__locator__`` isbadly implemented and returns a ``WebElement`` instance, it returns + If the ``__locator__`` isbadly implemented and returns a ``WebElement`` instance, it returns it directly. You usually want this method to be intact. @@ -483,6 +483,18 @@ def is_displayed(self): """ return self.browser.is_displayed(self) + @property + def is_enabled(self): + """Check widget is enabled or not. + + The logic behind `is_enabled` is WebElement property. If `__locator__` not pointing to the + expected `WebElement`, you can always override this. + + Returns: + :py:class:`bool` + """ + return self.browser.element(self).is_enabled() + @logged() def wait_displayed(self, timeout='10s', delay=0.2): """Wait for the element to be displayed. Uses the :py:meth:`is_displayed` diff --git a/testing/html/testing_page.html b/testing/html/testing_page.html index 0c466e86..01ded906 100644 --- a/testing/html/testing_page.html +++ b/testing/html/testing_page.html @@ -31,7 +31,9 @@