Skip to content

Commit ba64adf

Browse files
authored
test: Add unit test for set_value (setImmediateValue) (appium#518)
1 parent 9bdf1f7 commit ba64adf

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ __pycache__
2323
venv*
2424
.tox
2525

26-
Pipfile.lock
26+
Pipfile.lock
27+
28+
.coverage

test/unit/webdriver/webelement_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@
2828

2929
class TestWebElement(object):
3030

31+
@httpretty.activate
32+
def test_set_value(self):
33+
driver = android_w3c_driver()
34+
httpretty.register_uri(
35+
httpretty.POST,
36+
appium_command('/session/1234567890/appium/element/element_id/value')
37+
)
38+
39+
element = MobileWebElement(driver, 'element_id', w3c=True)
40+
value = 'happy testing'
41+
element.set_value(value)
42+
43+
d = get_httpretty_request_body(httpretty.last_request())
44+
assert d['value'] == [value]
45+
3146
@httpretty.activate
3247
def test_send_key(self):
3348
driver = android_w3c_driver()

0 commit comments

Comments
 (0)