diff --git a/lib/WebDriver/Element.php b/lib/WebDriver/Element.php index d4ecddf..937ab17 100644 --- a/lib/WebDriver/Element.php +++ b/lib/WebDriver/Element.php @@ -19,7 +19,6 @@ * @method string attribute($attributeName) Get the value of an element's attribute. * @method void clear() Clear a TEXTAREA or text INPUT element's value. * @method void click() Click on an element. - * @method string css($propertyName) Query the value of an element's computed CSS property. * @method boolean displayed() Determine if an element is currently displayed. * @method boolean enabled() Determine if an element is currently enabled. * @method boolean equals($otherId) Test if two element IDs refer to the same DOM element. @@ -55,7 +54,6 @@ protected function methods() 'attribute' => array('GET'), 'clear' => array('POST'), 'click' => array('POST'), - 'css' => array('GET'), 'enabled' => array('GET'), 'name' => array('GET'), 'property' => array('GET'), @@ -115,6 +113,20 @@ public function getID() return $this->id; } + /** + * Query the value of an element’s computed CSS property: /session/:sessionId/element/:id/css/:propertyName + * + * @param string $propertyName + * + * @return mixed + */ + public function css($propertyName) + { + $result = $this->curl('GET', "/css/$propertyName"); + + return $result['value']; + } + /** * Get element shadow root: /session/:sessionId/element/:elementId/shadow *