My tc: I hv tried to modify but im failing. TESTF(ResolvePatientMixUpTest,…
- User
My tc: I hv tried to modify but im failing. TEST_F(ResolvePatientMixUpTest, SelectProfile_SchedulePatient) { //ShowPatexPanel();
//GUI_DIR_ProfileClear(); //GUI_DIR_PhysicianClear(); //GUI_DIR_PatientClear(); //GUI_DIR_ExamClear(); //GuiGlobal::Data().admiActiveTab = TABPAGE_SCHEDULE; ////Add a patient //GUI_DC_PATIENT_STRUCT patient; //patient.patientId = 1; //patient.patient.profileID = 1; //wcscpy(patient.patient.profileName, L"Profile1"); //patient.patient.patientType = PATIENT_ADULT; //wcscpy(patient.patient.name, L"Patient1"); //patient.patient.weightKG = 0; //GUI_DIR_PatientDirectory(GUI_OPER_ADD, &patient, false); ////Add exam //GUI_DC_EXAM_STRUCT exam; //exam.examId = 1; //exam.patientId = 1; //wcscpy(exam.regNr, L"1"); //wcscpy(exam.accNr, L"1"); //wcscpy(exam.physician, L"phy"); //wcscpy(exam.ExamType, L"AdultProcName"); //GUI_DIR_ExamDirectory(GUI_OPER_ADD, &exam, false); //exam.status = EST_CURRENT_REV; ////add profile //GUI_DC_PROFILE_STRUCT profilelst; //GUI_DIR_ProfileClear(); //profilelst.profileData.procedureId = 0; //profilelst.profileData.detProcedureId = 0; //profilelst.profileId = 1; //wcscpy(profilelst.profileData.profileName, L"1"); //profilelst.profileData.iqTasteAdult.tasteId = 1; //profilelst.profileData.iqTastePediatric.tasteId = 1; //profilelst.profileData.iqTasteAdult.tasteIndex = 0; //profilelst.profileData.iqTastePediatric.tasteIndex = 0; //strcpy(profilelst.profileData.iqTasteAdult.tasteName, "taste1"); //strcpy(profilelst.profileData.iqTastePediatric.tasteName, "taste1"); //profilelst.profileData.patientType = PATIENT_ADULT; //OsaTimeGetLocalTime(&profilelst.profileData.dateCreated); //profilelst.profileData.unitofWeight = KG_UNIT; //profilelst.profileData.physician.physicianId = 1; //wcscpy(profilelst.profileData.physician.name, L"physician1"); //GUI_DIR_ProfileDirectory(GUI_OPER_ADD, &profilelst, false); ////Verify if Schedule list has entries //int noOfItemsInScheduleList = TestUtility::GetInstance().GetNoOfItemsInList(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW); //EXPECT_EQ(3, noOfItemsInScheduleList); //ShowAdmiPanel(true, true, 0, true); //TestUtility::GetInstance().WaitForControlShow(ADMI_PANEL_MAINUI, WAIT_FOR_500msec); //Sleep(100); //ShowResolvePatientMixUp(); //EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW)); //TestUtility::GetInstance().ClickButtonSync(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW); //Sleep(100); //TestUtility::GetInstance().SelectItemInList(L"RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW", 0, true); //Sleep(100); // ////Verify if Schedule list has entries //noOfItemsInScheduleList = TestUtility::GetInstance().GetNoOfItemsInList(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW); //EXPECT_EQ(3, noOfItemsInScheduleList); ////Get selected item in Physician list //int selectedIndexInPhysicianList = 0; //TestUtility::GetInstance().GetSelectedItemInComboBox(MVSUI::ADD_CMB_PHYSICIAN, selectedIndexInPhysicianList); //EXPECT_STREQ(exam.physician, TestUtility::GetInstance().GetTextInComboBox(MVSUI::ADD_CMB_PHYSICIAN, selectedIndexInPhysicianList).c_str()); //HideResolvePatientMixUp(); ShowPatexPanel(); GUI_DIR_ProfileClear(); GUI_DIR_PhysicianClear(); GUI_DIR_PatientClear(); GUI_DIR_ExamClear(); GuiGlobal::Data().admiActiveTab = TABPAGE_REVIEW; ShowAdmiPanel(true, true, 0, true, UNIT_OF_HEIGHT_ENUM::CMS_UNIT); TestUtility::GetInstance().ClickButtonSync(ADMI_BTN_SCHEDULE); // Add a physician "Physician1" GUI_DC_PHYSICIAN_STRUCT physician = {}; physician.physicianId = 1; wcscpy_s(physician.name, L"Physician1"); GUI_DIR_PhysicianDirectory(GUI_OPER_ADD, &physician, false); // Add a profile "ProfileName1" GUI_DC_PROFILE_STRUCT dcPrf = {}; dcPrf.profileId = 1; OsaWcsNCpy(dcPrf.profileData.physician.name, PHYSICIAN_NAME_LENGTH + 1, physician.name, PHYSICIAN_NAME_LENGTH + 1); OsaWcsNCpy(dcPrf.profileData.profileName, PROFILE_NAME_LENGTH + 1, L"ProfileName1", PROFILE_NAME_LENGTH + 1); GUI_DIR_ProfileDirectory(GUI_OPER_ADD, &dcPrf, FALSE); //Add an exam GUI_DC_PATIENT_STRUCT patientInfo = {}; patientInfo.patientId = 1; patientInfo.patient.profileID = 1; wcscpy_s(patientInfo.patient.profileName, L"ProfileName1"); wcscpy_s(patientInfo.patient.name, L"Patient1"); GUI_DIR_PatientDirectory(GUI_OPER_ADD, &patientInfo, false); GUI_DC_EXAM_STRUCT examInfo = {}; examInfo.examId = 1; examInfo.patientId = 1; examInfo.status = EST_CLOSED; wcscpy_s(examInfo.physician, physician.name); GUI_DIR_ExamDirectory(GUI_OPER_ADD, &examInfo, false); physician = {}; physician.physicianId = 2; wcscpy_s(physician.name, L"Physician2"); GUI_DIR_PhysicianDirectory(GUI_OPER_ADD, &physician, false); // Add a profile "ProfileName1" dcPrf = {}; dcPrf.profileId = 2; OsaWcsNCpy(dcPrf.profileData.physician.name, PHYSICIAN_NAME_LENGTH + 1, physician.name, PHYSICIAN_NAME_LENGTH + 1); OsaWcsNCpy(dcPrf.profileData.profileName, PROFILE_NAME_LENGTH + 1, L"ProfileName2", PROFILE_NAME_LENGTH + 1); GUI_DIR_ProfileDirectory(GUI_OPER_ADD, &dcPrf, FALSE); //Add an exam patientInfo = {}; patientInfo.patientId = 2; patientInfo.patient.profileID = 2; wcscpy_s(patientInfo.patient.profileName, L"ProfileName2"); wcscpy_s(patientInfo.patient.name, L"Patient2"); GUI_DIR_PatientDirectory(GUI_OPER_ADD, &patientInfo, false); examInfo = {}; examInfo.examId = 2; examInfo.patientId = 2; wcscpy_s(examInfo.physician, physician.name); GUI_DIR_ExamDirectory(GUI_OPER_ADD, &examInfo, false); ShowResolvePatientMixUp(); std::vector<ListView::Item> ScheduleList; TestUtility::GetInstance().GetItemFromListview(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW, ScheduleList); EXPECT_EQ(1, ScheduleList.size()); std::vector<ListView::Item> ReviewList; TestUtility::GetInstance().GetItemFromListview(RESOLVE_PATIENT_MIXUP_REVIEW_LISTVIEW, ReviewList); EXPECT_EQ(1, ReviewList.size()); TestUtility::GetInstance().RadioButtonClicked(OVERVIEW_BTN_ALLRUNS); TestUtility::GetInstance().ClickButton(OVERVIEW_BTN_RESOLVEPATIENT_MIXUP); TestUtility::GetInstance().ClickTabButton(RESOLVE_PATIENT_MIXUP_TAB_REVIEW_EXAMS); ShowPatexPanel(); GUI_DIR_ProfileClear(); GUI_DIR_PhysicianClear(); GUI_DIR_PatientClear(); GUI_DIR_ExamClear(); GuiGlobal::Data().admiActiveTab = TABPAGE_REVIEW; ShowAdmiPanel(true, true, 0, true, UNIT_OF_HEIGHT_ENUM::CMS_UNIT); TestUtility::GetInstance().ClickButtonSync(ADMI_BTN_SCHEDULE); // Add a physician "Physician1" GUI_DC_PHYSICIAN_STRUCT physician = {}; physician.physicianId = 1; wcscpy_s(physician.name, L"Physician1"); GUI_DIR_PhysicianDirectory(GUI_OPER_ADD, &physician, false); // Add a profile "ProfileName1" GUI_DC_PROFILE_STRUCT dcPrf = {}; dcPrf.profileId = 1; OsaWcsNCpy(dcPrf.profileData.physician.name, PHYSICIAN_NAME_LENGTH + 1, physician.name, PHYSICIAN_NAME_LENGTH + 1); OsaWcsNCpy(dcPrf.profileData.profileName, PROFILE_NAME_LENGTH + 1, L"ProfileName1", PROFILE_NAME_LENGTH + 1); GUI_DIR_ProfileDirectory(GUI_OPER_ADD, &dcPrf, FALSE); //Add an exam GUI_DC_PATIENT_STRUCT patientInfo = {}; patientInfo.patientId = 1; patientInfo.patient.profileID = 1; wcscpy_s(patientInfo.patient.profileName, L"ProfileName1"); wcscpy_s(patientInfo.patient.name, L"Patient1"); GUI_DIR_PatientDirectory(GUI_OPER_ADD, &patientInfo, false); GUI_DC_EXAM_STRUCT examInfo = {}; examInfo.examId = 1; examInfo.patientId = 1; examInfo.status = EST_CLOSED; wcscpy_s(examInfo.physician, physician.name); GUI_DIR_ExamDirectory(GUI_OPER_ADD, &examInfo, false); physician = {}; physician.physicianId = 2; wcscpy_s(physician.name, L"Physician2"); GUI_DIR_PhysicianDirectory(GUI_OPER_ADD, &physician, false); // Add a profile "ProfileName1" dcPrf = {}; dcPrf.profileId = 2; OsaWcsNCpy(dcPrf.profileData.physician.name, PHYSICIAN_NAME_LENGTH + 1, physician.name, PHYSICIAN_NAME_LENGTH + 1); OsaWcsNCpy(dcPrf.profileData.profileName, PROFILE_NAME_LENGTH + 1, L"ProfileName2", PROFILE_NAME_LENGTH + 1); GUI_DIR_ProfileDirectory(GUI_OPER_ADD, &dcPrf, FALSE); //Add an exam patientInfo = {}; patientInfo.patientId = 2; patientInfo.patient.profileID = 2; wcscpy_s(patientInfo.patient.profileName, L"ProfileName2"); wcscpy_s(patientInfo.patient.name, L"Patient2"); GUI_DIR_PatientDirectory(GUI_OPER_ADD, &patientInfo, false); examInfo = {}; examInfo.examId = 2; examInfo.patientId = 2; wcscpy_s(examInfo.physician, physician.name); GUI_DIR_ExamDirectory(GUI_OPER_ADD, &examInfo, false); ShowResolvePatientMixUp(); std::vector<ListView::Item> ScheduleList; TestUtility::GetInstance().GetItemFromListview(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW, ScheduleList); EXPECT_EQ(1, ScheduleList.size()); std::vector<ListView::Item> ReviewList; TestUtility::GetInstance().GetItemFromListview(RESOLVE_PATIENT_MIXUP_REVIEW_LISTVIEW, ReviewList); EXPECT_EQ(1, ReviewList.size()); TestUtility::GetInstance().RadioButtonClicked(OVERVIEW_BTN_ALLRUNS); TestUtility::GetInstance().ClickButton(OVERVIEW_BTN_RESOLVEPATIENT_MIXUP); TestUtility::GetInstance().ClickTabButton(RESOLVE_PATIENT_MIXUP_TAB_REVIEW_EXAMS); EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW)); TestUtility::GetInstance().ClickButtonSync(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW); Sleep(100); TestUtility::GetInstance().SelectItemInList(L"RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW", 0, true); Sleep(100); //Verify if Schedule list has entries int noOfItemsInScheduleList = TestUtility::GetInstance().GetNoOfItemsInList(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW); EXPECT_EQ(1, noOfItemsInScheduleList); GUI_DIR_ProfileClear(); GUI_DIR_PhysicianClear(); GUI_DIR_PatientClear(); GUI_DIR_ExamClear(); HideResolvePatientMixUp(); HideAdmiPanel(); HidePatexPanel(); } - Assistant
- User
//Verify if Review list has entries int noOfItemsInReviewList = TestUtility::GetInstance().GetNoOfItemsInList(ADMI_REVIEWLIST); EXPECT_EQ(4, noOfItemsInReviewList);
ShowAdmiPanel(true, true, 0, true); TestUtility::GetInstance().WaitForControlShow(ADMI_PANEL_MAINUI, WAIT_FOR_500msec); Sleep(100); // Validate ADMI show. EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(ADMI_PANEL_MAINUI)); TestUtility::GetInstance().ClickButtonSync(ADMI_BTN_REVIEW); Sleep(100); TestUtility::GetInstance().SelectItemInList(L"ReviewListPtry", 0, true); Sleep(100); TestUtility::GetInstance().ClickButtonSync(ADMI_BTN_MODIFYREVIEW); Sleep(100); //Verify if Review list has entries noOfItemsInReviewList = TestUtility::GetInstance().GetNoOfItemsInList(ADMI_REVIEWLIST); EXPECT_EQ(4, noOfItemsInReviewList); //Get selected item in Physician list int selectedIndexInPhysicianList = 0; TestUtility::GetInstance().GetSelectedItemInComboBox(MVSUI::ADD_CMB_PHYSICIAN, selectedIndexInPhysicianList); EXPECT_STREQ(exam.physician, TestUtility::GetInstance().GetTextInComboBox(MVSUI::ADD_CMB_PHYSICIAN, selectedIndexInPhysicianList).c_str()); HideAdmiPanel(); } set and get selection methods are somewhere here. could u pls improvise the correct func names? - Assistant
- User
give me the updated full case to directly paste there n check
- Assistant
- User
could u pls follow admis style of assigning values? cz im completely new to this im looking forward to ur code to learn. pls follow the references i have given. dont assign to bool variables and all to check.
- Assistant
- User
void TestUtility::SelectItemInList(const std::wstring& controlID, int itemIndex, bool focus) { ListView* list = dynamic_cast<ListView*>(Automation::TestHelper::GetInstance().GetControlByID(controlID)); if(nullptr != list) { if (focus) { SenseDisplayer::SetKeyboardFocus(*list); } SenseDisplayer::SyncInvoke(*list, [list, itemIndex] { list->setSelectedItem(itemIndex); }); } }
std::set<int> TestUtility::GetSelectedItemInList(const std::wstring& controlID) { std::set<int> searchResult; ListView* list = dynamic_cast<ListView*>(Automation::TestHelper::GetInstance().GetControlByID(controlID)); if (nullptr != list) { SenseDisplayer::SyncInvoke(*list, [list, &searchResult] { searchResult = list->getSelection(); }); } return searchResult; } these are the api func. pls check argument and pass. it says too many arguments. - Assistant
- User
- Assistant
- User
give a ready to paste code
- Assistant
- User
thannks a lot it passed. could u pls explain step by step explain each func role? like a beginner
- Assistant
- User
GUI_DC_PROFILE_STRUCT profile1 = {}; profile1.profileId = 1; OsaWcsNCpy(profile1.profileData.physician.name, PHYSICIAN_NAME_LENGTH + 1, physician1.name, PHYSICIAN_NAME_LENGTH + 1); OsaWcsNCpy(profile1.profileData.profileName, PROFILE_NAME_LENGTH + 1, L"ProfileName1", PROFILE_NAME_LENGTH + 1); GUI_DIR_ProfileDirectory(GUI_OPER_ADD, &profile1, FALSE); whats happening here?
- Assistant
- User
// Verify Schedule list has at least 1 item std::vectorListView::Item ScheduleList; TestUtility::GetInstance().GetItemFromListview(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW, ScheduleList); EXPECT_GE((int)ScheduleList.size(), 1); explain pls
- Assistant
- User
// Get selected items from Schedule list and verify std::set selectedSchedule = TestUtility::GetInstance().GetSelectedItemInList(RESOLVE_PATIENT_MIXUP_SCHEDULE_LISTVIEW); EXPECT_EQ(selectedSchedule.size(), 1); EXPECT_NE(selectedSchedule.find(0), selectedSchedule.end()); ---------> pls explain why we using a set?
- Assistant
Great question! Here's why a
std::set<int>is used for selected items and what these lines do:
What is being done here?
- User
EXPECT_NE(selectedSchedule.find(0), selectedSchedule.end()); why is it needed n wats expect_ne?
- Assistant
Great questions! Let me explain both parts clearly:
What does
EXPECT_NEmean?EXPECT_NEis a macro from the Google Test framework used in C++ unit tests.- It stands for .
- User
// Get selected items from Review list and verify std::set selectedReview = TestUtility::GetInstance().GetSelectedItemInList(RESOLVE_PATIENT_MIXUP_REVIEW_LISTVIEW); EXPECT_EQ(selectedReview.size(), 1); EXPECT_NE(selectedReview.find(0), selectedReview.end());--- bt i really dnt understand the importance of the second check. cz the 1st one is already checking if the list has 1 element right? so why are we checking the 0 element?
- Assistant
Great question — this is actually a very common point of confusion! Here's a clear explanation:
What does each check do?
- User
1 rem = kitna px
- Assistant
1 rem (root em) is equal to the font size of the root element (
<html>) in CSS.By default, most browsers set the root font size to 16 pixels, so:
1 rem = 16 px (by default)
Important notes:
-
If the root font size is changed with CSS, e.g.:
html { font-size: 20px; }then
1 rem = 20 px
-
So
remis relative to the root font size, unlikeemwhich is relative to the font size of the current element.
Summary:
Unit Meaning Typical pixel equivalent (default) 1rem Font size of root <html>16px (usually) If you want to convert rem to px, multiply rem by root font size in pixels.
If you want help calculating or using rem in CSS, let me know!
-