/* public static void Main(string[] args) * { * SampleTest test = new SampleTest(); * Login.loginPSC(currentWindow); * Thread.Sleep(5000); * Screenshot screen = new Screenshot(); * screen.GetScreenshot("temp.png"); * search.SearchPatient(1); * Thread.Sleep(5000); * bool flag = search.IsSearchEmpty(); * if (flag == true) * { * Console.WriteLine("Not able to search the patient, So adding the patient"); * search.AddNewPatient(); * test.ProvideNewPatientInformation(); * } * else if (flag == false) * { * Console.WriteLine("Patient Found"); * search.SelectFirstSearchRecord(); * } * //test.InputAdditionInfo(); * //test.AddGuardianInformation(); * //test.PerformOperations(); * //test.AddInsuranceInfo(); * //test.AddNewPatient(); * } * * public void InputAdditionInfo() * { * AdditionalInfoPage aip = new AdditionalInfoPage(currentWindow); * standard.Next(); * Thread.Sleep(5000); * aip.ProvideMailingAddress(1); * Thread.Sleep(2000); * // aip.SameAsMailingAddress("No"); * // aip.ProvideBillingAddress(1); * * } * * public void AddInsuranceInfo() * { * for (int i = 0; i < 10; i++) * standard.Back(); * * Thread.Sleep(5000); * AdditionalInfoPage aip = new AdditionalInfoPage(currentWindow); * Thread.Sleep(2000); * aip.AddInsurance(1); * } * * public void AddGuardianInformation() * { * //standard.Next(); * standard.Next(); * Thread.Sleep(5000); * AdditionalInfoPage aip = new AdditionalInfoPage(currentWindow); * //aip.AddGuardian(1); * aip.AddEmergencyContact(1); * Thread.Sleep(1000); * standard.Delete(); * Thread.Sleep(2000); * standard.Ok(); * //standard.Delete(); * } * * public void PerformOperations() * { * //StandardOperations standard = new StandardOperations(currentWindow); * Thread.Sleep(5000); * tabs.Dashboard(); * Thread.Sleep(5000); * standard.Cancel(); * Thread.Sleep(5000); * tabs.Dashboard(); * Thread.Sleep(5000); * standard.Ok(); * Console.ReadLine(); * }*/ public void C_AddNewPatientInformation() { Thread.Sleep(5000); BasicInfoPage bip = new BasicInfoPage(currentWindow); bip.ProvideBasicInformation(9); Thread.Sleep(2000); standard.Save(); }
public void AddNonExistingPatient() { if (search.IsSearchEmpty() && patientid < 3) { Console.WriteLine("Not able to search the patient, So adding the patient"); search.AddNewPatient(); Thread.Sleep(5000); BasicInfoPage bip = new BasicInfoPage(currentWindow); bip.ProvideBasicInformation("patientadditionalinfo.csv", patientid); Thread.Sleep(2000); standard.Save(); Thread.Sleep(3000); tabs.Dashboard(); Thread.Sleep(2000); standard.Ok(); } }
public void Validate_All_Patient_Basic_Info_Fields(int patientid) { SearchingPatients("Preferred Method of Communication", patientid); bip.ProvideFirstName(filename, patientid); bip.ProvideLastName(filename, patientid); bip.ProvideDOB(filename, patientid); bip.ProvideBasicInformation(filename, patientid); flag = ValidateInformation(); if (flag) { count++; Assert.Pass(); } else { count++; Assert.Fail(); } }
public void PSCNotAllowingToAddDuplicatePatientUsingEdit(int patientid) { count++; Console.WriteLine("\n----------------------Testing Patient ID " + patientid + "-------------------------------------"); Console.WriteLine("TEST-----> Verify if PSC allow to add duplicate patient using edit option"); Console.WriteLine("Step1- Searching for the already added patient "); search.SearchPatient("duplicatepatients.csv", patientid); Thread.Sleep(5000); if (search.IsSearchEmpty()) { Console.WriteLine("Patient Found in PSC!!"); tabs.Dashboard(); flag = true; Console.WriteLine("---------------------------------------------------------------------------\n"); Assert.Ignore("Ignoring this patient as this patient doesn't exist in PSC"); } Console.WriteLine("Step2: Patient already added in PSC, So opening the patient information in PSC"); search.SelectFirstSearchRecord(); Thread.Sleep(2000); Console.WriteLine("Additional Step: Going to BasicInfo page, if any other page opens in PSC"); bip.GoBackToBasicInfoPage(); Thread.Sleep(2000); Console.WriteLine("Step3: Patient Information open in PSC"); Console.WriteLine("Step4: Click on Edit to edit user information"); standard.Edit(); Console.WriteLine("Step5: Edit option clicked and patient information can be modified"); if (count == 0) { Console.WriteLine("Step 6: Adding already existing patient --" + patientids[count + 1] + "-- from data file"); bip.ProvideFirstName("duplicatepatients.csv", patientids[count + 1]); bip.ProvideLastName("duplicatepatients.csv", patientids[count + 1]); bip.ProvideDOB("duplicatepatients.csv", patientids[count + 1]); bip.ProvideBasicInformation("duplicatepatients.csv", patientids[count + 1]); Thread.Sleep(2000); if (!standard.Save()) { Console.WriteLine("Result: Not able to add new patient as patient information is not correct in one or more basic info fields"); Console.WriteLine(" INFO: Please check the screenshot for more information"); Thread.Sleep(2000); bip.GoToDashBoard(); Console.WriteLine("---------------------------------------------------------------------------\n"); Assert.Ignore(); } } else { bip.ProvideFirstName("duplicatepatients.csv", patientids[count - 1]); bip.ProvideLastName("duplicatepatients.csv", patientids[count - 1]); bip.ProvideDOB("duplicatepatients.csv", patientids[count - 1]); bip.ProvideBasicInformation("duplicatepatients.csv", patientids[count - 1]); Console.WriteLine("Step 6: Adding already existing patient --" + patientids[count - 1] + " -- from data file"); Thread.Sleep(2000); if (!standard.Save()) { Console.WriteLine("Result: Not able to add new patient as patient information is not correct in one or more basic info fields"); Console.WriteLine(" INFO: Please check the screenshot for more information"); Thread.Sleep(2000); bip.GoToDashBoard(); Assert.Ignore("TEST IGNORED: Not able to run test for this patient because full information not provided"); Console.WriteLine("---------------------------------------------------------------------------\n"); } } Thread.Sleep(4000); flag = bip.VerifyPatientAdded(); bip.GoToDashBoard(); if (flag) { search.SearchPatient("duplicatepatients.csv", patientid); int nop = search.FindNumberOfSearchPatients(); if (nop > 1) { Console.WriteLine("-------------------Test Completed for " + patientid + " ---------------------"); Console.WriteLine("Test FAILED. Actual Result: PSC is allowing to add duplicate Patients"); Console.WriteLine("---------------------------------------------------------------------------\n"); Assert.Fail("-----------Test Failed -------------------"); } flag = false; } if (!flag) { Console.WriteLine("-------------------Test Completed for " + patientid + " ----------------------------"); Console.WriteLine("\nTest PASSED! \nActual Result: PSC is not allowing to add duplicate Patients\n"); Console.WriteLine("-------------------------------------------------------------------------------------------\n"); Assert.Pass(); } }