I think there are a few things that need to happen in patient connection sub-mode (e.g. get UF volume, get initial blood pressure reading, ...) before user should be allowed to start treatment. Need to check which state in patient connection sub-mode we're in too - should the last state where we've done everything and waiting for user to start.
We are in agreement that each test should be self contained. To ensure each test is self-contained, each test needs to have a separate instance of HDSimulator. The design of dialin is not the focus of this review...
What is utils.dict_update? Please use the SquishQt recommended syntax and functions as has been explained and described in their examples. I don't see any reason why we need to have a new function. Also, I would rather let SquishQt test and check the existence of the properties (in this case ".text") instead of another function adding a property to the dictionary without making sure that the object actually has the property and not checking the object tree.
** Please remove all the usage in all other places ** **
Still don't feel comfortable with this solution and haven't been convinced that it should be the way to get around the SquishQt issue of finding the object within the given timeout. On the other hand, don't have a better idea to stop the test from failing randomly. So would be better to keep it for now.
Consider having a switch statement here for each reject reason code. Maybe we're only handling the invalid parameter reason for now, but we may change our minds later. You can group the rest of the reasons+default with just a comment that our state machines will detect and handle failure of DG to advance for now. This will make it clear that we didn't forget about the other cases.
Before, the HD sends target temperature using another message. So now we add the target temperature to this command, so DG can handle the full command.