| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>svg_test.html</title> |
| <script src="test_bootstrap.js"></script> |
| <script type="text/javascript"> |
| goog.require('bot.action'); |
| goog.require('bot.dom'); |
| goog.require('bot.locators'); |
| goog.require('bot.test'); |
| goog.require('goog.testing.jsunit'); |
| goog.require('goog.userAgent'); |
| </script> |
| <script type="text/javascript"> |
| function testSvgElementsShouldBeVisible() { |
| if (!bot.test.SUPPORTS_INLINE_SVG) { |
| return; |
| } |
| var element = bot.locators.findElement({id: 'rect'}); |
| assertTrue(bot.dom.isShown(element)); |
| } |
| |
| function testFocusingOnSvgElementDoesNotThrow() { |
| if (!bot.test.SUPPORTS_INLINE_SVG) { |
| return; |
| } |
| var element = bot.locators.findElement({id: 'rect'}); |
| var otherElement = bot.locators.findElement({id: 'text'}); |
| bot.action.focusOnElement(otherElement); |
| bot.action.focusOnElement(element); |
| } |
| |
| function testGettingTextOfSvgElementDoesNotThrow() { |
| if (!bot.test.SUPPORTS_INLINE_SVG) { |
| return; |
| } |
| var element = bot.locators.findElement({id: 'text'}); |
| bot.dom.getVisibleText(element); |
| } |
| |
| function testSvgLineWithZeroSizeBBoxIsShown() { |
| if (!bot.test.SUPPORTS_INLINE_SVG) { |
| return; |
| } |
| var element = bot.locators.findElement({id: 'path'}); |
| assertTrue(bot.dom.isShown(element)); |
| } |
| </script> |
| </head> |
| <body> |
| <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1000 50"> |
| <rect id="rect" fill="red" stroke="none" height="12" width="12" y="20" x="100"></rect> |
| <text id="text" fill="black" font-size="12" font-family="Arial" y="30" x="115">Apple</text> |
| <path id="path" d="M 200 26 L 600 26" stroke="red" stroke-width="1em"/> |
| </svg> |
| </body> |
| </html> |