~aleteoryx/muditaos

ref: ad136fbb8430bc47bc1f6473e06c3816f5315d88 muditaos/test/pytest/test_call.py -rw-r--r-- 880 bytes
ad136fbb — Adam Dobrowolski [EGD-6078] Limited logs from Settings and Service messages 4 years ago
                                                                                
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
# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
import time
import pytest

from harness.interface.defs import key_codes


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


@pytest.mark.rt1051
@pytest.mark.usefixtures("phone_unlocked")
def test_call(harness, phone_number, call_duration):
    count_before = get_calllog_count(harness)
    # enter number
    harness.send_number(str(phone_number))
    # call
    harness.connection.send_key_code(key_codes["fnLeft"])
    time.sleep(call_duration)
    # hang up
    harness.connection.send_key_code(key_codes["fnRight"])
    count_after = get_calllog_count(harness)

    assert count_before + 1 == count_after
    time.sleep(2)  # needed to restore after call