~aleteoryx/muditaos

ref: a2cef32dc4d0dd498b76a5ff244b4e3a52eeda06 muditaos/test/pytest/module_apps/call_utils.py -rw-r--r-- 673 bytes
a2cef32d — Lukasz Mastalerz [BH-1532] Changing alarm's trigger time when alarm is snoozed causes several problems 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

import time
from harness import log
from harness.interface.defs import key_codes

def get_calllog_count(harness):
    body = {"count": True}
    return harness.endpoint_request("calllog", "get", body)["body"]["count"]

def select_call_button(harness, call_duration):
    # call
    log.info("Call duration = {}s, calling...".format(call_duration))
    harness.connection.send_key_code(key_codes["fnLeft"])
    time.sleep(call_duration)
    # hang up
    log.info("Hanging up...")
    harness.connection.send_key_code(key_codes["fnRight"])