diff --git a/performance-tests/STS/consent-journey.jmx b/performance-tests/STS/consent-journey.jmx index 09ae2c1e1b4..2e96f43b44e 100644 --- a/performance-tests/STS/consent-journey.jmx +++ b/performance-tests/STS/consent-journey.jmx @@ -5,8 +5,6 @@ - false - false @@ -51,13 +49,13 @@ Loops - ${__P(Loops, -1)} + ${__P(Loops, 20)} = How many loops total (must be multiple times higher than vaccinationloop) Threads - ${__P(Threads, 5)} + ${__P(Threads, 140)} = @@ -76,13 +74,14 @@ ${__P(User, nurse.perftest@example.com)} = - - URN - ${__P(URN, 104698)} + + ConsentThreads + 5 = - User ${__P(User, nurse.perftest@example.com)} + User ${__P(User, nurse.perftest@example.com)} +URN ${__P(URN, 137390)} @@ -118,7 +117,7 @@ false - + Because I'm no longer using a data file, this set up thread group can be here purely to set up sessions and data 1 1 @@ -130,7 +129,7 @@ - + Login, get all sessions for a particular URN, set them all in progress false @@ -399,7 +398,7 @@ for(loop=1;loop<=vaccineCount;loop++){ 3 - + groovy @@ -434,7 +433,7 @@ log.info(vars.get("ConsentSession")); - + sessions true GET @@ -445,7 +444,7 @@ log.info(vars.get("ConsentSession")); - + true true 6 @@ -497,11 +496,11 @@ log.info(vars.get("ConsentSession")); - + true true 6 - draft-session/dates + sessions/${ConsentSession}/dates true GET true @@ -511,7 +510,7 @@ log.info(vars.get("ConsentSession")); - + sec-ch-ua @@ -528,17 +527,17 @@ log.info(vars.get("ConsentSession")); - + false Authenticity_Token - "\/draft-session\/dates" .*? name="authenticity_token" value="(.*?)" + name="authenticity_token" value="(.*?)" $1$ Authenticity_Token_NotFound false - 1 + 2 - + <title>When will sessions be held? – Manage vaccinations in schools</title> @@ -548,18 +547,18 @@ log.info(vars.get("ConsentSession")); 16 - + false sessionDatesArray - session_date_(.\d?)\]\[value\(3i\)\].*?value="(.*?)".*?value="(.*?)".*?value="(.*?)" - draft_session%5Bsession_date_$1$%5D%5Bvalue%283i%29%5D=$2$&draft_session%5Bsession_date_$1$%5D%5Bvalue%282i%29%5D=$3$&draft_session%5Bsession_date_$1$%5D%5Bvalue%281i%29%5D=$4$& + \[(.d?)\]\[value\(3i\)].*?value="(.*?)".*?value\(2i\)].*?value="(.*?)".*?value\(1i\)].*?value="(.*?)">[\s\S]*?type="hidden" value="(.*?)" + session%5Bsession_dates_attributes%5D%5B$1$%5D%5Bvalue%283i%29%5D=$2$&session%5Bsession_dates_attributes%5D%5B$1$%5D%5Bvalue%282i%29%5D=$3$&session%5Bsession_dates_attributes%5D%5B$1$%5D%5Bvalue%281i%29%5D=$4$&session%5Bsession_dates_attributes%5D%5B$1$%5D%5Bid%5D=$5$& true - -1 + 1 This regex gets all the dates that are unused and therefore have day, month, year and ID - + false useddatesArray cannot be changed[\s\S]*?value=\"(\d*)"[\s\S]*?attributes\]\[(\d*)\] @@ -571,11 +570,11 @@ log.info(vars.get("ConsentSession")); - + true true 6 - draft-session/dates + sessions/${ConsentSession}/dates true POST true @@ -584,32 +583,21 @@ log.info(vars.get("ConsentSession")); false - _method=put&authenticity_token=${Authenticity_Token}&${sessionDatesArray}draft_session%5B_add_another%5D=true + _method=put&authenticity_token=${Authenticity_Token}&${sessionDatesArray}add_another= = - + groovy true - numberOfDates=vars.get("sessionDatesArray_matchNr").toInteger() - -fullArray="" -for(loop=1;loop<=numberOfDates;loop++){ - fullArray=fullArray & vars.get("sessionDatesArray_" & loop.toString()) + if(vars.get("sessionDatesArray")==""){ + vars.put("sessionDatesArray",vars.get("useddatesArray")) } - -vars.put("sessionDatesArray",fullArray) - -//Will need to fix this -//if(vars.get("sessionDatesArray")==""){ -// vars.put("sessionDatesArray",vars.get("useddatesArray")) -//} - @@ -634,7 +622,7 @@ vars.put("sessionDatesArray",fullArray) - + <title>When will sessions be held? – Manage vaccinations in schools</title> @@ -644,7 +632,7 @@ vars.put("sessionDatesArray",fullArray) 16 - + false NewSessionNum session_dates_attributes]\[(\d*)\]\[value\(3i\)\]" type="text" inputmode="numeric"> @@ -654,29 +642,13 @@ vars.put("sessionDatesArray",fullArray) 1 - - false - Authenticity_Token - "\/draft-session\/dates" .*? name="authenticity_token" value="(.*?)" - $1$ - Authenticity_Token_NotFound - false - 1 - - - - false - true - false - - - + This adds tomorrow as a session date, if it already exists then it will intentionally fail true true 6 - draft-session/dates + sessions/${ConsentSession}/dates true POST true @@ -692,7 +664,7 @@ vars.put("sessionDatesArray",fullArray) - + groovy @@ -708,44 +680,31 @@ highestunused=0; highestused=0; postbody="_method=put&"; postbody=postbody + "authenticity_token=" + vars.get("Authenticity_Token") + "&"; -postbody=postbody + vars.get("sessionDatesArray"); - +postbody=postbody + vars.get("sessionDatesArray"); //might need multiples here def today = new java.util.Date(); day=today.next().format("dd"); month=today.next().format("MM"); year=today.next().format("yyyy"); -// sessionDatesArray_matchNr contains the number of existing dates, however as it's zero base it means it can also be used for the next in the array - -postbody=postbody + "draft_session%5Bsession_date_" + vars.get("sessionDatesArray_matchNr") + "%5D%5Bvalue%283i%29%5D=" + day + "&"; -postbody=postbody + "draft_session%5Bsession_date_" + vars.get("sessionDatesArray_matchNr") + "%5D%5Bvalue%282i%29%5D=" + month + "&"; -postbody=postbody + "draft_session%5Bsession_date_" + vars.get("sessionDatesArray_matchNr") + "%5D%5Bvalue%281i%29%5D=" + year; +postbody=postbody + "session%5Bsession_dates_attributes%5D%5B" + vars.get("NewSessionNum") + "%5D%5Bvalue%283i%29%5D=" + day + "&"; +postbody=postbody + "session%5Bsession_dates_attributes%5D%5B" + vars.get("NewSessionNum") + "%5D%5Bvalue%282i%29%5D=" + month + "&"; +postbody=postbody + "session%5Bsession_dates_attributes%5D%5B" + vars.get("NewSessionNum") + "%5D%5Bvalue%281i%29%5D=" + year; vars.put("postbody",postbody); - + false Authenticity_Token - "\/draft-session\/confirm" .*? name="authenticity_token" value="(.*?)" + name="authenticity_token" value="(.*?)" $1$ Authenticity_Token_NotFound false 1 - - false - DateAlreadyUsed - Error: </span>(.*?)</p> - $1$ - noError - false - 1 - - @@ -779,70 +738,11 @@ vars.put("postbody",postbody); - - ${__jexl3("${DateAlreadyUsed}" == "noError")} - false - true - - - - true - true - 6 - draft-session/confirm - true - POST - true - true - - - - false - _method=put&authenticity_token=${Authenticity_Token} - = - - - - - - - - - sec-ch-ua - "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" - - - sec-ch-ua-mobile - ?0 - - - sec-ch-ua-platform - "macOS" - - - Content-Type - application/x-www-form-urlencoded - - - - - - - Overview - - - Assertion.response_data - false - 16 - - - - - + false - + sessions true GET @@ -853,7 +753,7 @@ vars.put("postbody",postbody); - + true true 6 @@ -867,7 +767,7 @@ vars.put("postbody",postbody); - + sec-ch-ua @@ -915,7 +815,7 @@ vars.put("postbody",postbody); - + sessions/${ConsentSession}/make-in-progress true POST @@ -964,7 +864,7 @@ vars.put("postbody",postbody); - + false @@ -1014,7 +914,7 @@ vars.put("postbody",postbody); - + groovy @@ -1073,7 +973,7 @@ log.info("For thread " + Threadnum.toString() + " session ID is & - + groovy @@ -1222,17 +1122,1560 @@ log.info("Total Consents found: " + consentCount.toString()); localhost 9191 http - /sts/STATUS + /sts/STATUS + true + GET + true + false + + + + + + + true + + + prev.setIgnore(); + groovy + + + + + + + Test Plan + Test Plan + Get patients for processing + + + + + + ${ConsentThreads} + ${RampUp} + ${Duration} + true + true + continue + + ${Loops} + false + + + + + groovy + + + true + //Move the transactions count properties to variables + +vars.put("VaccineCount_flu",props.get("VaccineCount_flu")) +vars.put("VaccineCount_hpv",props.get("VaccineCount_hpv")) +vars.put("VaccineCount_menacwy",props.get("VaccineCount_menacwy")) +vars.get("VaccineCount_td_ipv",props.get("VaccineCount_td_ipv")) + + + + + While there is only one patient list for consents, I'm applying consent for all programmes and ignoring the programme value in the STS file + localhost + 9191 + http + /sts/READ?FILENAME=consents.txt&READ_MODE=RANDOM&KEEP=FALSE + true + GET + true + false + + + + + + + false + CHILD_FIRST_NAME + <body>(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + CHILD_LAST_NAME + <body>.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + CHILD_DATE_OF_BIRTH + <body>.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + CHILD_ADDRESS_LINE_1 + <body>.*?,.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + CHILD_POSTCODE + <body>.*?,.*?,.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + PARENT_1_NAME + <body>.*?,.*?,.*?,.*?,.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + PARENT_1_RELATIONSHIP + <body>.*?,.*?,.*?,.*?,.*?,.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + PARENT_1_EMAIL + <body>.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + Programme + <body>.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,(.*?), + $1$ + NoMoreConsents + false + 1 + + + + false + SessionID + <body>.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,(.*?)< + $1$ + NoMoreConsents + false + 1 + + + + false + Result + <html><title>(.*?)</title> + $1$ + NoOutcome + false + 1 + + + + true + + + prev.setIgnore(); + groovy + + + + + ${__jexl3("${Result}" == "KO")} + false + true + + + + 0 + 0 + 0 + + + + true + + + log.error("Fuzzy search failed") + groovy + + + + + + + Test Plan + Test Plan + Consents + + + + + + 9191 + true + C:\apache-jmeter-5.6.3\bin + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + localhost + 9191 + http + /sts/RESET?FILENAME=consents.txt + true + GET + true + false + + + + + + + true + + + prev.setIgnore(); + groovy + + + + + localhost + 9191 + http + /sts/INITFILE?FILENAME=consents.txt + true + GET + true + false + + + + + + + true + + + prev.setIgnore(); + groovy + + + + + + + + groovy + + + true + //Nurse journey is 2:23, which is 25 per hour per nurse +// Duration +// Threads This is nurse threads not consent threads. Consent will always run at 5 threads +// + 50% + +numberOfPatients = (vars.get("Duration").toInteger() / 3600 * 25 * vars.get("Threads").toInteger() * 1.5).toInteger() +//numberOfPatients = numberOfPatients * 5 + +props.put("VaccineCount_flu",numberOfPatients.toString()) +props.put("VaccineCount_hpv",numberOfPatients.toString()) +props.put("VaccineCount_menacwy",numberOfPatients.toString()) +props.put("VaccineCount_td_ipv",numberOfPatients.toString()) + +log.info("number of patients per Vaccine required: " + props.get("VaccineCount_flu")) + + + + + localhost + 9191 + http + /sts/RESET?FILENAME=consents.txt + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + + localhost + 9191 + http + /sts/INITFILE?FILENAME=consents.txt + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + + start + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + + users/sign-in + true + GET + true + false + + + + + + + false + Authenticity_Token + <input type="hidden" name="authenticity_token" value=" + " autocomplete="off" /> + Authenticity_Token_NotFound_01 + false + 1 + + + + groovy + + + true + prev.setIgnore() + + + + + users/sign-in + true + POST + true + false + + + + true + user[email] + ${User} + = + true + + + true + user[password] + ${User} + = + true + + + true + authenticity_token + ${Authenticity_Token} + = + true + + + + + + + + + Content-Type + application/x-www-form-urlencoded + + + + + + false + Authenticity_Token + <form action="/users/teams" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value=" + " autocomplete="off" /> + Authenticity_Token_NotFound_02 + false + 1 + + + + false + organisationId + class="nhsuk-radios__input" type="radio" value="(.*?)" + $1$ + orgNotFound + false + + + + + groovy + + + true + prev.setIgnore() + + + + + sessions + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + false + SessionID + sessions\/(.*?)"[\s\S]{1,500}>\d*? children[\s\S]{1,400}nhsuk-tag nhsuk-tag--white">(.*?)< + $1$ + SessionIDNotFound + false + -1 + Change the regex to only pick up sessions with children + + + + false + SessionVaccine + sessions\/(.*?)"[\s\S]{1,500}>\d*? children[\s\S]{1,400}nhsuk-tag nhsuk-tag--white">(.*?)< + $2$ + SessionVaccineNotFound + false + -1 + + + + + true + true + 200 + OK + Dummy Sampler used to simulate requests and responses +without actual network activity. This helps debugging tests. + Dummy Sampler used to simulate requests and responses +without actual network activity. This helps debugging tests. + 10000 + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + groovy + + + true + log.info("Got to delay") + + + + + SessionID + CurrentSessionID + true + Go through each session, but only set sessions active and download offline files if the vaccination count is still positive + + + + groovy + + + true + log.info("Currently working with " + vars.get("CurrentSessionID")) + + + + true + true + 6 + sessions/${CurrentSessionID} + true + GET + true + false + + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + + + + false + Authenticity_Token + name="authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + Manage vaccinations in schools</title> + + + Assertion.response_data + false + 16 + + + + false + Programme + class="nhsuk-caption-l.*?\n *([a-zA-Z]*) + $1$ + ProgrammeNotFound + false + 1 + Only three different options, but assume any MenACWY also include a Td/IPV + +JSR223 Sampler: Flu +JSR223 Sampler: MenACWY +JSR223 Sampler: HPV + + + + + false + ConsentCount + no_response">(\d*?) + $1$ + 0 + false + 1 + + + + false + noSessions + <strong class="nhsuk-tag nhsuk-tag--purple">(.*?)</strong></p> + $1$ + 0 + false + 1 + + + + groovy + + + true + prev.setIgnore() + + + + + true + true + false + + + + groovy + + + true + //log.info(vars.get("Programme") + ":" + vars.get("ConsentCount")) + +//First check the sessions has sufficient records that have no consent +vars.put("ViableSession","False") +if(vars.get("ConsentCount").toInteger()>99){ + log.info(vars.get("CurrentSessionID") + " has " + vars.get("ConsentCount") + " consents for " + vars.get("Programme").toLowerCase()) + vars.put("ViableSession","True") +} + +//Also check if there are no sessions scheduled (and therefore no consents will have been sent), and if so also add to ViableSession +if(vars.get("noSessions")=="No sessions scheduled"){ + log.info(vars.get("CurrentSessionID") + " has no sessions scheduled for " + vars.get("Programme").toLowerCase()) + vars.put("ViableSession","True") +} + +//Now disable the session if the programme count has dropped below zero +if(props.get("VaccineCount_" + vars.get("Programme").toLowerCase()).toInteger()<=0){ + log.info(vars.get("CurrentSessionID") + " not included, " + vars.get("Programme").toLowerCase() + " already has sufficient records for the test") + vars.put("ViableSession","False") +} + + + + groovy + + + true + prev.setIgnore() + + + + + ${__jexl3("${ViableSession}"=="True")} + false + true + + + + + Test Plan + Test Plan + Set session date and in progress + + + + + + Test Plan + Test Plan + Get offline file and load into STS + + + + + + + + + + true + true + 6 + sessions/${CurrentSessionID}/edit + true + GET + true + false + + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + + + + false + Authenticity_Token + name="authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + <title>Edit session – Manage vaccinations in schools</title> + + + Assertion.response_data + false + 16 + + + + + true + true + 6 + draft-session/dates + true + GET + true + false + + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + + + + false + Authenticity_Token + "\/draft-session\/dates" .*? name="authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + <title>When will sessions be held? – Manage vaccinations in schools</title> + + + Assertion.response_data + false + 16 + + + + false + sessionDatesArray + session_date_(.\d?)\]\[value\(3i\)\].*?value="(.*?)".*?value="(.*?)".*?value="(.*?)" + draft_session%5Bsession_date_$1$%5D%5Bvalue%283i%29%5D=$2$&draft_session%5Bsession_date_$1$%5D%5Bvalue%282i%29%5D=$3$&draft_session%5Bsession_date_$1$%5D%5Bvalue%281i%29%5D=$4$& + + true + -1 + This regex gets all the dates that are unused and therefore have day, month, year and ID + + + + false + useddatesArray + cannot be changed[\s\S]*?value=\"(\d*)"[\s\S]*?attributes\]\[(\d*)\] + session%5Bsession_dates_attributes%5D%5B$2$%5D%5Bid%5D=$1$& + nodates + false + 1 + This regex gets all the dates that are used and only have an ID + + + + + true + true + 6 + draft-session/dates + true + POST + true + true + + + + false + _method=put&authenticity_token=${Authenticity_Token}&${sessionDatesArray}draft_session%5B_add_another%5D=true + = + + + + + + + groovy + + + true + numberOfDates=vars.get("sessionDatesArray_matchNr").toInteger() + +fullArray="" +for(loop=1;loop<=numberOfDates;loop++){ + fullArray=fullArray + vars.get("sessionDatesArray_" + loop.toString()) +} + +vars.put("sessionDatesArray",fullArray) + +//Will need to fix this +//if(vars.get("sessionDatesArray")==""){ +// vars.put("sessionDatesArray",vars.get("useddatesArray")) +//} + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + Content-Type + application/x-www-form-urlencoded + + + + + + + <title>When will sessions be held? – Manage vaccinations in schools</title> + + + Assertion.response_data + false + 16 + + + + false + NewSessionNum + session_dates_attributes]\[(\d*)\]\[value\(3i\)\]" type="text" inputmode="numeric"> + $1$ + Somethinghasgonewrong + false + 1 + + + + false + Authenticity_Token + "\/draft-session\/dates" .*? name="authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + This adds tomorrow as a session date, if it already exists then it will intentionally fail + true + true + 6 + draft-session/dates + true + POST + true + true + + + + false + ${postbody} + = + + + + + + + groovy + + + true + //Create the POST request using existing data and arrays + +//Only needs 'highest+1' to create a new date + +//_method=put&authenticity_token=ann4JQkHqpGVgmqKBlT-mHVoGiiKR7Tx7yL8fEd15WpNgEZsL3PTnbelTxYr-nsWa22oL2xPbHKRQvAX2Wtp_Q&session%5Bsession_dates_attributes%5D%5B19%5D%5Bvalue%283i%29%5D=19&session%5Bsession_dates_attributes%5D%5B19%5D%5Bvalue%282i%29%5D=5&session%5Bsession_dates_attributes%5D%5B19%5D%5Bvalue%281i%29%5D=2025 + +highestunused=0; +highestused=0; +postbody="_method=put&"; +postbody=postbody + "authenticity_token=" + vars.get("Authenticity_Token") + "&"; +postbody=postbody + vars.get("sessionDatesArray"); + + +def today = new java.util.Date(); +day=today.next().format("dd"); +month=today.next().format("MM"); +year=today.next().format("yyyy"); + +// sessionDatesArray_matchNr contains the number of existing dates, however as it's zero base it means it can also be used for the next in the array + +postbody=postbody + "draft_session%5Bsession_date_" + vars.get("sessionDatesArray_matchNr") + "%5D%5Bvalue%283i%29%5D=" + day + "&"; +postbody=postbody + "draft_session%5Bsession_date_" + vars.get("sessionDatesArray_matchNr") + "%5D%5Bvalue%282i%29%5D=" + month + "&"; +postbody=postbody + "draft_session%5Bsession_date_" + vars.get("sessionDatesArray_matchNr") + "%5D%5Bvalue%281i%29%5D=" + year; + +vars.put("postbody",postbody); + + + + + false + ImportedRecords + <title>(.*?) historical + $1$ + NoImportedRecords + false + 1 + + + + false + Authenticity_Token + "\/draft-session\/confirm" .*? name="authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + false + Dates_Check_Authenticity_Token + "\/draft-session\/dates-check" .*? name="authenticity_token" value="(.*?)" + $1$ + Dates_Check_Authenticity_Token_NotFound + false + 1 + + + + false + DateAlreadyUsed + Error: </span>(.*?)</p> + $1$ + noError + false + 1 + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + Content-Type + application/x-www-form-urlencoded + + + + + + + <title>Edit session – Manage vaccinations in schools</title> + Enter a different date to the other session dates + Have you imported historical vaccination records + + + Assertion.response_data + true + 48 + + + + + ${__jexl3("${DateAlreadyUsed}" == "noError")} + false + true + + + + ${__jexl3("${ImportedRecords}" == "Have you imported")} + false + true + + + + true + true + 6 + /draft-session/dates-check + true + POST + true + true + + + + false + _method=put&authenticity_token=${Dates_Check_Authenticity_Token} + = + + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + Content-Type + application/x-www-form-urlencoded + + + + + + + <title>Edit session – Manage vaccinations in schools</title> + + + Assertion.response_data + false + 16 + + + + false + Authenticity_Token + "\/draft-session\/confirm" .*? name="authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + + true + true + 6 + draft-session/confirm + true + POST + true + true + + + + false + _method=put&authenticity_token=${Authenticity_Token} + = + + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + Content-Type + application/x-www-form-urlencoded + + + + + + + Overview + + + Assertion.response_data + false + 16 + + + + + + false + + + + sessions + true + GET + true + false + + + + + + + true + true + 6 + sessions/${CurrentSessionID} + true + GET + true + false + + + + + + + + + sec-ch-ua + "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133" + + + sec-ch-ua-mobile + ?0 + + + sec-ch-ua-platform + "macOS" + + + + + + false + Authenticity_Token + Set session in progress for today</button><input type="hidden" name="authenticity_token" value="(.*?)" autocomplete="off" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + Manage vaccinations in schools + + + Assertion.response_data + false + 16 + + + + false + Vaccinations + <p class="nhsuk-caption-l nhsuk-u-margin-bottom-4">\n(.*?)\n + $1$ + Vaccinations_notfound + false + 1 + + + + + sessions/${CurrentSessionID}/make-in-progress + true + POST + true + false + + + + true + _method + put + = + true + + + true + authenticity_token + ${Authenticity_Token} + = + true + + + + + + + + + Content-Type + application/x-www-form-urlencoded + + + + + + + <p class="nhsuk-notification-banner__heading">Session is now in progress</p> + + + Assertion.response_data + false + 16 + + + + + + + + + groovy + + + true + //Get the current thread number +Threadnum=ctx.getThreadNum().toInteger() +Threadnum=0 // Use to override a vaccine if needed + +//Divide threads equally between the three sessions, each nurse stays in session +//This means that each patient only attends one session, and the test data gets used up three times faster + +switch(Threadnum%3){ + case 0: + vars.put("SessionId",props.get("ConsentSession_Flu")); + break; + case 1: + vars.put("SessionId",props.get("ConsentSession_HPV")); + break; + case 2: + vars.put("SessionId",props.get("ConsentSession_MenACWY")); + break; + default: + log.info("loop failed, value is " + loop.toString()); +} +log.info("For thread " + Threadnum.toString() + " session ID is " + vars.get("SessionId")); + + + + true + + + prev.setIgnore(); + groovy + + + + + sessions/${CurrentSessionID} + true + GET + true + false + + + + + + + sessions/${CurrentSessionID}.xlsx + true + GET + true + false + + + + + + + groovy + + + true + import org.apache.jmeter.threads.JMeterVariables; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.commons.lang.RandomStringUtils; +import java.text.SimpleDateFormat; + +InputStream in = new ByteArrayInputStream(prev.getResponseData()); +Workbook wb = new XSSFWorkbook(in); +in.close(); +Sheet sheet1 = wb.getSheet("Vaccinations"); + +int consentCount=0; +for(Row row : sheet1){ + String randomString = RandomStringUtils.random(9, true, false).toLowerCase(); + String randomInt = RandomStringUtils.random(3, false, true) + String PERSON_FORENAME = row.getCell(0).getStringCellValue(); + String PERSON_SURNAME = row.getCell(1).getStringCellValue(); + Boolean ready_for_consent = false; + Boolean ready_for_vaccination = false; + + if(PERSON_FORENAME!="PERSON_FORENAME"){//Not interested in title line so exclude it + String PERSON_DOB = row.getCell(6).getDateCellValue().format("yyyy-MM-dd"); + String PERSON_ADDRESS_LINE_1 = row.getCell(10).getStringCellValue(); + String PERSON_POSTCODE = row.getCell(11).getStringCellValue(); + + String CONSENT_DETAILS = row.getCell(14).getStringCellValue(); + String VACCINATED = row.getCell(24).getStringCellValue(); + String PROGRAMME = row.getCell(27).getStringCellValue(); + + String PARENT_1_NAME = randomString + " " + PERSON_SURNAME; + String PARENT_1_RELATIONSHIP = "father"; + String PARENT_1_EMAIL = randomString + "." + PERSON_SURNAME + "@example.com"; + String PARENT_1_PHONE = "07700 900" + randomInt; + + if(CONSENT_DETAILS==""){ + ready_for_consent=true; + } + if(VACCINATED==""){ + ready_for_vaccination=true; + } + //Exclude 3 in 1 as menacwy will cover doubles + if(ready_for_consent&&ready_for_vaccination&&PROGRAMME!="3-in-1"){ + vars.put("consent_" + consentCount.toString(), + PERSON_FORENAME + "," + PERSON_SURNAME + "," + PERSON_DOB + "," + PERSON_ADDRESS_LINE_1 + "," + PERSON_POSTCODE + "," + PROGRAMME + "," + PARENT_1_NAME + "," + PARENT_1_RELATIONSHIP + "," + PARENT_1_EMAIL + "," + PARENT_1_PHONE + "," + vars.get("Programme").toLowerCase() + "," + vars.get("CurrentSessionID")); + //log.info(vars.get("consent_" + consentCount.toString()) + ":" + CONSENT_DETAILS + ":" + VACCINATED); + consentCount++; + } + } +} +log.info("Total Consents found: " + consentCount.toString()); + +//Remove the found consents from the count properties + +String sessionProgramme= "VaccineCount_" + vars.get("Programme").toLowerCase() +props.put(sessionProgramme,((props.get(sessionProgramme).toInteger()-consentCount).toString())) + + + + + + true + + + prev.setIgnore(); + groovy + + + + + localhost + 9191 + http + /sts/RESET?FILENAME=consents.txt + true + GET + true + false + + + + + + + true + + + prev.setIgnore(); + groovy + + + + + consent + currentConsent + true + + + + localhost + 9191 + http + /sts/ADD true - GET + POST true false - + + + false + consents.txt + = + true + FILENAME + + + false + LAST + = + true + ADD_MODE + + + false + ${currentConsent} + = + true + LINE + + - + true @@ -1242,26 +2685,11 @@ log.info("Total Consents found: " + consentCount.toString()); - - - ${Threads} - ${RampUp} - ${Duration} - true - true - continue - - ${Loops} - false - - - - - While there is only one patient list for consents, I'm applying consent for all programmes and ignoring the programme value in the STS file + localhost 9191 http - /sts/READ?FILENAME=consents.txt&READ_MODE=RANDOM&KEEP=FALSE + /sts/STATUS true GET true @@ -1271,97 +2699,7 @@ log.info("Total Consents found: " + consentCount.toString()); - - false - CHILD_FIRST_NAME - <body>(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - CHILD_LAST_NAME - <body>.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - CHILD_DATE_OF_BIRTH - <body>.*?,.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - CHILD_ADDRESS_LINE_1 - <body>.*?,.*?,.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - CHILD_POSTCODE - <body>.*?,.*?,.*?,.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - PARENT_1_NAME - <body>.*?,.*?,.*?,.*?,.*?,.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - PARENT_1_RELATIONSHIP - <body>.*?,.*?,.*?,.*?,.*?,.*?,.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - PARENT_1_EMAIL - <body>.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,(.*?), - $1$ - NoMoreConsents - false - 1 - - - - false - Result - <html><title>(.*?)</title> - $1$ - NoOutcome - false - 1 - - - + true @@ -1370,83 +2708,19 @@ log.info("Total Consents found: " + consentCount.toString()); - - ${__jexl3("${Result}" == "KO")} - false - true - - - - 0 - 0 - 0 - - - - true - - - log.error("Fuzzy search failed") - groovy - - - - - - - Test Plan - Test Plan - Consents - - - - - 9191 - true - C:\apache-jmeter-5.6.3\bin - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - true - false - false - false - true - 0 - true - true - true - true - true - true - - - - - - + + groovy + + + true + log.info("currently consenting " + vars.get("CHILD_FIRST_NAME") + " " + vars.get("CHILD_LAST_NAME") + " for " + vars.get("Programme") + " in session " + vars.get("SessionID")) + + + + true @@ -1479,16 +2753,11 @@ schoolYear = Math.max(yearGroup, -1); // -1 represents pre-school vars.put("SchoolYear", String.valueOf(schoolYear)); -//Copy Consent session properties back to variables - -vars.put("ConsentSession_Flu",props.get("ConsentSession_Flu")); -vars.put("ConsentSession_HPV",props.get("ConsentSession_HPV")); -vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenACWY")); groovy - + true @@ -1497,22 +2766,22 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - - ${__groovy((vars.get("SchoolYear").toInteger() >=8),)} + + ${__jexl3("${Programme}" == "flu")} false false - + true false - + true true 6 - consents/${ConsentSession_Flu}/flu/start + consents/${SessionID}/flu/start true GET true @@ -1522,7 +2791,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - + sec-ch-ua @@ -1549,7 +2818,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC 1 - + false Authenticity_Token consents" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="(.*?)" @@ -1559,7 +2828,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - + false Session_Slug <input type="hidden" name="session_slug" id="session_slug" value=" @@ -1569,7 +2838,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC 1 - + false Programme_Types <input type="hidden" name="programme_types" id="programme_types" value=" @@ -1579,7 +2848,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC 1 - + <h1 class="nhsuk-heading-xl">Give or refuse consent for vaccinations</h1> @@ -1591,12 +2860,12 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - + true false - + true true 6 @@ -1632,7 +2901,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - + sec-ch-ua @@ -1673,7 +2942,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - + false ConsentId <form action="/consents/ @@ -1698,7 +2967,7 @@ vars.put("ConsentSession_MenACWY",props.get("ConsentSession_MenAC - + true true 6 @@ -2627,7 +3896,7 @@ vars.put("question_number",questionNumber.toString()) - + groovy @@ -2718,22 +3987,22 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke - - ${__groovy((vars.get("SchoolYear").toInteger() >=8),)} + + ${__jexl3("${Programme}" == "hpv")} false false - + true false - + true true 6 - consents/${ConsentSession_HPV}/hpv/start + consents/${SessionID}/hpv/start true GET true @@ -3844,22 +5113,22 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke - - ${__groovy((vars.get("SchoolYear").toInteger() >=8),)} + + ${__jexl3("${Programme}" == "menacwy")} false false - + true false - + true true 6 - consents/${ConsentSession_MenACWY}/menacwy-td_ipv/start + consents/${SessionID}/menacwy-td_ipv/start true GET true @@ -3926,7 +5195,7 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke 1 - + <h1 class="nhsuk-heading-xl">Give or refuse consent for vaccinations</h1> @@ -3938,12 +5207,12 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke - + true false - + true true 6 @@ -4628,12 +5897,12 @@ else - + true false - + true true 6 @@ -4747,7 +6016,7 @@ else - + This transaction controller starts with an authenticity token from the previous request, and question_number of 0. The request for health-question needs to increment question_number and loop until the title is; <title>Check and confirm – Give or refuse consent for vaccinations</title> @@ -4889,7 +6158,7 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke - + true false @@ -4970,44 +6239,6 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - true - false - false - false - true - 0 - true - true - true - true - true - true - - - - 1000 - -