forked from appium/python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen_record_test.py
More file actions
48 lines (40 loc) · 1.68 KB
/
screen_record_test.py
File metadata and controls
48 lines (40 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import httpretty
from test.unit.helper.test_helper import (
android_w3c_driver,
appium_command,
get_httpretty_request_body
)
class TestWebDriverScreenRecord(object):
@httpretty.activate
def test_start_recording_screen(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/start_recording_screen'),
)
assert driver.start_recording_screen(user='userA', password='12345') is None
d = get_httpretty_request_body(httpretty.last_request())
assert d['options']['user'] == 'userA'
assert d['options']['pass'] == '12345'
assert 'password' not in d['options'].keys()
@httpretty.activate
def test_stop_recording_screen(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/stop_recording_screen'),
body='{"value": "b64_video_data"}'
)
assert driver.stop_recording_screen(user='userA', password='12345') == 'b64_video_data'
d = get_httpretty_request_body(httpretty.last_request())
assert d['options']['user'] == 'userA'
assert d['options']['pass'] == '12345'
assert 'password' not in d['options'].keys()