Bug 1460059 - [wdspec] Remove superfluous set_window_rect/resizing_and_positioning.py. r=ato

MozReview-Commit-ID: 4cEvbPM3Wlm

--HG--
extra : rebase_source : 9bf8703cc0ac471d8ad129dc363e0092fe31a46b
This commit is contained in:
Henrik Skupin 2018-05-11 15:23:59 +02:00
Родитель c139a8886a
Коммит fb1537aa7f
3 изменённых файлов: 28 добавлений и 72 удалений

Просмотреть файл

@ -397734,12 +397734,6 @@
{}
]
],
"webdriver/tests/set_window_rect/resizing_and_positioning.py": [
[
"/webdriver/tests/set_window_rect/resizing_and_positioning.py",
{}
]
],
"webdriver/tests/set_window_rect/set.py": [
[
"/webdriver/tests/set_window_rect/set.py",
@ -612205,12 +612199,8 @@
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
"support"
],
"webdriver/tests/set_window_rect/resizing_and_positioning.py": [
"479379109115668183643e8a050396219332887d",
"wdspec"
],
"webdriver/tests/set_window_rect/set.py": [
"f6202880dbdd4a407fa2944a68765757dbcb932b",
"79de443bc251f7effaa7c2ef3b95695f22db01c6",
"wdspec"
],
"webdriver/tests/set_window_rect/user_prompts.py": [

Просмотреть файл

@ -1,61 +0,0 @@
import json
import pytest
import webdriver
def window_size_supported(session):
try:
session.window.size = ("a", "b")
except webdriver.UnsupportedOperationException:
return False
except webdriver.InvalidArgumentException:
return True
def window_position_supported(session):
try:
session.window.position = ("a", "b")
except webdriver.UnsupportedOperationException:
return False
except webdriver.InvalidArgumentException:
return True
def test_window_resize(session):
if not window_size_supported(session):
pytest.skip()
# setting the window size by webdriver is synchronous
# so we should see the results immediately
session.window.size = (400, 500)
assert session.window.size == (400, 500)
session.window.size = (500, 600)
assert session.window.size == (500, 600)
"""
TODO(ato):
Disable test because the while statements are wrong.
To fix this properly we need to write an explicit wait utility.
def test_window_resize_by_script(session):
# setting the window size by JS is asynchronous
# so we poll waiting for the results
size0 = session.window.size
session.execute_script("window.resizeTo(700, 800)")
size1 = session.window.size
while size0 == size1:
size1 = session.window.size
assert size1 == (700, 800)
session.execute_script("window.resizeTo(800, 900)")
size2 = session.window.size
while size1 == size2:
size2 = session.window.size
assert size2 == (800, 900)
assert size2 == {"width": 200, "height": 100}
"""

Просмотреть файл

@ -385,6 +385,33 @@ def test_resize_to_same_height(session):
assert size == (456, original_height)
"""
TODO(ato):
Disable test because the while statements are wrong.
To fix this properly we need to write an explicit wait utility.
def test_resize_by_script(session):
# setting the window size by JS is asynchronous
# so we poll waiting for the results
size0 = session.window.size
session.execute_script("window.resizeTo(700, 800)")
size1 = session.window.size
while size0 == size1:
size1 = session.window.size
assert size1 == (700, 800)
session.execute_script("window.resizeTo(800, 900)")
size2 = session.window.size
while size1 == size2:
size2 = session.window.size
assert size2 == (800, 900)
assert size2 == {"width": 200, "height": 100}
"""
def test_payload(session):
# step 14
response = set_window_rect(session, {"x": 400, "y": 400})