Skip to content

Commit 81a1a09

Browse files
authored
Merge branch 'master' into UpdateTIApplications_OTA_Documentation
2 parents 700475f + 857accf commit 81a1a09

9 files changed

+109
-82
lines changed

src/python_testing/TC_OpstateCommon.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def send_raw_manual_or_pipe_command(self, command):
122122
self.write_to_app_pipe(command)
123123
time.sleep(0.1)
124124
else:
125-
input("Press Enter when done.\n")
125+
self.wait_for_user_input(prompt_msg="Press Enter when ready.\n")
126126

127127
def send_manual_or_pipe_command(self, device: str, name: str, operation: str, param: Any = None):
128128
command = {
@@ -1113,7 +1113,7 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1):
11131113
# In CI environment, the STOP coommand (step 8) already resets the variables. Only ask for
11141114
# reboot outside CI environment.
11151115
if not self.is_ci:
1116-
input("Press Enter when done.\n")
1116+
self.wait_for_user_input(prompt_msg="Restart DUT. Press Enter when ready.\n")
11171117

11181118
# STEP 12: TH waits for {PIXIT.WAITTIME.REBOOT}
11191119
self.step(12)

src/python_testing/TC_RVCCLEANM_2_1.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ class CommonCodes(Enum):
138138
print("Changing mode to Cleaning")
139139
await self.send_run_change_to_mode_cmd(1)
140140
else:
141-
input("Press Enter when done.\n")
141+
self.wait_for_user_input(
142+
prompt_msg="Manually put the device in a state from which it will FAIL to transition to mode %d, and press Enter when done" % (self.mode_fail))
142143

143144
self.print_step(6, "Read CurrentMode attribute")
144145
old_current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode)
@@ -169,7 +170,8 @@ class CommonCodes(Enum):
169170
print("Changing mode to Idle")
170171
await self.send_run_change_to_mode_cmd(0)
171172
else:
172-
input("Press Enter when done.\n")
173+
self.wait_for_user_input(
174+
prompt_msg="Manually put the device in a state from which it will SUCCESSFULLY transition to mode %d, and press Enter when done" % (self.mode_ok))
173175

174176
self.print_step(10, "Read CurrentMode attribute")
175177
old_current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode)

src/python_testing/TC_RVCCLEANM_2_2.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def send_run_change_to_mode_cmd(self, newMode) -> Clusters.Objects.RvcRunM
6363
# Prints the instruction and waits for a user input to continue
6464
def print_instruction(self, step_number, instruction):
6565
self.print_step(step_number, instruction)
66-
input("Press Enter when done.\n")
66+
self.wait_for_user_input(prompt_msg=f"{instruction}, and press Enter when ready.")
6767

6868
def pics_TC_RVCCLEANM_2_2(self) -> list[str]:
6969
return ["RVCCLEANM.S"]
@@ -101,7 +101,8 @@ async def test_TC_RVCCLEANM_2_2(self):
101101
if self.is_ci:
102102
await self.send_run_change_to_mode_cmd(1)
103103
else:
104-
input("Press Enter when done.\n")
104+
self.wait_for_user_input(
105+
prompt_msg="Manually put the device in a state in which the RVC Run Mode cluster’s CurrentMode attribute is set to a mode without the Idle mode tag, and press Enter when done.")
105106

106107
self.print_step(3, "Read the RvcRunMode SupportedModes attribute")
107108
supported_run_modes = await self.read_run_supported_modes()

src/python_testing/TC_RVCOPSTATE_2_1.py

+57-38
Original file line numberDiff line numberDiff line change
@@ -158,53 +158,60 @@ async def test_TC_RVCOPSTATE_2_1(self):
158158
asserts.assert_true(operational_state in defined_states or in_range, "OperationalState has an invalid ID value!")
159159

160160
if self.check_pics("RVCOPSTATE.S.M.ST_STOPPED"):
161-
self.print_step("6a", "Manually put the device in the stopped state")
161+
test_step = "Manually put the device in the stopped state"
162+
self.print_step("6a", test_step)
162163
if not self.is_ci:
163-
input("Press Enter when done.\n")
164+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
164165
await self.read_and_validate_opstate(step="6b", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kStopped)
165166
if self.check_pics("RVCOPSTATE.S.M.ST_RUNNING"):
166-
self.print_step("6c", "Manually put the device in the running state")
167+
test_step = "Manually put the device in the running state"
168+
self.print_step("6c", test_step)
167169
if self.is_ci:
168170
await self.send_run_change_to_mode_cmd(1)
169171
else:
170-
input("Press Enter when done.\n")
172+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
171173
await self.read_and_validate_opstate(step="6d", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kRunning)
172174
if self.check_pics("RVCOPSTATE.S.M.ST_PAUSED"):
173-
self.print_step("6e", "Manually put the device in the paused state")
175+
test_step = "Manually put the device in the paused state"
176+
self.print_step("6e", test_step)
174177
if self.is_ci:
175178
await self.send_pause_cmd()
176179
else:
177-
input("Press Enter when done.\n")
180+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
178181
await self.read_and_validate_opstate(step="6f", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kPaused)
179182
if self.check_pics("RVCOPSTATE.S.M.ST_ERROR"):
180-
self.print_step("6g", "Manually put the device in the error state")
183+
test_step = "Manually put the device in the error state"
184+
self.print_step("6g", test_step)
181185
if self.is_ci:
182186
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "UnableToStartOrResume"}')
183187
else:
184-
input("Press Enter when done.\n")
188+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
185189
await self.read_and_validate_opstate(step="6h", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kError)
186190
if self.check_pics("RVCOPSTATE.S.M.ST_SEEKING_CHARGER"):
187-
self.print_step("6i", "Manually put the device in the seeking charger state")
191+
test_step = "Manually put the device in the seeking charger state"
192+
self.print_step("6i", test_step)
188193
if self.is_ci:
189194
self.write_to_app_pipe('{"Name": "Reset"}')
190195
await self.send_run_change_to_mode_cmd(1)
191196
await self.send_run_change_to_mode_cmd(0)
192197
else:
193-
input("Press Enter when done.\n")
198+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
194199
await self.read_and_validate_opstate(step="6j", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kSeekingCharger)
195200
if self.check_pics("RVCOPSTATE.S.M.ST_CHARGING"):
196-
self.print_step("6k", "Manually put the device in the charging state")
201+
test_step = "Manually put the device in the charging state"
202+
self.print_step("6k", test_step)
197203
if self.is_ci:
198204
self.write_to_app_pipe('{"Name": "ChargerFound"}')
199205
else:
200-
input("Press Enter when done.\n")
206+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
201207
await self.read_and_validate_opstate(step="6l", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kCharging)
202208
if self.check_pics("RVCOPSTATE.S.M.ST_DOCKED"):
203-
self.print_step("6m", "Manually put the device in the docked state")
209+
test_step = "Manually put the device in the docked state"
210+
self.print_step("6m", test_step)
204211
if self.is_ci:
205212
self.write_to_app_pipe('{"Name": "Charged"}')
206213
else:
207-
input("Press Enter when done.\n")
214+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
208215
await self.read_and_validate_opstate(step="6n", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kDocked)
209216

210217
if self.check_pics("RVCOPSTATE.S.A0005"):
@@ -226,86 +233,98 @@ async def test_TC_RVCOPSTATE_2_1(self):
226233
asserts.assert_true(operational_error.errorStateLabel is not None, "ErrorStateLabel should be populated")
227234

228235
if self.check_pics("RVCOPSTATE.S.M.ERR_NO_ERROR"):
229-
self.print_step("7a", "Manually put the device in the no error state")
236+
test_step = "Manually put the device in the no error state"
237+
self.print_step("7a", test_step)
230238
if not self.is_ci:
231-
input("Press Enter when done.\n")
239+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
232240
await self.read_and_validate_operror(step="7b", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kNoError)
233241
if self.check_pics("RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME"):
234-
self.print_step("7c", "Manually put the device in the unable to start or resume error state")
242+
test_step = "Manually put the device in the unable to start or resume error state"
243+
self.print_step("7c", test_step)
235244
if self.is_ci:
236245
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "UnableToStartOrResume"}')
237246
else:
238-
input("Press Enter when done.\n")
247+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
239248
await self.read_and_validate_operror(step="7d", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kUnableToStartOrResume)
240249
if self.check_pics("RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION"):
241-
self.print_step("7e", "Manually put the device in the unable to complete operation error state")
250+
test_step = "Manually put the device in the unable to complete operation error state"
251+
self.print_step("7e", test_step)
242252
if self.is_ci:
243253
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "UnableToCompleteOperation"}')
244254
else:
245-
input("Press Enter when done.\n")
255+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
246256
await self.read_and_validate_operror(step="7f", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kUnableToCompleteOperation)
247257
if self.check_pics("RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE"):
248-
self.print_step("7g", "Manually put the device in the command invalid error state")
258+
test_step = "Manually put the device in the command invalid error state"
259+
self.print_step("7g", test_step)
249260
if self.is_ci:
250261
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "CommandInvalidInState"}')
251262
else:
252-
input("Press Enter when done.\n")
263+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
253264
await self.read_and_validate_operror(step="7h", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kCommandInvalidInState)
254265
if self.check_pics("RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK"):
255-
self.print_step("7i", "Manually put the device in the failed to find dock error state")
266+
test_step = "Manually put the device in the failed to find dock error state"
267+
self.print_step("7i", test_step)
256268
if self.is_ci:
257269
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "FailedToFindChargingDock"}')
258270
else:
259-
input("Press Enter when done.\n")
271+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
260272
await self.read_and_validate_operror(step="7j", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kFailedToFindChargingDock)
261273
if self.check_pics("RVCOPSTATE.S.M.ERR_STUCK"):
262-
self.print_step("7k", "Manually put the device in the stuck error state")
274+
test_step = "Manually put the device in the stuck error state"
275+
self.print_step("7k", test_step)
263276
if self.is_ci:
264277
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "Stuck"}')
265278
else:
266-
input("Press Enter when done.\n")
279+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
267280
await self.read_and_validate_operror(step="7l", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kStuck)
268281
if self.check_pics("RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING"):
269-
self.print_step("7m", "Manually put the device in the dust bin missing error state")
282+
test_step = "Manually put the device in the dust bin missing error state"
283+
self.print_step("7m", test_step)
270284
if self.is_ci:
271285
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "DustBinMissing"}')
272286
else:
273-
input("Press Enter when done.\n")
287+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
274288
await self.read_and_validate_operror(step="7n", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kDustBinMissing)
275289
if self.check_pics("RVCOPSTATE.S.M.ERR_DUST_BIN_FULL"):
276-
self.print_step("7o", "Manually put the device in the dust bin full error state")
290+
test_step = "Manually put the device in the dust bin full error state"
291+
self.print_step("7o", test_step)
277292
if self.is_ci:
278293
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "DustBinFull"}')
279294
else:
280-
input("Press Enter when done.\n")
295+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
281296
await self.read_and_validate_operror(step="7p", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kDustBinFull)
282297
if self.check_pics("RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY"):
283-
self.print_step("7q", "Manually put the device in the water tank empty error state")
298+
test_step = "Manually put the device in the water tank empty error state"
299+
self.print_step("7q", test_step)
284300
if self.is_ci:
285301
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "WaterTankEmpty"}')
286302
else:
287-
input("Press Enter when done.\n")
303+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
288304
await self.read_and_validate_operror(step="7r", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kWaterTankEmpty)
289305
if self.check_pics("RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING"):
290-
self.print_step("7s", "Manually put the device in the water tank missing error state")
306+
test_step = "Manually put the device in the water tank missing error state"
307+
self.print_step("7s", test_step)
291308
if self.is_ci:
292309
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "WaterTankMissing"}')
293310
else:
294-
input("Press Enter when done.\n")
311+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
295312
await self.read_and_validate_operror(step="7t", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kWaterTankMissing)
296313
if self.check_pics("RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN"):
297-
self.print_step("7u", "Manually put the device in the water tank lid open error state")
314+
test_step = "Manually put the device in the water tank lid open error state"
315+
self.print_step("7u", test_step)
298316
if self.is_ci:
299317
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "WaterTankLidOpen"}')
300318
else:
301-
input("Press Enter when done.\n")
319+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
302320
await self.read_and_validate_operror(step="7v", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kWaterTankLidOpen)
303321
if self.check_pics("RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING"):
304-
self.print_step("7w", "Manually put the device in the mop cleaning pad missing error state")
322+
test_step = "Manually put the device in the mop cleaning pad missing error state"
323+
self.print_step("7w", test_step)
305324
if self.is_ci:
306325
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "MopCleaningPadMissing"}')
307326
else:
308-
input("Press Enter when done.\n")
327+
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
309328
await self.read_and_validate_operror(step="7x", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kMopCleaningPadMissing)
310329

311330

0 commit comments

Comments
 (0)