-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathtest_app_mainmenu.py
35 lines (33 loc) · 1.36 KB
/
test_app_mainmenu.py
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
from ragger.firmware import Firmware
from ragger.navigator import NavInsID, NavIns
# In this test we check the behavior of the device main menu
def test_app_mainmenu(firmware, navigator, test_name, default_screenshot_path):
# Navigate in the main menu
if firmware.is_nano:
instructions = [
NavInsID.RIGHT_CLICK,
NavInsID.RIGHT_CLICK,
NavInsID.RIGHT_CLICK
]
elif firmware is Firmware.STAX:
instructions = [
NavInsID.USE_CASE_HOME_SETTINGS,
NavIns(NavInsID.TOUCH, (200, 113)),
NavIns(NavInsID.TOUCH, (200, 261)),
NavInsID.USE_CASE_CHOICE_CONFIRM,
NavIns(NavInsID.TOUCH, (200, 261)),
NavInsID.USE_CASE_SETTINGS_NEXT,
NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT
]
elif firmware is Firmware.FLEX:
instructions = [
NavInsID.USE_CASE_HOME_SETTINGS,
NavIns(NavInsID.TOUCH, (200, 113)),
NavIns(NavInsID.TOUCH, (200, 300)),
NavInsID.USE_CASE_CHOICE_CONFIRM,
NavIns(NavInsID.TOUCH, (200, 300)),
NavInsID.USE_CASE_SETTINGS_NEXT,
NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT
]
navigator.navigate_and_compare(default_screenshot_path, test_name, instructions,
screen_change_before_first_instruction=False)