Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -r756aa59d442466b78609a9d4a9ae5fd9c1fbf2ef -rbddd2fe08aac52e286b53a811f0ab41919c7fea2 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 756aa59d442466b78609a9d4a9ae5fd9c1fbf2ef) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision bddd2fe08aac52e286b53a811f0ab41919c7fea2) @@ -4,6 +4,7 @@ import names from squish import * from leahi_dialin.ui import utils +from builtins import int as pyInt def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ @@ -58,6 +59,16 @@ found = findObjectById(child, id) if found: return found + return None + +def findChildByText(parent_object, target_text): + """Recursively finds a child object by its text property.""" + for child in object.children(parent_object): + if hasattr(child, "text") and str(child.text) == target_text: + return child + found = findChildByText(child, target_text) + if found: + return found return None @@ -82,13 +93,14 @@ except LookupError: current_value = float(findObject(obj).property("value")) + # Determine direction while current_value != float(target_value): if current_value < float(target_value): squish.mouseClick(squish.waitForObject(right_arrow)) elif current_value > float(target_value): squish.mouseClick(squish.waitForObject(left_arrow)) - + # Update current value after click try: current_value = round(float(findObject(obj).value),1) except Exception: @@ -158,4 +170,4 @@ while findObject(object_name).value != 0.0: squish.mouseClick(waitForObject(left_arrow)) utils.waitForGUI(0.2) # Small delay to allow UI to update - \ No newline at end of file + Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r885d84508080eb00e01a756e33c5109c9da761fe -rbddd2fe08aac52e286b53a811f0ab41919c7fea2 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 885d84508080eb00e01a756e33c5109c9da761fe) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision bddd2fe08aac52e286b53a811f0ab41919c7fea2) @@ -2,22 +2,104 @@ from objectmaphelper import * -AUT_NAME ="leahi" - # Top Parents -o_Gui_MainView = { "type": "Gui::MainView", "unnamed": 1 } -o_QQuickView = { "type": "QQuickView" } -o_Overlay = {"container": o_QQuickView, "type": "Overlay" } -o_standByScreen_MainHome = {"container": o_Gui_MainView, "type": "MainHome" } -standByScreen_MainHome = {"container": o_Gui_MainView, "type": "MainHome" } -treatmentStack = {"container": o_Gui_MainView, "type": "TreatmentStack" } -startTreatmentButton = {"container": standByScreen_MainHome, "id": "_startTreatmentRect", "type": "TouchRect", "unnamed": 1 } -mainTreatmentScreen = {"container": treatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1 } -startFluidButton = {"container": mainTreatmentScreen, "id": "_startFluidButton", "type": "TouchRect", "unnamed": 1 } -salineDeliveredText = {"container": mainTreatmentScreen, "objectName": "salineDescriptionText", "type": "Text" } -currentBolusVolume = {"container": mainTreatmentScreen, "type": "Label", "unnamed": 1 } -treatmentSaline = {"container": mainTreatmentScreen, "objectName": "treatmentSaline", "type": "TreatmentSaline" } -salineProgressBar = {"container": mainTreatmentScreen, "id": "_fluidProgressBar", "type": "ProgressBar", "unnamed": 1 } +o_Gui_MainView = { "type": "Gui::MainView", "unnamed": 1 } +o_QQuickView = { "type": "QQuickView" } +o_Overlay = {"container": o_QQuickView, "type": "Overlay" } + +# Solution Infusion +o_standByScreen_MainHome = {"container": o_Gui_MainView, "type": "MainHome" } +treatmentStack = {"container": o_Gui_MainView, "type": "TreatmentStack" } +mainTreatmentScreen = {"container": treatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1 } +startFluidButton = {"container": mainTreatmentScreen, "id": "_startFluidButton", "type": "TouchRect", "unnamed": 1 } +salineDeliveredText = {"container": mainTreatmentScreen, "objectName": "salineDescriptionText", "type": "Text" } +currentBolusVolume = {"container": mainTreatmentScreen, "type": "Label", "unnamed": 1 } +treatmentSaline = {"container": mainTreatmentScreen, "objectName": "treatmentSaline", "type": "TreatmentSaline" } +salineProgressBar = {"container": mainTreatmentScreen, "id": "_fluidProgressBar", "type": "ProgressBar", "unnamed": 1 } + +# Main Treatment +o_arterial_RangeBar = {"container": mainTreatmentScreen, "id": "_arterialRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_venous_RangeBar = {"container": mainTreatmentScreen, "id": "_venousRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_tmp_RangeBar = {"container": mainTreatmentScreen, "id": "_tmpRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_treatmentUltrafiltration = {"container": mainTreatmentScreen, "objectName": "treatmentUltrafiltration", "type": "TreatmentUltrafiltration" } +o_UF_Volume_Text = {"container": mainTreatmentScreen, "id": "_ufVolume", "type": "LabelValue", "unnamed": 1 } +o_UF_Rate_Text = {"container": mainTreatmentScreen, "id": "_ufRate", "type": "LabelValue", "unnamed": 1 } +o_treatment_duration = {"container": mainTreatmentScreen, "objectName": "treatmentTime", "type": "TreatmentTime" } +o_UF_Volume_LabelValue = {"container": mainTreatmentScreen, "id": "_ufVolume", "type": "LabelValue", "unnamed": 1 } +o_UF_Rate_LabelValue = {"container": mainTreatmentScreen, "id": "_ufRate", "type": "LabelValue", "unnamed": 1 } +o_Volume_Delivered = {"container": mainTreatmentScreen, "id": "_valueText", "type": "Text", "unnamed": 1 } +o_blood_flow_value = {"container": mainTreatmentScreen, "id": "_bloodFlow", "objectName": "bloodFlowComponent", "type": "TreatmentFlowsComponent" } +o_dial_flow_value = {"container": mainTreatmentScreen, "objectName": "dialysateFlowComponent", "type": "TreatmentFlowsComponent" } +o_dial_tmp_value = {"container": mainTreatmentScreen, "id": "_dialysateTemp", "objectName": "dialysateTempComponent", "type": "TreatmentFlowsComponent" } +o_dial_cond_value = {"container": mainTreatmentScreen, "id": "_dialysateCond", "objectName": "dialysateCondComponent", "type": "TreatmentFlowsComponent" } +o_blood_flow_title_Text = {"container": mainTreatmentScreen, "id": "_bloodFlow", "objectName": "bloodFlowComponent", "type": "TreatmentFlowsComponent" } +o_dialyste_flow_title_Text = {"container": mainTreatmentScreen, "objectName": "dialysateFlowComponent", "type": "TreatmentFlowsComponent" } +o_dialyste_tmp_title_Text = {"container": mainTreatmentScreen, "id": "_dialysateTemp", "objectName": "dialysateTempComponent", "type": "TreatmentFlowsComponent" } +o_dialyste_cond_title_Text = {"container": mainTreatmentScreen, "id": "_dialysateCond", "objectName": "dialysateCondComponent", "type": "TreatmentFlowsComponent" } +o_treatmentTimeNotificationBarSmall = {"container": mainTreatmentScreen, "objectName": "notification", "type": "NotificationBarSmall" } + +# settings_service_export_logs +o_listView_ListView = {"container": o_Gui_MainView, "id": "_listView", "type": "ListView", "unnamed": 1 } +o_listView_delegateControl = {"container": o_listView_ListView, "index": 2, "objectName": "delegateControl", "type": "Item" } +o_Settings_Menu = {"container": o_listView_delegateControl, "objectName": "_touchRect2", "type": "TouchRect" } +o_SettingsHome = {"container": o_Gui_MainView, "objectName": "_SettingsHome", "type": "SettingsHome" } +o_SettingsExportLogs = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsExportLogs" } +o_DeviceSettingsTitleText = {"container": o_SettingsHome, "id":"_titleText", "type": "Text", "unnamed": 1 } +o_SettingsInformation = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsBase" } +o_USBEjectButton = {"container": o_SettingsExportLogs, "id": "_usbEjectButton", "type": "USBButton", "unnamed": 1 } +o_ExportLogsPageTitleText = {"container": o_SettingsInformation, "id":"_titleText", "type": "Text", "unnamed": 1 } +o_LogTypeComboBox = {"container": o_SettingsInformation, "id": "_logTypeCombo", "type": "ComboBox", "unnamed": 1 } +o_OptionComboBox = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_ExportButton = {"container": o_SettingsExportLogs, "id": "_logTypeExportButton", "type": "ExportButton", "unnamed": 1 } +o_ExportLogsProgressRect = {"container": o_SettingsExportLogs, "id": "_progressRect", "type": "ProgressRect", "unnamed": 1 } +o_ExportLogsNotificationBar = {"container": o_SettingsExportLogs, "id": "_information", "type": "NotificationBarSmall" } +o_DeviceSettingsGrid = {"container": o_SettingsHome, "id": "_grid", "type": "Grid", } + +#HeaderBar Information Pop up +o_InformationIconButton = {"container": o_Gui_MainView, "id": "_informationButton", "type": "IconButton", "unnamed": 1 } +o_InformationParameters = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_VersionColumn = {"container": o_Overlay, "id": "_versionColumn", "type": "Column", "unnamed": 1 } + +#ultrafiltration +o_treatmentUltrafiltration = {"container": mainTreatmentScreen, "objectName": "treatmentUltrafiltration", "type": "TreatmentUltrafiltration" } +o_editButton_ultrafiltration_IconButton = {"container": o_treatmentUltrafiltration, "id": "_editButton", "type": "IconButton", "unnamed": 1 } +o_uf_Volume_LabelValue = {"container": mainTreatmentScreen, "id": "_ufVolume", "type": "LabelValue", "unnamed": 1 } +o_uf_Rate_LabelValue = {"container": mainTreatmentScreen, "id": "_ufRate", "type": "LabelValue", "unnamed": 1 } +o_volume_Delivered = {"container": mainTreatmentScreen, "id": "_valueText", "type": "Text", "unnamed": 1 } +o_ufVolumeRemovedItem_ValueItem = {"container": o_Overlay, "id": "_ufVolumeRemovedItem", "type": "ValueItem", "unnamed": 1 } +o_ufVolumeGoalItem_ValueItem = {"container": o_Overlay, "id": "_ufVolumeGoalItem", "type": "ValueItem", "unnamed": 1 } +o_editButton_TouchRect = {"container": o_Overlay, "objectName": "_editButton", "type": "TouchRect" } +o_volumeGoalAdjuster_ValueAdjuster = {"container": o_Overlay, "objectName": "_volumeGoalAdjuster", "type": "ValueAdjuster" } +o_continueButton_TouchRect = {"container": o_Overlay, "objectName": "_continueButton", "type": "TouchRect" } +o_newVolumeContainer_ValueContainer = {"container": o_Overlay, "objectName": "_newVolumeContainer", "type": "ValueContainer" } +o_newRateContainer_ValueContainer = {"container": o_Overlay, "objectName": "_newRateContainer", "type": "ValueContainer" } +o_confirmButton_TouchRect = {"container": o_Overlay, "objectName": "_confirmButton", "type": "TouchRect" } +o_backButton_BackButton = {"container": o_Overlay, "id": "_backButton", "type": "BackButton", "unnamed": 1 } +o_notificationBar_NotificationBarSmall = {"container": o_Overlay, "objectName": "NotificationBar", "type": "NotificationBarSmall" } +o_title_Text = {"container": o_Overlay, "type": "Text", "unnamed": 1 } + +# Device Settings Information Version +o_DeviceSettingsInformation = {"container": o_SettingsHome, "id": "_touchItem", "type": "TouchRect", "unnamed": 1 } +o_InformationPageTitleText = {"container": o_SettingsInformation, "id": "_titleText", "type": "Text", "unnamed": 1 } +o_SettingsBase_SettingsInformation = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsBase" } +o_SettingsBase_Information_Text = {"container": o_SettingsBase_SettingsInformation, "type": "Text", "unnamed": 1 } +o_SettingsBase_SettingsInformation_2 = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsInformation" } +o_SettingsBase_grid_Grid = {"container": o_SettingsBase_SettingsInformation_2, "id": "_grid", "type": "Grid", "unnamed": 1 } + +#HeaderBar WiFi +o_HeaderBar_WiFi_IconButton = {"container": o_Gui_MainView, "id": "_wifiButton", "type": "IconButton", "unnamed": 1 } +o_HeaderBar_WiFi_Popup = {"container": o_Overlay, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1 } +o_HeaderBar_Wifi_PopuoParameters = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_HeaderBar_WiFi_IconImage = {"container": o_Gui_MainView, "id": "_iconImage", "source": "qrc:/images/iWifi", "type": "Image", "unnamed": 1 } + +#Device Settings Wi-Fi +o_SettingsBase_SettingsInformation = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsBase" } +o_SettingsBase_Information_Text = {"container": o_SettingsBase_SettingsInformation, "type": "Text", "unnamed": 1 } +o_InformationPageTitleText = {"container": o_SettingsInformation, "id": "_titleText", "type": "Text", "unnamed": 1 } +o_SettingsBase_SettingsWiFi = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsWiFi" } +o_SettingsBase_WifiScreen_ScanButton = {"container": o_SettingsBase_SettingsWiFi, "id": "_scanButton", "type": "TouchRect", "unnamed": 1 } +o_SettingsBase_WifiScreen_BackButton = {"container": o_SettingsBase_SettingsWiFi, "objectName": "_backButton", "type": "BackButton" } + #Create Treatment o_PreTreatmentCreateStack_PreTreatmentCreateStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentCreateStack", "type": "PreTreatmentCreateStack" } o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate" } Index: suite_leahi/suite.conf =================================================================== diff -u -rfc2ce7fc0911c43127dd55ce45f305618ca8ffc9 -rbddd2fe08aac52e286b53a811f0ab41919c7fea2 --- suite_leahi/suite.conf (.../suite.conf) (revision fc2ce7fc0911c43127dd55ce45f305618ca8ffc9) +++ suite_leahi/suite.conf (.../suite.conf) (revision bddd2fe08aac52e286b53a811f0ab41919c7fea2) @@ -1,6 +1,6 @@ AUT=leahi LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_solution_infusion tst_main_treatment tst_create_treatment +TEST_CASES=tst_solution_infusion tst_main_treatment tst_service_export_logs tst_device_settings_information_version tst_headerbar_information_popup tst_headerbar_wifi_indicator tst_device_settings_wifi tst_ultrafiltration tst_create_treatment VERSION=3 WRAPPERS=Qt Index: suite_leahi/tst_create_treatment/test.py =================================================================== diff -u -r5c5fb4a8cc1f9768cc7ff30e01118536e7d55631 -rbddd2fe08aac52e286b53a811f0ab41919c7fea2 --- suite_leahi/tst_create_treatment/test.py (.../test.py) (revision 5c5fb4a8cc1f9768cc7ff30e01118536e7d55631) +++ suite_leahi/tst_create_treatment/test.py (.../test.py) (revision bddd2fe08aac52e286b53a811f0ab41919c7fea2) @@ -17,6 +17,7 @@ from names import * import squish from leahi_dialin.ui import utils +from configuration import config from configuration import utility from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes @@ -262,7 +263,7 @@ #Verify all the parameters are populated test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster).value, 50.0) test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster).value, 50.0) - test.compare(waitForObject(names.o_PreTreatmentCreate_durationControl_ValueAdjuster).value, 480) + test.compare(waitForObject(names.o_PreTreatmentCreate_durationControl_ValueAdjuster).value, 120) test.compare("{:.1f}".format(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster).value), "0.4") test.compare("{:.1f}".format(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster).value), "0.2") test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster).value, 60.0) @@ -479,7 +480,7 @@ def main(): utils.tstStart(__file__) - startApplication(names.AUT_NAME + " -q") + startApplication(config.AUT_NAME + " -q") td.td_operation_mode(TDOpModes.MODE_STAN.value)