Files
MuditaOS/test/pytest/module_apps/call_utils.py
Michał Kamoń 0218e0d7d4 [EGD-6191] Fix harness call tests
* This PR provides a fix for the bug reported in [EGD-6081].
The solution adds the `tear_down`-like fixture called after the
problematic tests, that enforce focus on `ApplicationDesktop'`s
main window.
* Additionally similar solution was added to `test_auto_lock`
to restore original (30s) lock timeout.

[EGD-6081]: https://appnroll.atlassian.net/browse/EGD-6081
2021-03-23 08:46:01 +01:00

20 lines
673 B
Python

# 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"])