diff --git a/src/test/java/ServiceNow/CHARMS/Constants/CHARMS_Data_File_Path_Constants.java b/src/test/java/ServiceNow/CHARMS/Constants/CHARMS_Data_File_Path_Constants.java index 9b944c87f..fec76e842 100644 --- a/src/test/java/ServiceNow/CHARMS/Constants/CHARMS_Data_File_Path_Constants.java +++ b/src/test/java/ServiceNow/CHARMS/Constants/CHARMS_Data_File_Path_Constants.java @@ -7,10 +7,14 @@ public class CHARMS_Data_File_Path_Constants { public static final String RAS_SCENARIO_TWO_DATA = "src/test/java/ServiceNow/CHARMS/Resources/RASScenario2.xlsx"; public static final String RAS_SCENARIO_THREE_DATA = "ServiceNow/CHARMS/Resources/RASScenario3.xlsx"; public static final String RAS_SCENARIO_FOUR_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario4.xlsx"; - public static final String RAS_SCENARIO_FIVE_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/GenAIData/Gen_AI_Data_Set_1.xlsx"; - public static final String RAS_SCENARIO_AGE_11_13_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_11-13.xlsx"; - public static final String RAS_SCENARIO_AGE_14_17_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_14-17.xlsx"; + public static final String RAS_SCENARIO_FIVE_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/GenAIData/Gen_AI_Data_Set_1.xlsx"; + public static final String RAS_SCENARIO_AGE_UNDER_7 = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under-7.xlsx"; + public static final String RAS_SCENARIO_AGE_7_10_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_7-10.xlsx"; + public static final String RAS_SCENARIO_AGE_11_13_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_11-13.xlsx"; + public static final String RAS_SCENARIO_AGE_14_17_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_14-17.xlsx"; + public static final String RAS_SCENARIO_ADULT_NEEDS_LAR = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult_Needs_LAR.xlsx"; + public static final String RAS_SCENARIO_ADULT = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult.xlsx"; public static final String IIQ_SAMPLE_FORM = "https://ncidccpssurveys.gov1.qualtrics.com/jfe/form/SV_37PVCadeAqdT6Ki?family_member_id=5671bd521bafa1106daea681f54bcb68&study=RASopathies"; public static final String FHQ_SCENARIO_ONE_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/FHQScenario1.xlsx"; public static final String FHQ_SCENARIO_TWO_DATA = System.getProperty("user.dir") + "/src/test/java/ServiceNow/CHARMS/Resources/FHQScenario2.xlsx"; -} +} \ No newline at end of file diff --git a/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Consent Scenarios.feature b/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Consent Scenarios.feature index 9ca956e0f..c8b3a5914 100644 --- a/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Consent Scenarios.feature +++ b/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Consent Scenarios.feature @@ -15,11 +15,9 @@ Feature: RAS Consent Scenarios Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" And logs in via Okta with username "" and password "" And "Download Study Consent" text shows on participant portal and when clicked downloads "Consent Record" - Examples: - | Email | Password | ScreenerScenario | ConsentStatus | ConsentType | ResponseType | AccountResetScriptURL | - | consent_participant@yopmail.com | Charms123$ | screenerScenario1 | Complete | Adult | CHARMS e-consent | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | -# | consent_participant@yopmail.com | Charms123$ | screenerScenarioAge14-17 | Complete | Aged 14 - 17, signed consent required | CHARMS e-consent | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + | Email | Password | ScreenerScenario | ConsentStatus | ConsentType | ResponseType | AccountResetScriptURL | + | consent_participant@yopmail.com | Charms123$ | screenerScenario1 | Complete | Adult | CHARMS e-consent | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | @muzipovay2 @RAS_STUDY @CP2-3603 @selenium @RAS_Regression Scenario Outline: Verifying consent workflows for an adult participant, and then verifying that a Download Study Consent widget shows on portal and when clicked downloads the most recent Consent Record @@ -32,7 +30,6 @@ Feature: RAS Consent Scenarios Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" And logs in via Okta with username "" and password "" And "Download Study Consent" text shows on participant portal and when clicked downloads "Consent Record" - Examples: | Email | Password | ScreenerScenario | ConsentStatus | ConsentType | ResponseType | AccountResetScriptURL | | consent_participant@yopmail.com | Charms123$ | screenerScenario1 | Complete | Adult | Participant upload to portal | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | @@ -46,7 +43,7 @@ Feature: RAS Consent Scenarios And logs in via Okta with username "" and password "" And clicks on "Eligibility Questionnaire" to begin survey When the participant submits a screener from excel sheet "" - Then Study Team member logs in to Native View and completest consent call "", "", "", "", "", "", "" + Then Study Team member logs in to Native View and completes consent call "", "", "", "", "", "", "" And Study Team member logs out of Native View And a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" And logs in via Okta with username "" and password "" @@ -60,3 +57,35 @@ Feature: RAS Consent Scenarios Examples: | Email | Password | ScreenerScenario | ConsentStatus | ConsentType | ResponseType | ParentGuardianStatus | NumberOfGuardianSignaturesRequired | NumberOfParentGuardianSignaturesReceived | AccountResetScriptURL | | consent_participant@yopmail.com | Charms123$ | screenerScenarioAge11-13 | Complete | Aged 11 - 13, signed assent required | CHARMS e-consent | Parents, Married | 1 | 1 | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + + @muzipovay2 @RAS_STUDY @selenium @CP2-3730 @RAS_Regression + Scenario: Verifying that when a minor aged 11-13 has completed Assent, the field Assent signed is true in their Native View Consent Record + Given test automation account "https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597" has been reset + And a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" + And logs in via Okta with username "consent_participant@yopmail.com" and password "Charms123$" + And clicks on "Eligibility Questionnaire" to begin survey + When the participant submits a screener from excel sheet "screenerScenarioAge11-13" + Then Study Team member logs in to Native View and completes consent call "screenerScenarioAge11-13", "Complete", "Aged 11 - 13, signed assent required", "CHARMS e-consent", "Parents, Married", "1", "0" + And Study Team member logs out of Native View + And a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" + And logs in via Okta with username "consent_participant@yopmail.com" and password "Charms123$" + And participant clicks on Study Assent and completes form with "Charms123$" + And participant logs out of RAS portal + Then Study Team member logs in to Native View and verifies that the field Assent signed is true "screenerScenarioAge11-13" + + @muzipovay2 @RAS_STUDY @selenium @CP2-3703 @RAS_Regression + Scenario Outline: Verifying that Adult/Minor participants can complete the Eligibility Questionnaire + Given test automation account "" has been reset + Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" + And logs in via Okta with username "" and password "" + And clicks on "Eligibility Questionnaire" to begin survey + When the participant submits a screener from excel sheet "" + And Study Team member logs in to Native View and verifies that a new screener has been submitted "" + Examples: + | Email | Password | ScreenerScenario | AccountResetScriptURL | + | consent_participant@yopmail.com | Charms123$ | screenerScenarioAdult | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + | consent_participant@yopmail.com | Charms123$ | screenerScenarioAdult-NeedsLAR | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + | consent_participant@yopmail.com | Charms123$ | screenerScenarioAgeUnder7 | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + | consent_participant@yopmail.com | Charms123$ | screenerScenarioAge7-10 | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + | consent_participant@yopmail.com | Charms123$ | screenerScenarioAge11-13 | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | + | consent_participant@yopmail.com | Charms123$ | screenerScenarioAge14-17 | https://service-test.nci.nih.gov/nav_to.do?uri=sys_script_fix.do?sys_id=b8daf9fa872096107e87a8a60cbb3597 | \ No newline at end of file diff --git a/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Entire Flow.feature b/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Entire Flow.feature index 0e67c9ed8..d1456b3cc 100644 --- a/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Entire Flow.feature +++ b/src/test/java/ServiceNow/CHARMS/Features/RasopathyStudy/RAS Entire Flow.feature @@ -7,20 +7,20 @@ Feature: RAS Screener Scenarios Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" And logs in via Okta with username "" and password "" And clicks on "Eligibility Questionnaire" to begin survey -# When the participant submits a screener from excel sheet "" + When the participant submits a screener from excel sheet "" # Then screener data from "" is verified -# And the consent is submitted for "" -# Then data submitted for scenario is verified in native from the excel sheet "" -# Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" -# And logs in via Okta with username "" and password "" -# And clicks on the IIQ Form -# And a participant enters username "" and pin -# And the participant submits a Individual Information Questionnaire for excel sheet "" -# Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" -# And logs in via Okta with username "" and password "" -# And clicks on the Ras Survey Form -# And a participant enters username "" and pin -# When the participant submits a RAS Survey from excel sheet "" + And the consent is submitted for "" + Then data submitted for scenario is verified in native from the excel sheet "" + Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" + And logs in via Okta with username "" and password "" + And clicks on the IIQ Form + And a participant enters username "" and pin + And the participant submits a Individual Information Questionnaire for excel sheet "" + Given a participant is on the RASopathies Longitudinal Cohort Study login page "myRASLoginPage" + And logs in via Okta with username "" and password "" + And clicks on the Ras Survey Form + And a participant enters username "" and pin + When the participant submits a RAS Survey from excel sheet "" Examples: | Email | Password | ScreenerScenario | IIQScenario | SurveyScenario | | charmsras1@yahoo.com | RASTest2022$$ | screenerScenario1 | IIQScenario1 | RASSurveyScenario1 | diff --git a/src/test/java/ServiceNow/CHARMS/Pages/NativeViewCHARMSParticipantConsentPage.java b/src/test/java/ServiceNow/CHARMS/Pages/NativeViewCHARMSParticipantConsentPage.java index 275f5ed9a..691fcacfc 100644 --- a/src/test/java/ServiceNow/CHARMS/Pages/NativeViewCHARMSParticipantConsentPage.java +++ b/src/test/java/ServiceNow/CHARMS/Pages/NativeViewCHARMSParticipantConsentPage.java @@ -7,117 +7,181 @@ public class NativeViewCHARMSParticipantConsentPage { - /**Native View Ras Study Consent Call Schedule Time Calendar*/ + /** + * Native View Ras Study Consent Call Schedule Time Calendar + */ @FindBy(xpath = "//*[@id='element.x_naci_family_coho_fcsms_consent.consent_call_scheduled_time']//child::div[2]//child::div[2]//child::span//child::span[1]//child::button") public WebElement rasStudyConsentCallScheduleTimeCalendar; - /**Native View Ras Study Consent Call Date Calendar*/ + /** + * Native View Ras Study Consent Call Date Calendar + */ @FindBy(xpath = "//*[@id='element.x_naci_family_coho_fcsms_consent.consent_call_date']//child::div[2]//child::span[1]//child::span[1]//child::a") public WebElement rasStudyConsentCallScheduleDateCalendar; - /**Native View Ras Study Consent Date Calendar*/ + /** + * Native View Ras Study Consent Date Calendar + */ @FindBy(xpath = "//*[@id='element.x_naci_family_coho_fcsms_consent.consent_date']//child::div[2]//child::span[1]//child::span[1]//child::a") public WebElement rasStudyConsentDateCalendar; - /**Native View Ras Study Consent version Calendar*/ + /** + * Native View Ras Study Consent version Calendar + */ @FindBy(xpath = "//*[@id='element.x_naci_family_coho_fcsms_consent.consent_version']//child::div[2]//child::span[1]//child::span[1]//child::a") public WebElement rasStudyConsentCallScheduleVerionCalendar; - /**Native View Ras Study Consent Call Schedule Time Go To Today Button*/ + /** + * Native View Ras Study Consent Call Schedule Time Go To Today Button + */ @FindBy(xpath = "//td[@aria-label='Go to Today']") public WebElement rasStudyConsentCallScheduleTimeTodayButton; @FindBy(xpath = "//*[@id='x_naci_family_coho_family_history_details.u_participantdate.ui_policy_sensitive']") public WebElement rasStudyNonParticipantDateButton; - /**Native View Ras Study Consent Call Schedule Time Accept Button*/ + /** + * Native View Ras Study Consent Call Schedule Time Accept Button + */ @FindBy(xpath = "//button[@id='GwtDateTimePicker_ok']") public WebElement rasStudyConsentCallScheduleTimeAcceptButton; - /**Native View Ras Study Consent Response Type Drop Down*/ + /** + * Native View Ras Study Consent Response Type Drop Down + */ @FindBy(xpath = "//*[@id='x_naci_family_coho_fcsms_consent.response_type']") public WebElement rasStudyConsentResponseTypeDropDown; - /**Native View Ras Study Consent By Text Box*/ + /** + * Native View Ras Study Consent By Text Box + */ @FindBy(xpath = "//*[@id='sys_display.x_naci_family_coho_fcsms_consent.consent_by']") public WebElement rasStudyConsentByTextBox; - /**Native View Ras Study Current Drop Down*/ + /** + * Native View Ras Study Current Drop Down + */ @FindBy(xpath = "//*[@id='x_naci_family_coho_fcsms_consent.current_previous']") public WebElement rasStudyConsentCurrentDropDown; - /**Native View Ras Study Consent/Assent Status Drop Down*/ + /** + * Native View Ras Study Consent/Assent Status Drop Down + */ @FindBy(xpath = "//*[@id='x_naci_family_coho_fcsms_consent.participant_response']") public WebElement rasStudyConsentConsentAssentStatusDropDown; - /**Native View Ras Study Parent/Guardian Status Drop Down*/ + /** + * Native View Ras Study Parent/Guardian Status Drop Down + */ @FindBy(xpath = "//select[contains(@name,'x_naci_family_coho_fcsms_consent.parental_relationship')]") public WebElement rasStudyConsentParentGuardianStatusDropDown; - /**Native View Ras Study Number of Parent/Guardian Signatures Required Drop Down*/ + /** + * Native View Ras Study Number of Parent/Guardian Signatures Required Drop Down + */ @FindBy(xpath = "//select[@id='x_naci_family_coho_fcsms_consent.number_of_guardian']") public WebElement rasStudyConsentNumberOfParentGuardianSignaturesRequiredDropDown; - /**Native View Parent/Guardian 1 Signed Drop Down*/ + /** + * Native View Parent/Guardian 1 Signed Drop Down + */ @FindBy(xpath = "(//select[@name='x_naci_family_coho_fcsms_consent.guardian_1_signed'])[1]") public WebElement rasStudyConsentParentGuardian1SignedDropDown; - /**Native View Parent/Guardian 2 Signed Drop Down*/ + /** + * Native View Parent/Guardian 2 Signed Drop Down + */ @FindBy(xpath = "(//select[@name='x_naci_family_coho_fcsms_consent.guardian_2_signed'])[1]") public WebElement rasStudyConsentParentGuardian2SignedDropDown; - /**Native View Ras Study Future Use Of Specimens and Data by NIH Drop Down*/ + /** + * Native View Assent signed checkbox + */ + @FindBy(xpath = "//input[@id='ni.x_naci_family_coho_fcsms_consent.assent_signed']") + public WebElement rasStudyAssentSignedCheckBox; + + /** + * Native View hidden Assent signed checkbox + */ + @FindBy(xpath = "//input[@id='ni.x_naci_family_coho_fcsms_consent.assent_signed']") + public WebElement rasStudyHiddenAssentSignedInput; + + /** + * Native View Ras Study Future Use Of Specimens and Data by NIH Drop Down + */ @FindBy(xpath = "//*[@id='x_naci_family_coho_fcsms_consent.future_use_of_specimens_and_data_by_nih']") public WebElement rasStudyConsentFutureSpecimensAndDataDropDown; - /**Native View Ras Study Future Use By Collaborators Drop Down*/ + /** + * Native View Ras Study Future Use By Collaborators Drop Down + */ @FindBy(xpath = "//*[@id='x_naci_family_coho_fcsms_consent.future_use_by_collaborators']") public WebElement rasStudyConsentFutureUseCollaboratorsDropDown; - /**Native View Ras Study Future Identifiable Use By Collaborators Drop Down*/ + /** + * Native View Ras Study Future Identifiable Use By Collaborators Drop Down + */ @FindBy(xpath = "//*[@id='x_naci_family_coho_fcsms_consent.future_identifiable_use_by_collaborators']") public WebElement rasStudyConsentFutureIdentifiableUseCollaboratorsDropDown; - /**Native View Ras Study Call Complete Button*/ + /** + * Native View Ras Study Call Complete Button + */ @FindBy(xpath = "//*[@id='call_complete']") public WebElement rasStudyConsentCallCompleteButton; - /**Native View Ras Study Add File Button*/ + /** + * Native View Ras Study Add File Button + */ @FindBy(xpath = "//*[@id='add_attachment']") public WebElement rasStudyConsentAddFileButton; - /**Native View Ras Study Choose File Button*/ + /** + * Native View Ras Study Choose File Button + */ @FindBy(xpath = "//*[@id='attachFile']") public WebElement rasStudyConsentChoseFileButton; - /**Native View Ras Study Chose File Close Button*/ + /** + * Native View Ras Study Chose File Close Button + */ @FindBy(xpath = "//*[@id='attachment_closemodal']") public WebElement rasStudyConsentChoseFileCloseButton; - /**Native View Ras Study Chose Call Complete Button*/ + /** + * Native View Ras Study Chose Call Complete Button + */ @FindBy(xpath = "//button[@id='call_complete']") public WebElement rasStudyConsentChoseCallCompleteButton; - /**Native View Ras Study Hard Copy of Consent Received Button*/ + /** + * Native View Ras Study Hard Copy of Consent Received Button + */ @FindBy(xpath = "//*[@id='hard_consent_received']") public WebElement rasStudyConsentHardCopyReceivedButton; - /**Native View Ras Complete Consent Button*/ + /** + * Native View Ras Complete Consent Button + */ @FindBy(xpath = "//*[@id='complete_consent']") public WebElement rasStudyConsentCompletedConsentButton; - /**Native View Ras Study Participant Records Ready To Progress Message*/ + /** + * Native View Ras Study Participant Records Ready To Progress Message + */ @FindBy(xpath = "//div[normalize-space()='Participant record ready to progress.']") public WebElement rasStudyConsentParticipantRecordsReadyToProgressMessage; @FindBy(xpath = "//button[@id='sign_and_complete_client']") public WebElement rasStudyConsentSignAndCompleteButton; - /**Native View Ras Study Consent Record Completed Message*/ + /** + * Native View Ras Study Consent Record Completed Message + */ @FindBy(xpath = "//div[normalize-space()='Consent record completed and Family record is now active!']") public WebElement rasStudyConsentConsentRecordCompletedMessageMessage; public NativeViewCHARMSParticipantConsentPage() { PageFactory.initElements(WebDriverUtils.webDriver, this); } -} +} \ No newline at end of file diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult.xlsx new file mode 100644 index 000000000..5e7a8dcce Binary files /dev/null and b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult.xlsx differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult_Needs_LAR.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult_Needs_LAR.xlsx new file mode 100644 index 000000000..9a611176f Binary files /dev/null and b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Adult_Needs_LAR.xlsx differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_11-13.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_11-13.xlsx index 138c4ddb9..60f0b08bf 100644 Binary files a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_11-13.xlsx and b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_11-13.xlsx differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_14-17.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_14-17.xlsx index 1de645660..9186371e5 100644 Binary files a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_14-17.xlsx and b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_14-17.xlsx differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_7-10.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_7-10.xlsx index 8d9cdb2b7..30b574459 100644 Binary files a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_7-10.xlsx and b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_7-10.xlsx differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Adult.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Adult.xlsx deleted file mode 100644 index 8d9cdb2b7..000000000 Binary files a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Adult.xlsx and /dev/null differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under-7.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under-7.xlsx new file mode 100644 index 000000000..2e950d267 Binary files /dev/null and b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under-7.xlsx differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under_7.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under_7.xlsx deleted file mode 100644 index 8d9cdb2b7..000000000 Binary files a/src/test/java/ServiceNow/CHARMS/Resources/RASScenario_Consent_Age_Under_7.xlsx and /dev/null differ diff --git a/src/test/java/ServiceNow/CHARMS/Resources/~$RASScenario_Consent_Age_14-17.xlsx b/src/test/java/ServiceNow/CHARMS/Resources/~$RASScenario_Consent_Age_14-17.xlsx deleted file mode 100644 index b9b313bec..000000000 Binary files a/src/test/java/ServiceNow/CHARMS/Resources/~$RASScenario_Consent_Age_14-17.xlsx and /dev/null differ diff --git a/src/test/java/ServiceNow/CHARMS/ScenariosData/RAS_Screener_TestDataManager.java b/src/test/java/ServiceNow/CHARMS/ScenariosData/RAS_Screener_TestDataManager.java index caa339c10..56f0a5085 100644 --- a/src/test/java/ServiceNow/CHARMS/ScenariosData/RAS_Screener_TestDataManager.java +++ b/src/test/java/ServiceNow/CHARMS/ScenariosData/RAS_Screener_TestDataManager.java @@ -140,20 +140,31 @@ public void dataInitializerRasScreener(String sheetName) { /** * FETCHING DATA FROM EXCEL BEFORE SUBMITTING SCREENER */ - if (sheetName.equals("screenerScenario1") || sheetName.equals("screenerScenario2") || sheetName.equals("screenerScenarioAge11-13") || sheetName.equals("screenerScenarioAge14-17")) { + if (sheetName.equals("screenerScenario1") || sheetName.equals("screenerScenario2") || sheetName.equals("screenerScenarioAdult") || sheetName.equals("screenerScenarioAdult-NeedsLAR") ||sheetName.equals("screenerScenarioAgeUnder7") || sheetName.equals("screenerScenarioAge7-10") || sheetName.equals("screenerScenarioAge11-13") || sheetName.equals("screenerScenarioAge14-17")) { if (sheetName.equals("screenerScenario1")) { TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_ONE_DATA, sheetName); } if (sheetName.equals("screenerScenario2")) { TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_TWO_DATA, sheetName); } + if (sheetName.equals("screenerScenarioAdult")) { + TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_ADULT, sheetName); + } + if (sheetName.equals("screenerScenarioAdult-NeedsLAR")) { + TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_ADULT_NEEDS_LAR, sheetName); + } + if (sheetName.equals("screenerScenarioAgeUnder7")) { + TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_AGE_UNDER_7, sheetName); + } + if (sheetName.equals("screenerScenarioAge7-10")) { + TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_AGE_7_10_DATA, sheetName); + } if (sheetName.equals("screenerScenarioAge11-13")) { TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_AGE_11_13_DATA, sheetName); } if (sheetName.equals("screenerScenarioAge14-17")) { TEST_DATA_FOR_RAS_SCREENER = ExcelReader.excelIntoHashMap(CHARMS_Data_File_Path_Constants.RAS_SCENARIO_AGE_14_17_DATA, sheetName); } - ARE_YOU_COMPLETING_THIS_FORM_FOR_SOMEONE_ELSE_OR_YOURSELF = TEST_DATA_FOR_RAS_SCREENER.get("Are you completing this form for someone else or for yourself?"); FIRST_NAME = TEST_DATA_FOR_RAS_SCREENER.get("First name"); MIDDLE_INITIAL = TEST_DATA_FOR_RAS_SCREENER.get("Middle Initial"); diff --git a/src/test/java/ServiceNow/CHARMS/Steps/RAS_All_Steps.java b/src/test/java/ServiceNow/CHARMS/Steps/RAS_All_Steps.java index ddef4243f..525cb715b 100644 --- a/src/test/java/ServiceNow/CHARMS/Steps/RAS_All_Steps.java +++ b/src/test/java/ServiceNow/CHARMS/Steps/RAS_All_Steps.java @@ -14,13 +14,9 @@ import io.cucumber.java.en.When; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; +import java.io.*; import java.net.HttpURLConnection; import java.net.URL; -import java.util.Set; -import static Hooks.Hooks.softAssert; import static ServiceNow.CHARMS.Pages.MyRASHomePage.dynamicModuleLocator; import static ServiceNow.CHARMS.Steps.RAS_Common_Methods.*; import static appsCommon.Pages.Selenium_Common_Locators.locateByXpath; @@ -117,7 +113,7 @@ public void proxy_clicks_on_study_consent_and_completes_form_with(String passwor CommonUtils.clickOnElement(locateByXpath("//div[@class='modal-footer']//button[@id='consentBtn']")); CucumberLogUtils.logScreenshot(); CommonUtils.sleep(500); - softAssert.assertEquals(CommonUtils.getAlertText(), "To complete enrollment, please have your 11-13 year-old minor click through the \"Study Assent\" tile. If your minor declines participation, please contact the study team."); + CommonUtils.assertEquals(CommonUtils.getAlertText(), "To complete enrollment, please have your 11-13 year-old minor click through the \"Study Assent\" tile. If your minor declines participation, please contact the study team."); CommonUtils.acceptAlert(); CommonUtils.sleep(500); CommonUtils.waitForVisibility(locateByXpath("//button[normalize-space()='OK']")); @@ -185,7 +181,7 @@ public static void participant_clicks_on_Study_Assent_and_completes_form_with(St System.out.println("* * * * * PARTICIPANT FILLING OUT ASSENT FORM * * * * *"); JavascriptUtils.scrollIntoView(locateByXpath("//input[@id='consent_read']")); WebElement readConsentCheckbox = locateByXpath("//input[@id='consent_read']"); - softAssert.assertEquals(locateByXpath("//b[contains(text(),'Yes, I have read and assent to the terms and condi')]").getText(), "Yes, I have read and assent to the terms and conditions."); + CommonUtils.assertEquals(locateByXpath("//b[contains(text(),'Yes, I have read and assent to the terms and condi')]").getText(), "Yes, I have read and assent to the terms and conditions."); CommonUtils.waitForClickability(readConsentCheckbox); CommonUtils.clickOnElement(readConsentCheckbox); CucumberLogUtils.logScreenshot(); @@ -201,6 +197,7 @@ public static void participant_clicks_on_Study_Assent_and_completes_form_with(St CommonUtils.waitForVisibility(locateByXpath("//button[normalize-space()='OK']")); CommonUtils.clickOnElement(locateByXpath("//button[normalize-space()='OK']")); CucumberLogUtils.logScreenshot(); + CommonUtils.sleep(500); } /** @@ -255,7 +252,7 @@ public static void PI_completes_consent_and_verifies_in_Native_View(String sheet } JavascriptUtils.scrollIntoView(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); CommonUtils.clickOnElement(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); - CommonUtils.hoverOverElement(locateByXpath("//td[normalize-space()='Awaiting PI Signature']")); + CommonUtils.hoverOverElement(locateByXpath("//td[normalize-space()='" + consentType + "']")); CommonUtils.clickOnElement(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsPreviewButton); CommonUtils.waitForVisibility(nativeViewCHARMSDashboardPage.rasStudyOpenRecordButton); CommonUtils.sleep(500); @@ -272,9 +269,9 @@ public static void PI_completes_consent_and_verifies_in_Native_View(String sheet JavascriptUtils.scrollIntoView(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); CommonUtils.clickOnElement(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); CucumberLogUtils.logScreenshot(); - softAssert.assertEquals(locateByXpath("//td[normalize-space()='" + consentStatus + "']").getText(), consentStatus); - softAssert.assertEquals(locateByXpath("//td[normalize-space()='" + consentType + "']").getText(), consentType); - softAssert.assertEquals(locateByXpath("//td[normalize-space()='" + responseType + "']").getText(), responseType); + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + consentStatus + "']").getText(), consentStatus); + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + consentType + "']").getText(), consentType); + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + responseType + "']").getText(), responseType); CucumberLogUtils.logScreenshot(); ServiceNow_Common_Methods.logOutOfNativeView(); } @@ -290,21 +287,14 @@ public static void text_shows_on_participant_portal_and_when_clicked_downloads_c CommonUtils.webDriver.navigate().refresh(); dynamicModuleLocator(expectedDownloadStudyText); CommonUtils.waitForVisibility(dynamicModuleLocator(expectedDownloadStudyText)); - softAssert.assertEquals(dynamicModuleLocator(expectedDownloadStudyText).getText(), expectedDownloadStudyText); + CommonUtils.assertEquals(dynamicModuleLocator(expectedDownloadStudyText).getText(), expectedDownloadStudyText); CommonUtils.waitForClickability(dynamicModuleLocator(expectedDownloadStudyText)); + String pdfUrl = dynamicModuleLocator(expectedDownloadStudyText).getAttribute("href"); dynamicModuleLocator(expectedDownloadStudyText).click(); CucumberLogUtils.logScreenshot(); - String mainWindowHandle = webDriver.getWindowHandle(); - Set windowHandles = webDriver.getWindowHandles(); - for (String handle : windowHandles) { - if (!handle.equals(mainWindowHandle)) { - webDriver.switchTo().window(handle); - break; - } - } - String pdfUrl = webDriver.getCurrentUrl(); String downloadPath = System.getProperty("user.dir") + "/src/test/resources/" + pdfName + ".pdf"; CucumberLogUtils.scenario.log("* * * * * DOWNLOADING " + pdfName.toUpperCase() + " PDF * * * * *"); + CucumberLogUtils.logScreenshot(); try { HttpURLConnection connection = (HttpURLConnection) new URL(pdfUrl).openConnection(); String cookies = String.join(";", webDriver.manage().getCookies().stream() @@ -325,7 +315,7 @@ public static void text_shows_on_participant_portal_and_when_clicked_downloads_c e.printStackTrace(); } File downloadedFile = new File(downloadPath); - softAssert.assertTrue(downloadedFile.exists()); + CommonUtils.assertTrue(downloadedFile.exists()); if (downloadedFile.delete()) { CucumberLogUtils.scenario.log("* * * * * " + pdfName.toUpperCase() + " PDF DELETED SUCCESSFULLY * * * * *"); } else { @@ -359,8 +349,70 @@ public void the_consent_is_submitted_for_and_is_verified_in_native_view(String s * @param numberOfGuardianSignaturesRequired the number of guardian signatures required for the consent * @param numberOfParentGuardianSignaturesReceived the number of parent/guardian signatures received for the consent */ - @Then("Study Team member logs in to Native View and completest consent call {string}, {string}, {string}, {string}, {string}, {string}, {string}") - public void study_team_member_logs_in_to_native_view_and_completest_consent_call(String sheetName, String consentStatus, String consentType, String responseType, String parentGuardianStatus, String numberOfGuardianSignaturesRequired, String numberOfParentGuardianSignaturesReceived) { + @Then("Study Team member logs in to Native View and completes consent call {string}, {string}, {string}, {string}, {string}, {string}, {string}") + public void study_team_member_logs_in_to_native_view_and_completes_consent_call(String sheetName, String consentStatus, String consentType, String responseType, String parentGuardianStatus, String numberOfGuardianSignaturesRequired, String numberOfParentGuardianSignaturesReceived) { nativeViewConsentAssentFlowProcess(sheetName, consentStatus, consentType, responseType, parentGuardianStatus, numberOfGuardianSignaturesRequired, numberOfParentGuardianSignaturesReceived); } -} + + /** + * Study Team member logs in to Native View and verifies that the field Assent signed is true. + * + * @param sheetName the name of the sheet for which the field Assent signed is being verified. + */ + @Then("Study Team member logs in to Native View and verifies that the field Assent signed is true {string}") + public void study_team_member_logs_in_to_native_view_and_verifies_that_the_field_assent_signed_is_true(String sheetName) { + ServiceNow_Login_Methods.nativeViewSideDoorLogin(); + navigateToParticipantRecordInNativeView(sheetName); + JavascriptUtils.scrollIntoView(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); + CommonUtils.clickOnElement(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); + CommonUtils.hoverOverElement(locateByXpath("//td[normalize-space()='Awaiting Patient Signature(s)']")); + CommonUtils.clickOnElement(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsPreviewButton); + CommonUtils.waitForVisibility(nativeViewCHARMSDashboardPage.rasStudyOpenRecordButton); + CommonUtils.sleep(500); + JavascriptUtils.scrollIntoView(nativeViewCHARMSParticipantConsentPage.rasStudyAssentSignedCheckBox); + CommonUtils.assertTrue(nativeViewCHARMSParticipantConsentPage.rasStudyHiddenAssentSignedInput.isSelected()); + CommonUtils.sleep(200); + CucumberLogUtils.logScreenshot(); + } + + /** + * Logs out the participant from the RAS portal. + */ + @Then("participant logs out of RAS portal") + public void participant_logs_out_of_ras_portal() { + ServiceNow_Common_Methods.logOutOfNativeView(); + } + + /** + * Logs out the study team member from Native View. + */ + @Then("Study Team member logs out of Native View") + public static void nativeViewStudyTeamMemberLogsOut() { + ServiceNow_Common_Methods.logOutOfNativeView(); + } + + /** + * Study Team member logs in to Native View and verifies that a new screener has been submitted. + * + * @param sheetName the name of the sheet corresponding to the new screener submitted + */ + @Then("Study Team member logs in to Native View and verifies that a new screener has been submitted {string}") + public void study_team_member_logs_in_to_native_view_and_verifies_that_a_new_screener_has_been_submitted(String sheetName) { + ServiceNow_Login_Methods.nativeViewSideDoorLogin(); + CommonUtils.sleep(4000); + CommonUtils.waitForVisibility(NativeView_SideDoor_Dashboard_Page.filterNavigatorTextBox); + NativeView_SideDoor_Dashboard_Page.filterNavigatorTextBox.sendKeys("All Participant Details"); + CucumberLogUtils.logScreenshot(); + CommonUtils.sleep(3000); + CommonUtils.clickOnElement(NativeView_SideDoor_Dashboard_Page.allParticipantDetailsLink); + CommonUtils.sleep(3000); + CommonUtils.switchToFrame(NativeView_SideDoor_Dashboard_Page.nativeViewiFrame); + CommonUtils.sleep(2000); + CucumberLogUtils.logScreenshot(); + if (sheetName.equals("screenerScenarioAdult")) { + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + ras_Screener_TestDataManager.FIRST_NAME + " " + ras_Screener_TestDataManager.LAST_NAME + "']/following-sibling::td[4]").getText(), "New Screener Received"); + } else { + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME + "']/following-sibling::td[4]").getText(), "New Screener Received"); + } + } +} \ No newline at end of file diff --git a/src/test/java/ServiceNow/CHARMS/Steps/RAS_Common_Methods.java b/src/test/java/ServiceNow/CHARMS/Steps/RAS_Common_Methods.java index 3c64a98f4..6403fb8ed 100644 --- a/src/test/java/ServiceNow/CHARMS/Steps/RAS_Common_Methods.java +++ b/src/test/java/ServiceNow/CHARMS/Steps/RAS_Common_Methods.java @@ -5,14 +5,11 @@ import ServiceNow.COVIDDash.Utils.COVIDConstants; import appsCommon.PageInitializers.PageInitializer; import appsCommon.Pages.NativeView_SideDoor_Dashboard_Page; -import appsCommon.Utils.ServiceNow_Common_Methods; import appsCommon.Utils.ServiceNow_Login_Methods; import com.nci.automation.utils.CucumberLogUtils; import com.nci.automation.web.CommonUtils; import com.nci.automation.web.JavascriptUtils; -import io.cucumber.java.en.Then; import org.openqa.selenium.Keys; -import static Hooks.Hooks.softAssert; import static appsCommon.Pages.Selenium_Common_Locators.locateByXpath; public class RAS_Common_Methods extends PageInitializer { @@ -49,10 +46,30 @@ public static void navigateToParticipantRecordInNativeView(String sheetName) { CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.WHAT_IS_THE_NAME_OF_THE_PERSON_WHO_MAY_BE_ELIGIBLE_FOR_THIS_STUDY_FIRST + " " + ras_Screener_TestDataManager.WHAT_IS_THE_NAME_OF_THE_PERSON_WHO_MAY_BE_ELIGIBLE_FOR_THIS_STUDY_LAST)); CucumberLogUtils.logScreenshot(); CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.WHAT_IS_THE_NAME_OF_THE_PERSON_WHO_MAY_BE_ELIGIBLE_FOR_THIS_STUDY_FIRST + " " + ras_Screener_TestDataManager.WHAT_IS_THE_NAME_OF_THE_PERSON_WHO_MAY_BE_ELIGIBLE_FOR_THIS_STUDY_LAST)); + } else if (sheetName.contentEquals("screenerScenarioAdult")) { + CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.FIRST_NAME + " " + ras_Screener_TestDataManager.LAST_NAME)); + CucumberLogUtils.logScreenshot(); + CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + } else if (sheetName.contentEquals("screenerScenarioAdult-NeedsLAR")) { + CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + CucumberLogUtils.logScreenshot(); + CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + } else if (sheetName.contentEquals("screenerScenarioAgeUnder7")) { + CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + CucumberLogUtils.logScreenshot(); + CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + } else if (sheetName.contentEquals("screenerScenarioAge7-10")) { + CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + CucumberLogUtils.logScreenshot(); + CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); } else if (sheetName.contentEquals("screenerScenarioAge11-13")) { CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); CucumberLogUtils.logScreenshot(); CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + } else if (sheetName.contentEquals("screenerScenarioAge14-17")) { + CommonUtils.hoverOverElement(participantDetailsPage.dynamicRecordButtonLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); + CucumberLogUtils.logScreenshot(); + CommonUtils.clickOnElement(NativeViewCHARMSDashboardPage.nativeViewnewScreenerReceivedLocator(ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + " " + ras_Screener_TestDataManager.PARTICIPANT_LAST_NAME)); } CommonUtils.sleep(1000); if (CommonUtils.isElementDisplayed(nativeViewCHARMSDashboardPage.rasStudyOpenRecordButton)) { @@ -97,7 +114,7 @@ public static void submitParticipantForReviewAndEligibility() { * @param numberOfGuardianSignaturesRequired The number of guardian signatures required for consent. * @param numberOfParentGuardianSignaturesReceived The number of parent/guardian signatures received. */ - public static void nativeViewFillParentGuardianSignatures(String parentGuardianStatus, String numberOfGuardianSignaturesRequired, String numberOfParentGuardianSignaturesReceived) { + public static void nativeViewFillParentGuardianSignatures(String responseType, String parentGuardianStatus, String numberOfGuardianSignaturesRequired, String numberOfParentGuardianSignaturesReceived) { CommonUtils.waitForVisibility(nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardianStatusDropDown); CommonUtils.waitForClickability(nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardianStatusDropDown); CommonUtils.selectDropDownValue(parentGuardianStatus, nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardianStatusDropDown); @@ -105,19 +122,20 @@ public static void nativeViewFillParentGuardianSignatures(String parentGuardianS CommonUtils.selectDropDownValue(nativeViewCHARMSParticipantConsentPage.rasStudyConsentNumberOfParentGuardianSignaturesRequiredDropDown, numberOfGuardianSignaturesRequired); CommonUtils.waitForVisibility(nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian1SignedDropDown); CommonUtils.waitForClickability(nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian1SignedDropDown); - if (numberOfParentGuardianSignaturesReceived.equals("1")) { - CommonUtils.selectDropDownValue("Yes", nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian1SignedDropDown); + if (responseType.equalsIgnoreCase("CHARMS e-consent")) { + if (numberOfGuardianSignaturesRequired.equals("1")) { + CommonUtils.selectDropDownValue("Pending", nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian1SignedDropDown); + } else if (numberOfGuardianSignaturesRequired.equals("2")) { + CommonUtils.selectDropDownValue("Pending", nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian1SignedDropDown); + CommonUtils.selectDropDownValue("Pending", nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian2SignedDropDown); + } + } else { + if (numberOfParentGuardianSignaturesReceived.equals("1")) { + CommonUtils.selectDropDownValue("Yes", nativeViewCHARMSParticipantConsentPage.rasStudyConsentParentGuardian1SignedDropDown); + } } } - /** - * Logs out the study team member from Native View. - */ - @Then("Study Team member logs out of Native View") - public static void nativeViewStudyTeamMemberLogsOut() { - ServiceNow_Common_Methods.logOutOfNativeView(); - } - /** * Performs the consent flow process for a given scenario (iMed, Participant upload to portal, Mail/Fax/Email/Other) * @@ -199,11 +217,11 @@ public static void nativeViewConsentFlowProcessScenario1Parameterized(String she JavascriptUtils.scrollIntoView(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); CommonUtils.clickOnElement(nativeViewCHARMSParticipantDetailsPage.nativeViewPatientDetailsConsentsTab); CucumberLogUtils.logScreenshot(); - softAssert.assertEquals(locateByXpath("//td[normalize-space()='" + consentStatus + "']").getText(), consentStatus); - softAssert.assertEquals(locateByXpath("//td[normalize-space()='" + consentType + "']").getText(), consentType); - softAssert.assertEquals(locateByXpath("//td[normalize-space()='" + responseType + "']").getText(), responseType); + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + consentStatus + "']").getText(), consentStatus); + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + consentType + "']").getText(), consentType); + CommonUtils.assertEquals(locateByXpath("//td[normalize-space()='" + responseType + "']").getText(), responseType); CucumberLogUtils.logScreenshot(); - nativeViewStudyTeamMemberLogsOut(); + RAS_All_Steps.nativeViewStudyTeamMemberLogsOut(); } /** @@ -254,7 +272,10 @@ public static void nativeViewConsentAssentFlowProcess(String sheetName, String c CommonUtils.waitForClickability(nativeViewCHARMSParticipantConsentPage.rasStudyConsentConsentAssentStatusDropDown); CommonUtils.selectDropDownValue(nativeViewCHARMSParticipantConsentPage.rasStudyConsentConsentAssentStatusDropDown, 4); } - nativeViewFillParentGuardianSignatures(parentGuardianStatus, numberOfGuardianSignaturesRequired, numberOfParentGuardianSignaturesReceived); + if (consentType.equalsIgnoreCase("Aged 11 - 13, signed assent required") && consentStatus.equalsIgnoreCase("CHARMS e-consent")) { + + } + nativeViewFillParentGuardianSignatures(responseType, parentGuardianStatus, numberOfGuardianSignaturesRequired, numberOfParentGuardianSignaturesReceived); CommonUtils.selectDropDownValue(nativeViewCHARMSParticipantConsentPage.rasStudyConsentFutureSpecimensAndDataDropDown, 4); CommonUtils.selectDropDownValue(nativeViewCHARMSParticipantConsentPage.rasStudyConsentFutureUseCollaboratorsDropDown, 4); CommonUtils.selectDropDownValue(nativeViewCHARMSParticipantConsentPage.rasStudyConsentFutureIdentifiableUseCollaboratorsDropDown, 4); @@ -278,4 +299,4 @@ public static void nativeViewConsentAssentFlowProcess(String sheetName, String c } CucumberLogUtils.logScreenshot(); } -} +} \ No newline at end of file diff --git a/src/test/java/ServiceNow/CHARMS/StepsImplementation/RASStudy/RAS_Screener_Submissions_StepsImpl.java b/src/test/java/ServiceNow/CHARMS/StepsImplementation/RASStudy/RAS_Screener_Submissions_StepsImpl.java index f86abc9f9..2bf34eb4e 100644 --- a/src/test/java/ServiceNow/CHARMS/StepsImplementation/RASStudy/RAS_Screener_Submissions_StepsImpl.java +++ b/src/test/java/ServiceNow/CHARMS/StepsImplementation/RASStudy/RAS_Screener_Submissions_StepsImpl.java @@ -73,6 +73,18 @@ public void rasScreenerScenarioSelector(String sheetName) { } else if (sheetName.contentEquals("screenerScenario5")) { ras_Screener_TestDataManager.dataInitializerRasScreener(sheetName); // ras_scenario_five_stepsImpl.ras_screener_submission_five(); + } else if (sheetName.contentEquals("screenerScenarioAdult")) { + ras_Screener_TestDataManager.dataInitializerRasScreener(sheetName); + rasScreenerSubmissions(sheetName); + } else if (sheetName.contentEquals("screenerScenarioAdult-NeedsLAR")) { + ras_Screener_TestDataManager.dataInitializerRasScreener(sheetName); + rasScreenerSubmissions(sheetName); + } else if (sheetName.contentEquals("screenerScenarioAgeUnder7")) { + ras_Screener_TestDataManager.dataInitializerRasScreener(sheetName); + rasScreenerSubmissions(sheetName); + } else if (sheetName.contentEquals("screenerScenarioAge7-10")) { + ras_Screener_TestDataManager.dataInitializerRasScreener(sheetName); + rasScreenerSubmissions(sheetName); } else if (sheetName.contentEquals("screenerScenarioAge11-13")) { ras_Screener_TestDataManager.dataInitializerRasScreener(sheetName); rasScreenerSubmissions(sheetName); @@ -115,7 +127,7 @@ public static void rasScreenerSubmissions(String sheetName) { /** * * * * * ARE YOU COMPLETING THIS FORM FOR SOMEONE ELSE OR FOR YOURSELF? * * * * */ - if (rasopathyQuestionnairePage.question.isDisplayed() && rasopathyQuestionnairePage.question.getText().contentEquals(ARE_YOU_COMPLETING_THIS_FORM_FOR_SOMEONE_ELSE_OR_FOR_YOURSELF)) { + if (rasopathyQuestionnairePage.question.isDisplayed() && rasopathyQuestionnairePage.question.getText().trim().contentEquals(ARE_YOU_COMPLETING_THIS_FORM_FOR_SOMEONE_ELSE_OR_FOR_YOURSELF)) { CucumberLogUtils.scenario.log("* * * * ARE YOU COMPLETING THIS FORM FOR SOMEONE ELSE OR FOR YOURSELF? * * * *"); dynamicLocator(ras_Screener_TestDataManager.ARE_YOU_COMPLETING_THIS_FORM_FOR_SOMEONE_ELSE_OR_YOURSELF).click(); CommonUtils.sleep(200); @@ -300,7 +312,7 @@ else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestion */ else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestionnairePage.question.getText().contentEquals(ARE_YOU_A_PARTICIPANT_IN_ANY_OTHER_RESEARCH_STUDY_OR_REGISTRY_GROUP_PLEASE_SPECIFY) || rasopathyQuestionnairePage.question.getText().contentEquals(formatRASQuestionForProxy(IS_PARTICIPANT_IN_ANY_OTHER_RESEARCH_STUDY_OR_REGISTRY_GROUP)))) { CucumberLogUtils.scenario.log("* * * * * ARE YOU A PARTICIPANT IN ANY OTHER RESEARCH STUDY OR REGISTRY GROUP? PLEASE SPECIFY. * * * * *"); - if (sheetName.contentEquals("screenerScenario1") || sheetName.contentEquals("screenerScenarioAge11-13") || sheetName.contentEquals("screenerScenarioAge14-17")) { + if (sheetName.contentEquals("screenerScenario1") || sheetName.contentEquals("screenerScenarioAdult") || sheetName.contentEquals("screenerScenarioAdult-NeedsLAR") || sheetName.contentEquals("screenerScenarioAgeUnder7") || sheetName.contentEquals("screenerScenarioAge7-10") || sheetName.contentEquals("screenerScenarioAge11-13") || sheetName.contentEquals("screenerScenarioAge14-17")) { dynamicLocator(ras_Screener_TestDataManager.ARE_YOU_A_PARTICIPANT_IN_OTHER_STUDY_GROUP).click(); } if (sheetName.contentEquals("screenerScenario2")) { @@ -328,7 +340,7 @@ else if (rasopathyQuestionnairePage.question.isDisplayed() && rasopathyQuestionn */ else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestionnairePage.question.getText().contentEquals(HAVE_YOU_EVER_BEEN_DIAGNOSED_WITH_THE_FOLLOWING_CONDITIONS) || rasopathyQuestionnairePage.question.getText().contentEquals(formatRASQuestionForProxy(HAS_PARTICIPANT_EVER_BEEN_DIAGNOSED_WITH_THE_FOLLOWING_CONDITIONS)))) { CucumberLogUtils.scenario.log("* * * * * HAVE YOU EVER BEEN DIAGNOSED WITH THE FOLLOWING CONDITIONS? SELECT ALL THAT APPLY. IF YOU DO NOT SEE THE EXACT CONDITION DIAGNOSED, PLEASE SELECT THE CLOSEST ANSWER. * * * * *"); - if (sheetName.contentEquals("screenerScenario1") || sheetName.contentEquals("screenerScenarioAge11-13") || sheetName.contentEquals("screenerScenarioAge14-17")) { + if (sheetName.contentEquals("screenerScenario1") || sheetName.contentEquals("screenerScenarioAdult") || sheetName.contentEquals("screenerScenarioAdult-NeedsLAR") || sheetName.contentEquals("screenerScenarioAgeUnder7") || sheetName.contentEquals("screenerScenarioAge7-10") || sheetName.contentEquals("screenerScenarioAge11-13") || sheetName.contentEquals("screenerScenarioAge14-17")) { dynamicLocator(ras_Screener_TestDataManager.HAVE_YOU_BEEN_DIAGNOSED_WITH_FOLLOWING_CONDITIONS).click(); } if (sheetName.contentEquals("screenerScenario2")) { @@ -377,7 +389,7 @@ else if (rasopathyQuestionnairePage.question.isDisplayed() && rasopathyQuestionn /** * * * * * HAVE ANY OF YOUR BIOLOGICAL RELATIVES BEEN DIAGNOSED WITH A RASOPATHY? * * * * */ - else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestionnairePage.question.getText().contentEquals(HAVE_ANY_OF_YOUR_BIOLOGICAL_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY) || (rasopathyQuestionnairePage.question.getText().trim().contentEquals(formatRASQuestionForProxy(HAVE_ANY_OF_PARTICIPANTS_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY))))) { + else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestionnairePage.question.getText().contentEquals(HAVE_ANY_OF_YOUR_BIOLOGICAL_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY) || rasopathyQuestionnairePage.question.getText().trim().contentEquals(HAVE_ANY_OF_PARTICIPANTS_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY.replace("%s's", ras_Screener_TestDataManager.PARTICIPANT_FIRST_NAME + "'s")))) { CucumberLogUtils.scenario.log("* * * * * HAVE ANY OF YOUR BIOLOGICAL RELATIVES BEEN DIAGNOSED WITH A RASOPATHY? * * * * *"); dynamicLocator(ras_Screener_TestDataManager.HAVE_ANY_OF_YOUR_BIOLOGICAL_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY).click(); CucumberLogUtils.logScreenshot(); @@ -387,7 +399,7 @@ else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestion * * * * * * HAVE YOU EVER HAD GENETIC TESTING? * * * * */ - else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestionnairePage.question.getText().contentEquals(HAVE_YOU_EVER_HAD_GENETIC_TESTING) || rasopathyQuestionnairePage.question.getText().trim().contentEquals(formatRASQuestionForProxy(formatRASQuestionForProxy(HAS_PARTICIPANT_EVER_HAD_GENETIC_TESTING))))) { + else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestionnairePage.question.getText().trim().contentEquals(HAVE_YOU_EVER_HAD_GENETIC_TESTING) || rasopathyQuestionnairePage.question.getText().trim().contentEquals(formatRASQuestionForProxy(HAS_PARTICIPANT_EVER_HAD_GENETIC_TESTING)))) { CucumberLogUtils.scenario.log("* * * * * HAVE YOU EVER HAD GENETIC TESTING? * * * * *"); dynamicLocator(ras_Screener_TestDataManager.HAVE_YOU_EVER_HAD_GENETIC_TESTING).click(); CucumberLogUtils.logScreenshot(); @@ -426,7 +438,7 @@ else if (rasopathyQuestionnairePage.question.isDisplayed() && (rasopathyQuestion */ else if (rasopathyQuestionnairePage.question.isDisplayed() && rasopathyQuestionnairePage.question.getText().contentEquals(WHAT_ARE_THE_MAIN_REASONS_FOR_PARTICIPATING_IN_THIS_STUDY)) { CucumberLogUtils.scenario.log("* * * * * WHAT ARE THE MAIN REASONS FOR PARTICIPATING IN THIS STUDY? SELECT ALL THAT APPLY. PLEASE ELABORATE ON THE REASON IN THE CORRESPONDING TEXTBOX. * * * * *"); - if (sheetName.contentEquals("screenerScenario1") || sheetName.contentEquals("screenerScenarioAge11-13")|| sheetName.contentEquals("screenerScenarioAge14-17")) { + if (sheetName.contentEquals("screenerScenario1") || sheetName.contentEquals("screenerScenarioAdult") || sheetName.contentEquals("screenerScenarioAdult-NeedsLAR") || sheetName.contentEquals("screenerScenarioAgeUnder7") || sheetName.contentEquals("screenerScenarioAge7-10") || sheetName.contentEquals("screenerScenarioAge11-13") || sheetName.contentEquals("screenerScenarioAge14-17")) { CommonUtils.scrollIntoView(dynamicLocator(ras_Screener_TestDataManager.WHAT_ARE_MAIN_REASONS_FOR_PARTICIPATING_IN_STUDY)); dynamicLocator(ras_Screener_TestDataManager.WHAT_ARE_MAIN_REASONS_FOR_PARTICIPATING_IN_STUDY).click(); rasopathyQuestionnairePage.dynamicLocatorForMainReasonForParticipatingInStudy(ras_Screener_TestDataManager.WHAT_ARE_MAIN_REASONS_FOR_PARTICIPATING_IN_STUDY).sendKeys(ras_Screener_TestDataManager.WHAT_ARE_MAIN_REASONS_FOR_PARTICIPATING_IN_STUDY_OTHER_REASON); @@ -1600,6 +1612,7 @@ public void rasScreenerSurveyScenario1PartTwo() { /** * Performs the third part of the RAS Screener Survey Scenario 1. * This method clicks on various options in the survey, logs screenshots, and verifies text elements. + * * @throws NoSuchElementException if any element specified by the dynamic locators is not found */ public void rasScreenerSurveyScenario1PartThree() { @@ -1635,6 +1648,7 @@ public void rasScreenerSurveyScenario1PartThree() { /** * This method performs a series of actions to complete the fourth part of the RAS Screener Survey Scenario 1. * It clicks on various options in the survey, logs screenshots, and verifies text elements. + * * @throws NoSuchElementException if any element specified by the dynamic locators is not found */ public void rasScreenerSurveyScenario1PartFour() { @@ -1685,6 +1699,7 @@ public void rasScreenerSurveyScenario1PartFour() { /** * This method performs the fifth part of the RAS Screener Survey Scenario 1. * It clicks on various options in the survey, logs screenshots, and verifies text elements. + * * @throws NoSuchElementException if any element specified by the dynamic locators is not found */ public void rasScreenerSurveyScenario1PartFive() { @@ -1718,7 +1733,7 @@ public void rasScreenerSurveyScenario1PartFive() { /** * This method represents the sixth part of the RAS screener survey scenario 1. * It handles the interaction with the survey page elements to answer questions about breathing, lung health, and oral health. - * + *

* The method performs the following actions: * 1. Waits for the visibility of the top text element with a specific dynamic locator. * 2. Verifies the next set of questions by comparing the expected text with the actual text on the survey page. @@ -1886,7 +1901,7 @@ public void rasScreenerSurveyScenario1PartSix() { /** * This method represents the seventh part of the RAS screener survey scenario 1. * It handles the interaction with the survey page elements to answer questions about fluid balance, lymphatic system issues, and kidneys. - * + *

* The method performs the following actions: * 1. Waits for the visibility of the top text element with a specific dynamic locator. * 2. Verifies the next set of questions about fluid balance by comparing the expected text with the actual text on the survey page. @@ -1897,7 +1912,7 @@ public void rasScreenerSurveyScenario1PartSix() { * 7. Logs a screenshot of the survey page. * * @throws NoSuchElementException if any element specified by the dynamic locators is not found - * @throws TimeoutException if the visibility of an element is not achieved within a certain timeout period + * @throws TimeoutException if the visibility of an element is not achieved within a certain timeout period */ public void rasScreenerSurveyScenario1PartSeven() { CommonUtils.waitForVisibility(myRASSurveyPage.dynamicTopText(306)); @@ -1995,7 +2010,7 @@ public void rasScreenerSurveyScenario1PartEight() { /** * This method is used to complete the ninth part of the RAS Screener Survey. - * + *

* The method performs the following actions: * 1. Clicks on the Survey Save and Next button. * 2. Waits for the visibility of a specific dynamic top text element. @@ -2005,7 +2020,7 @@ public void rasScreenerSurveyScenario1PartEight() { * 6. Waits for the visibility of a specific dynamic top text element. * 7. Performs an assertion to verify the displayed text on the page. * 8. Logs a screenshot using CucumberLogUtils. - * + *

* No parameters are accepted and no value is returned. */ public void rasScreenerSurveyScenario1PartNine() { diff --git a/src/test/java/ServiceNow/CHARMS/studyQuestions/RAS_Screener_Questions_Proxy.java b/src/test/java/ServiceNow/CHARMS/studyQuestions/RAS_Screener_Questions_Proxy.java index b71094697..1a8e25002 100644 --- a/src/test/java/ServiceNow/CHARMS/studyQuestions/RAS_Screener_Questions_Proxy.java +++ b/src/test/java/ServiceNow/CHARMS/studyQuestions/RAS_Screener_Questions_Proxy.java @@ -20,7 +20,7 @@ public class RAS_Screener_Questions_Proxy { public static final String HAS_PARTICIPANT_EVER_BEEN_DIAGNOSED_WITH_THE_FOLLOWING_CONDITIONS = "Has %s ever been diagnosed with the following conditions? Select all that apply. If you do not see the exact condition diagnosed, please select the closest answer."; public static final String HAS_PARTICIPANT_EVER_BEEN_DIAGNOSED_WITH_CANCER = "Has %s ever been diagnosed with cancer?"; public static final String HAS_PARTICIPANT_BEEN_DIAGNOSED_WITH_A_RASOPATHY = "Has %s been diagnosed with a RASopathy such as Noonan syndrome, Noonan syndrome with multiple lentigines, Costello syndrome, cardiofaciocutaneous syndrome, Legius syndrome, capillary arteriovenous malformation syndrome, hereditary gingival fibromatosis or SYNGAP1 syndrome?"; - public static final String HAVE_ANY_OF_PARTICIPANTS_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY = "Have any of CHARMS RAS Minor's biological relatives been diagnosed with a RASopathy?"; + public static final String HAVE_ANY_OF_PARTICIPANTS_RELATIVES_BEEN_DIAGNOSED_WITH_A_RASOPATHY = "Have any of %s's biological relatives been diagnosed with a RASopathy?"; public static final String HAS_PARTICIPANT_EVER_HAD_GENETIC_TESTING = "Has %s ever had genetic testing?"; public static final String HOW_DID_PARTICIPANT_HEAR_ABOUT_THIS_STUDY = "How did you hear about this study? If a specific health care provider referred %s to this study, please include their name in the corresponding text box."; public static final String HAS_PARTICIPANT_OR_OTHER_FAMILY_MEMBERS_EVER_PARTICIPATED_IN_ANOTHER_STUDY_ON_RASOPATHY_AT_ANOTHER_MEDICAL_INSTITUTION_UNIVERSITY_GOVERNMENT_AGENCY_OR_OTHER_SITE = "Has %s or other family members ever participated in another study on RASopathy at another medical institution, university, government agency or other site?";