зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1434904 - Remove dependency to testSize.html in test_elementsize.py r=ato
MozReview-Commit-ID: EOteIE2ArhI --HG-- extra : rebase_source : 757cd41634e2c0a2b90241fdaaa732c7e25af2ff
This commit is contained in:
Родитель
d59d4f1d86
Коммит
e445e1c512
|
@ -4,15 +4,31 @@
|
|||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import urllib
|
||||
|
||||
from marionette_driver.by import By
|
||||
|
||||
from marionette_harness import MarionetteTestCase
|
||||
|
||||
|
||||
TEST_SIZE = """
|
||||
<?xml version="1.0"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Test page for element size</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Let's get the size of <a href='#' id='linkId'>some really cool link</a></p>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
def inline(doc):
|
||||
return "data:text/html;charset=utf-8,{}".format(urllib.quote(doc))
|
||||
|
||||
class TestElementSize(MarionetteTestCase):
|
||||
def testShouldReturnTheSizeOfALink(self):
|
||||
test_html = self.marionette.absolute_url("testSize.html")
|
||||
self.marionette.navigate(test_html)
|
||||
self.marionette.navigate(inline(TEST_SIZE))
|
||||
shrinko = self.marionette.find_element(By.ID, 'linkId')
|
||||
size = shrinko.rect
|
||||
self.assertTrue(size['width'] > 0)
|
||||
|
|
Загрузка…
Ссылка в новой задаче