diff --git a/.github/workflows/performance.yaml b/.github/workflows/performance.yaml index f4c30477116..615a2b07af2 100644 --- a/.github/workflows/performance.yaml +++ b/.github/workflows/performance.yaml @@ -7,11 +7,11 @@ on: workflow_dispatch: inputs: - runImport: - description: "Create and import a cohort (not needed if there are already enough patients)" + AddNewSession: + description: "Add a new session date (not needed if there are already enough patients)" required: true - type: boolean - default: false + type: string + default: 'False' runConsent: description: "Run consent journey" required: true @@ -22,10 +22,6 @@ on: required: true type: boolean default: true - URN: - description: "Required: what URN to run the test against." - required: true - type: string duration: description: "Optional (default 3600) Duration of nurse journey test, in seconds. This will include ramp-up." required: false @@ -41,16 +37,11 @@ on: required: false type: string default: '900' - row_count: - description: "Optional (default 1000) number of rows in the cohort file." - required: false - type: string - default: '1000' user: description: "Optional (default Nurse perftest) user." required: true type: string - default: 'nurse.perftest@example.com' + default: 'nurse.perf2test@example.com' BaseURL: description: "Optional (default qa.mavistesting.com) URL" required: true @@ -72,7 +63,14 @@ jobs: steps: - uses: actions/checkout@v5 - + + - name: Echo workflow inputs + run: | + echo "AddNewSession:${{ inputs.AddNewSession }}" >> $GITHUB_STEP_SUMMARY + echo "RunConsent:${{ inputs.runConsent }},runNurse:${{ inputs.runNurse }}" >> $GITHUB_STEP_SUMMARY + echo "duration:${{ inputs.duration }},threads:${{ inputs.threads }},ramp_up:${{ inputs.ramp_up }}" >> $GITHUB_STEP_SUMMARY + echo "user:${{ inputs.user }},BaseURL:${{ inputs.BaseURL }}" >> $GITHUB_STEP_SUMMARY + - name: Cache jmeter id: cache-jmeter uses: actions/cache@v4 @@ -121,32 +119,6 @@ jobs: id: timestamp run: echo "timestamp=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV - - name: Create new cohort file - if: inputs.runImport == true - run: | - mkdir -p generate-cohort-output - generate_cohort_output_dir=generate-cohort-output - jmeter/bin/jmeter -n -t performance-tests/STS/generate-cohort.jmx \ - -l $generate_cohort_output_dir/samples.jtl \ - -j $generate_cohort_output_dir/jmeter.log \ - -JAuthToken=${{secrets.HTTP_AUTH_TOKEN_FOR_TESTS}} \ - -JURN=${{inputs.URN}} \ - -JBaseURL=${{inputs.BaseURL}} \ - -JRowCount=${{inputs.row_count}} - - - name: Run file import for new file - if: inputs.runImport == true - run: | - mkdir -p import-output - import_output_dir=import-output - jmeter/bin/jmeter -n -t performance-tests/STS/upload-cohort-data.jmx \ - -l $import_output_dir/samples.jtl \ - -j $import_output_dir/jmeter.log \ - -JAuthToken=${{secrets.HTTP_AUTH_TOKEN_FOR_TESTS}} \ - -JUser=${{inputs.user}} \ - -JBaseURL=${{inputs.BaseURL}} \ - -JInputFile="cohortnew.csv" - - name: Run Consent Journey if: inputs.runConsent == true run: | @@ -166,7 +138,8 @@ jobs: -JDuration=${{inputs.duration}} \ -JUser=${{inputs.user}} \ -JBaseURL=${{inputs.BaseURL}} \ - -JURN=${{inputs.URN}} + -JURN=${{inputs.URN}} \ + -JAddNewSession=${{inputs.AddNewSession}} - name: Upload consent journey JMeter output if: inputs.runConsent == true diff --git a/performance-tests/STS/consent-journey.jmx b/performance-tests/STS/consent-journey.jmx index 15daf392736..bcff3eb3539 100644 --- a/performance-tests/STS/consent-journey.jmx +++ b/performance-tests/STS/consent-journey.jmx @@ -5,8 +5,6 @@ - false - false @@ -42,7 +40,7 @@ - + AuthToken @@ -86,6 +84,11 @@ ${__P(BaseURL,qa.mavistesting.com)} = + + AddNewSession + ${__P(AddNewSession,False)} + = + User ${__P(User, nurse.perftest@example.com)} URN ${__P(URN, 137390)} @@ -124,7 +127,7 @@ URN ${__P(URN, 137390)} 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 @@ -1149,7 +1152,22 @@ log.info("Total Consents found: " + consentCount.toString()); - + + ${__jexl3("${AddNewSession}" == "True")} + false + true + + + + + Test Plan + Test Plan + Add new session + + + + + Test Plan Test Plan @@ -1512,7 +1530,7 @@ log.info("number of patients per Vaccine required: " + props.get(" - + start true GET @@ -1633,7 +1651,7 @@ log.info("number of patients per Vaccine required: " + props.get(" - + sessions true GET @@ -1699,7 +1717,7 @@ without actual network activity. This helps debugging tests. - + SessionID CurrentSessionID true @@ -1714,7 +1732,7 @@ without actual network activity. This helps debugging tests. log.info("Currently working with " + vars.get("CurrentSessionID")) - + true true 6 @@ -1768,7 +1786,7 @@ without actual network activity. This helps debugging tests. false Programme - <p class="nhsuk-caption-l nhsuk-u-margin-bottom-4">\n *(.*?)\n *<\/h3> + <h3 class="nhsuk-heading-m nhsuk-u-margin-bottom-2">\n *(.*?)\n *<\/h3> $1$ ProgrammeNotFound false @@ -1810,7 +1828,7 @@ JSR223 Sampler: HPV - + true true 6 @@ -1912,7 +1930,7 @@ JSR223 Sampler: HPV false - + groovy @@ -1962,7 +1980,7 @@ if(props.get("VaccineCount_" + vars.get("Programme").toLower - + Test Plan Test Plan @@ -1975,7 +1993,7 @@ if(props.get("VaccineCount_" + vars.get("Programme").toLower - + true true 6 @@ -2323,7 +2341,7 @@ vars.put("postbody",postbody); - + ${__jexl3("${DateAlreadyUsed}" == "noError")} false true @@ -3828,7 +3846,7 @@ else 1 - + false Authenticity_Token health-question"[\s\S]*?authenticity_token" value="(.*?)" @@ -3854,7 +3872,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> @@ -3865,7 +3883,7 @@ else false - + groovy @@ -3878,11 +3896,11 @@ vars.put("question_number","0") vars.put("PageTitle","NotFound") - + ${__jexl3("${PageTitle}" != "Check and confirm")} - + true true 6 @@ -3932,7 +3950,7 @@ vars.put("PageTitle","NotFound") - + false Authenticity_Token health-question"[\s\S]*?authenticity_token" value="(.*?)" @@ -3942,7 +3960,7 @@ vars.put("PageTitle","NotFound") - + false Confirm_Authenticity_Token Confirm[\s\S]*?authenticity_token" value="(.*?)" @@ -5051,7 +5069,7 @@ vars.put("PageTitle","NotFound") - + false Authenticity_Token health-question"[\s\S]*?authenticity_token" value="(.*?)" @@ -5061,7 +5079,7 @@ vars.put("PageTitle","NotFound") - + false Confirm_Authenticity_Token Confirm[\s\S]*?authenticity_token" value="(.*?)" @@ -6167,7 +6185,7 @@ vars.put("PageTitle","NotFound") - + false Authenticity_Token health-question"[\s\S]*?authenticity_token" value="(.*?)" @@ -6177,7 +6195,7 @@ vars.put("PageTitle","NotFound") - + false Confirm_Authenticity_Token Confirm[\s\S]*?authenticity_token" value="(.*?)" @@ -6312,6 +6330,285 @@ vars.put("Authenticity_Token",vars.get("Confirm_Authenticity_Toke + + Rather than specifically declare a session URN in the workflow, this is to get an unused session and add session dates. + +It needs; + +Login +Go to session page +Filter by unscheduled +Grab the first school name and search for that (this is to get one of each programme to the top of the list) +Grab the three session ID's and use 'set session date and in progress' to open those sessions + + + + + start + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + + users/sign-in + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + false + Authenticity_Token + \/users\/sign-in"[\s\S]*?authenticity_token" value="(.*?)" + $1$ + Authenticity_Token_NotFound + false + 1 + + + + + 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 + organisationId + class="nhsuk-radios__input" type="radio" value="(.*?)" + $1$ + orgNotFound + false + + + + + groovy + + + true + prev.setIgnore() + + + + false + Authenticity_Token + \/users/organisations"[\s\S]*?authenticity_token" value="(.*?)" + " autocomplete="off" /> + Authenticity_Token_NotFound + false + 1 + + + + + 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 + + + + + sessions?q=&%5Bprogrammes%5D%5B%5D=&status=unscheduled&type= + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + false + SchoolName + href="\/sessions\/.*?">(.*?)<\/a> + $1$ + SchoolNameNotFound + false + 1 + + + + false + SessionVaccine + sessions\/(.*?)"[\s\S]{1,500}>\d*? children[\s\S]{1,400}nhsuk-tag nhsuk-tag--white">(.*?)< + $2$ + SessionVaccineNotFound + false + -1 + + + + + sessions?q=${SchoolName}&%5Bprogrammes%5D%5B%5D=&status=unscheduled&type= + true + GET + true + false + + + + + + + groovy + + + true + prev.setIgnore() + + + + false + SessionVaccine + sessions\/(.*?)"[\s\S]{1,500}>\d*? children[\s\S]{1,400}nhsuk-tag nhsuk-tag--white">(.*?)< + $2$ + SessionVaccineNotFound + false + -1 + + + + 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 + true + false + + + + SessionID + CurrentSessionID + true + 2 + + + + + Test Plan + Test Plan + Set session date and in progress + + + + +