|
9 | 9 |
|
10 | 10 | import httpretty |
11 | 11 |
|
12 | | -from test.unit.helper.test_helper import android_w3c_driver, appium_command, get_httpretty_request_body |
| 12 | +from test.unit.helper.test_helper import android_w3c_driver, appium_command, get_httpretty_request_body, ios_w3c_driver |
13 | 13 |
|
14 | 14 |
|
15 | | -class TestWebDriverScreenRecord(object): |
| 15 | +class TestWebDriverScreenRecordAndroid(object): |
16 | 16 | @httpretty.activate |
17 | 17 | def test_start_recording_screen(self): |
18 | 18 | driver = android_w3c_driver() |
@@ -41,3 +41,34 @@ def test_stop_recording_screen(self): |
41 | 41 | assert d['options']['user'] == 'userA' |
42 | 42 | assert d['options']['pass'] == '12345' |
43 | 43 | assert 'password' not in d['options'].keys() |
| 44 | + |
| 45 | + |
| 46 | +class TestWebDriverScreenRecordIOS(object): |
| 47 | + @httpretty.activate |
| 48 | + def test_start_recording_screen(self): |
| 49 | + driver = ios_w3c_driver() |
| 50 | + httpretty.register_uri( |
| 51 | + httpretty.POST, |
| 52 | + appium_command('/session/1234567890/appium/start_recording_screen'), |
| 53 | + ) |
| 54 | + assert driver.start_recording_screen(user='userA', password='12345') is None |
| 55 | + |
| 56 | + d = get_httpretty_request_body(httpretty.last_request()) |
| 57 | + assert d['options']['user'] == 'userA' |
| 58 | + assert d['options']['pass'] == '12345' |
| 59 | + assert 'password' not in d['options'].keys() |
| 60 | + |
| 61 | + @httpretty.activate |
| 62 | + def test_stop_recording_screen(self): |
| 63 | + driver = android_w3c_driver() |
| 64 | + httpretty.register_uri( |
| 65 | + httpretty.POST, |
| 66 | + appium_command('/session/1234567890/appium/stop_recording_screen'), |
| 67 | + body='{"value": "b64_video_data"}', |
| 68 | + ) |
| 69 | + assert driver.stop_recording_screen(user='userA', password='12345') == 'b64_video_data' |
| 70 | + |
| 71 | + d = get_httpretty_request_body(httpretty.last_request()) |
| 72 | + assert d['options']['user'] == 'userA' |
| 73 | + assert d['options']['pass'] == '12345' |
| 74 | + assert 'password' not in d['options'].keys() |
0 commit comments