Skip to content

Commit

Permalink
Minimal TC_SWTCH fixes for 1.4-TE2 (#34986)
Browse files Browse the repository at this point in the history
- Fixes only issues raised on script that block success
  - project-chip/matter-test-scripts#337
  - project-chip/matter-test-scripts#338

- Fixes done:
  - Prompt text improvement/fixes
  - Fixed crash in 2.5/2.6
  • Loading branch information
tcarmelveilleux authored Aug 16, 2024
1 parent bbc773a commit 15032f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/python_testing/TC_SWTCH.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _ask_for_switch_position(self, endpoint_id: int, new_position: int):
def _ask_for_multi_press_short_long(self, endpoint_id: int, pressed_position: int, feature_map: uint, multi_press_max: uint):
if not self._use_button_simulator():
msg = f"""
Actuate the switch in the following sequence:
Actuate the switch in the following sequence (read full sequence first):
1. Operate switch (press briefly) associated with position {pressed_position} on the DUT then release switch from DUT
2. Operate switch (keep pressed for long time, e.g. 5 seconds) on the DUT immediately after the previous step
3. Release switch from the DUT
Expand All @@ -128,7 +128,7 @@ def _ask_for_multi_press_short_long(self, endpoint_id: int, pressed_position: in
def _ask_for_multi_press_long_short(self, endpoint_id, pressed_position, feature_map: int):
if not self._use_button_simulator():
msg = f"""
Actuate the switch in the following sequence:
Actuate the switch in the following sequence (read full sequence first):
1. Operate switch (keep pressed for long time, e.g. 5 seconds) on the DUT
2. Releases switch from the DUT
3. Immediately after the previous step completes, operate switch (press briefly) associated with position {pressed_position} on the DUT then release switch from DUT
Expand All @@ -142,7 +142,7 @@ def _ask_for_multi_press_long_short(self, endpoint_id, pressed_position, feature
def _ask_for_multi_press(self, endpoint_id: int, number_of_presses: int, pressed_position: int, feature_map: uint, multi_press_max: uint):
if not self._use_button_simulator():
self.wait_for_user_input(
f'Operate the switch (press briefly) associated with position {pressed_position} then release {number_of_presses} times')
f'Execute {number_of_presses} separate brief press/release cycles on position {pressed_position}.')
else:
self._send_multi_press_named_pipe_command(endpoint_id, number_of_presses,
pressed_position, feature_map, multi_press_max)
Expand All @@ -157,7 +157,7 @@ def _ask_for_long_press(self, endpoint_id: int, pressed_position: int, feature_m
def _ask_for_keep_pressed(self, endpoint_id: int, pressed_position: int, feature_map: int):
if not self._use_button_simulator():
self.wait_for_user_input(
prompt_msg=f"Press switch position {pressed_position} for a long time (around 5 seconds) on the DUT, then release it.")
prompt_msg=f"Press switch position {pressed_position} for a long time (around 5 seconds) on the DUT, keep it pressed, do NOT release it.")
else:
self._send_long_press_named_pipe_command(endpoint_id, pressed_position, feature_map)

Expand Down Expand Up @@ -676,7 +676,7 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool =
asserts.assert_equal(event.newPosition, pressed_position, "Unexpected NewPosition on LongPress")
event = event_listener.wait_for_event_report(cluster.Events.LongRelease)
asserts.assert_equal(event.previousPosition, pressed_position, "Unexpected PreviousPosition on LongRelease")
if self._use_button_simulator:
if self._use_button_simulator():
# simulator can't sequence so we need to help it along here
self._send_multi_press_named_pipe_command(endpoint_id, number_of_presses=1,
pressed_position=1, feature_map=feature_map, multi_press_max=multi_press_max)
Expand Down Expand Up @@ -839,7 +839,7 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool =
asserts.assert_equal(event.newPosition, pressed_position, "Unexpected NewPosition on LongPress")
event = event_listener.wait_for_event_report(cluster.Events.LongRelease)
asserts.assert_equal(event.previousPosition, pressed_position, "Unexpected PreviousPosition on LongRelease")
if self._use_button_simulator:
if self._use_button_simulator():
# simulator can't sequence so we need to help it along here
self._send_multi_press_named_pipe_command(endpoint_id, number_of_presses=1,
pressed_position=1, feature_map=feature_map, multi_press_max=multi_press_max)
Expand Down

0 comments on commit 15032f1

Please sign in to comment.