Created
June 22, 2020 13:10
-
-
Save friendlyfreedom/05ded4a65a29fafbb87f07d0bfcf6e08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Check CSS from element | |
| [Documentation] This keyword only works with xpath and is based on [https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle|getComputedStyle] | |
| ... You can use this keyword as follows | |
| ... | Check CSS from Element | //path/to/element | style | Expected Value | | |
| ... | Check CSS from Element | //h2/div | font-size | 24px | | |
| [Arguments] ${xpath} ${CheckStyle} ${ExpectedComputedStyle} | |
| ${ComputedStyle} Execute Javascript return document.defaultView.getComputedStyle(document.evaluate("${xpath}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue,null)['${CheckStyle}'] | |
| Should Be Equal ${ComputedStyle} ${ExpectedComputedStyle} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment