~aleteoryx/muditaos

ref: 5a8ae75844e31970e5665257aaff8d9f558ab06a muditaos/test/test.py -rwxr-xr-x 784 bytes
5a8ae758 — RobertPiet [EGD-4448] ssettings variable register fixed (#1045) 5 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
29
30
31
#!/usr/bin/env python
# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

import sys
from harness.harness import Harness
from harness.interface.defs import key_codes


def main():
    if len(sys.argv) == 1 or sys.argv[1] is None:
        print('Please pass port name as the parameter: python test.py /dev/ttyACM0 ')
        exit(1)

    test = Harness(sys.argv[1])

    print(test.connection.get_window())

    @test.with_phone_unlocked
    def decorator_test(connection):
        # enter menu
        connection.send_key(key_codes["enter"])

    print(test.connection.get_window())

    test.open_application("settings")
    print(test.connection.get_window())


if __name__ == "__main__":
    main()