-
Notifications
You must be signed in to change notification settings - Fork 2
RDM-4217 - Create Case Data with document attachment in perftest env #16
base: master
Are you sure you want to change the base?
Changes from all commits
4bdc0bb
27ce73d
a3bd088
6daf565
26ecfa1
15a4e77
7e87c7e
74f8a73
738cfc8
baaa325
5c83999
6de74a7
c21ae2f
491138f
caf42db
f78ff5c
94744e4
10bbf06
212dae4
3134fb5
d007f60
d77d02f
ea80273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ results/ | |
src.zip | ||
.DS_Store | ||
/gatling.log | ||
*.zip | ||
.gradle/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Thu Apr 11 15:34:33 BST 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ importSpreadsheet = "src/test/scala/uk/gov/hmcts/ccd/casedefinition/scenarios/fi | |
|
||
//dev default | ||
userCcdId = "[email protected]" | ||
userCcdPassword = "password" | ||
userCcdPassword = "Monday123" | ||
userImportId = "[email protected]" | ||
userImportPassword = "password" | ||
userProfileUrl = "https://case-user-profile-app.dev.ccd.reform.hmcts.net:4451" | ||
|
@@ -58,7 +58,7 @@ localhost { | |
"1547820791714750", "1547036690988904", "1545234546871901", "1548253985508219", "1547200037389206"] | ||
//getCaseUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/:case_reference" | ||
getCaseUrl = "internal/cases/:case_reference" | ||
// getPaginationMetadataUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/pagination_metadata?state=CaseCreated" | ||
// getPaginationMetadataUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/pagination_metadata?state=CaseCreated" | ||
getPaginationMetadataUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/pagination_metadata?state=CaseCreated&case.PersonLastName=unknown" | ||
createCaseUrl = "caseworkers/"${userCcdId}"/jurisdictions/SSCS/case-types/Benefit/cases" | ||
getUserProfileUrl = "caseworkers/538/profile" | ||
|
@@ -245,19 +245,37 @@ cnp_perftest { | |
oAuth2clientSecret = "${IDAM_OAUTH2_CLIENT_SECRET}" | ||
|
||
cases = ["1559642192860544"] | ||
getCaseUrl = "internal/cases/:case_reference" | ||
ccdCaseMgmtUrl = "https://ccd-case-management-web-perftest.service.core-compute-perftest.internal" | ||
getCaseUrl = "aggregated/caseworkers/a2fe2e87-94f7-44a9-a272-5c413a4775c0/jurisdictions/AUTOTEST1/case-types/AAT/cases/1531212825013102" | ||
getCaseUrlV2 = "internal/cases/1559642192860544" | ||
createCaseUrl = "caseworkers/a2fe2e87-94f7-44a9-a272-5c413a4775c0/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
validateCaseUrl = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/cases" | ||
getUserProfileUrl = "caseworkers/176475/profile" | ||
getUserProfileUrl = "caseworkers/a2fe2e87-94f7-44a9-a272-5c413a4775c0/profile" | ||
getUserProfileUrlV2 = "caseworkers/539560/profile" | ||
searchCases = "aggregated/caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/cases?state=CaseCreated" | ||
getPaginationMetadataUrl = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/cases/pagination_metadata?state=CaseCreated" | ||
saveEventUrl = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/CASETYPE2/cases/1531207599597587/events" | ||
searchInputDetails = "aggregated/caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/inputs" | ||
workbasketInputDetails = "/aggregated/caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/work-basket-inputs" | ||
getPrintableDocumentsForEvent = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/CASETYPE2/cases/1531207599597587/documents" | ||
validateCaseDetails = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/validate" | ||
docStoreBashURL = "https://dm-store-perftest.service.core-compute-perftest.internal" | ||
ESSearch = "searchCases" | ||
docStoreBashURL123 = "https://dm-store-perftest.service.core-compute-perftest.internal" | ||
docStoreBashURL = "https://gateway-ccd.perftest.platform.hmcts.net" | ||
prodSSCSWorkBasket = "aggregated/caseworkers/560966/jurisdictions/SSCS/case-types/Benefit/cases?view=WORKBASKET&page=1&case.caseReference=test1234567" | ||
prodSSCSPagination = "caseworkers/560966/jurisdictions/SSCS/case-types/Benefit/cases/pagination_metadata?case.caseReference=test123456" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
prodDIVORCED8caseReference = "aggregated/caseworkers/560966/jurisdictions/DIVORCE/case-types/DIVORCE/cases?page=1&case.D8caseReference=EZ12D81234" | ||
prodDIVORCED8caseReferencePagination = "caseworkers/560966/jurisdictions/DIVORCE/case-types/DIVORCE/cases/pagination_metadata?case.D8caseReference=EZ12D81234" | ||
createCaseDIVUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. createCaseDIVUrl, createCaseSSCSUrl, createCaseCMCUrl... all duplicated. Needs sorting out |
||
createCaseSSCSUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createCaseCMCUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createCaseProbateGrantApplicationUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createCaseProbateCaveatApplicationUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createIACaseAppURL = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createFPLCaseAppURL = "caseworkers/77a5a58b-4d17-43b1-8df4-5cccd6cb1472/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createFRCaseAppURL = "caseworkers/44d5d0eb-0739-49e6-8c5e-bd556ef633d2/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createETHOSCaseAppURL = "caseworkers/b1d866d5-2e78-454a-b18a-95020d0bb603/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
saveEventETHOSUploadDocsUrl = "caseworkers/30b48b61-7abf-4747-9270-8e86f466c0d6/jurisdictions/PUBLICLAW/case-types/TRIB_MVP_3_TYPE_Manc/cases/1559571632599539/events" | ||
} | ||
|
||
cnp_saat { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
filename | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we move these files into a subfolder tree called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would like to keep test related static data files under resource folder. that's fine |
||
1MB.pdf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
import scala.concurrent.duration._ | ||
|
||
object GetCaseDataV2 extends PerformanceTestsConfig { | ||
|
||
private val getCaseUrl = caseDataUrl(config.getString("getCaseUrlV2")) | ||
println("Retrieving case with base url: " + getCaseUrl) | ||
|
||
def getCaseDataHttp() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken() | ||
//val userToken = CcdTokenGenerator.generateWebUserToken(getCaseUrl) | ||
//http("get case data") | ||
http("TX01_CCD_GetCaseDataEndpoint_getcasedataV2") | ||
.get(_ => url()) | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.header("Accept","application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-case-view.v2+json") | ||
.header("Experimental","true") | ||
.check(status in (200)) | ||
} | ||
|
||
def url(): String = { | ||
val result: String = if(!getCaseUrl.contains(":case_reference")) { | ||
getCaseUrl | ||
} else { | ||
resolveGetCaseUrl() | ||
} | ||
// println("Retrieving case: " + result) | ||
result | ||
} | ||
|
||
private def resolveGetCaseUrl(): String = { | ||
getCaseUrl.replace(":case_reference", pickRandomReference().replaceAll("-", "")) | ||
} | ||
|
||
println("GetCaseData: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
val GetCaseDataV2Scenarios = scenario("Get Case Data V2").during(TotalRunDuration minutes) { | ||
exec( | ||
getCaseDataHttp() | ||
) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
|
||
val waitForNextIteration = pace(MinWaitForNextIteration seconds, MaxWaitForNextIteration seconds) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object GetPrintableDocumentsForEvent extends PerformanceTestsConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("getPrintableDocumentsForEvent") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
println("Retrieving getPrintableDocumentsForEvent URL : " + url) | ||
|
||
def httpRequest() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken() | ||
http("TX09_CCD_GetPrintableDocumentsForEvent_getDocumentsForEvent") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the meaning of TX09 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's transaction name needed to identify timing for specific endpoint from gatling raw data |
||
.get(url) | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status in (200)) | ||
} | ||
|
||
println("WorkBasketInputDetails: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val getPrintableDocumentForEvents = scenario("Get Printable Document for Events").during(TotalRunDuration minutes) { | ||
exec(httpRequest()) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object SearchInputDetails extends PerformanceTestsConfig { | ||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("searchInputDetails") | ||
println("Retrieving searchInputDetails URL : " + url) | ||
|
||
def httpRequest() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken() | ||
http("TX07_CCD_SearchInputDetails_searchInputDetails") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we call this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TX01, TX02.....TXxx all are transactions name. |
||
.get(url) | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status in (200)) | ||
} | ||
|
||
println("SearchInputDetails: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val getSearchInputDetails = scenario("Search Input Details").during(TotalRunDuration minutes) { | ||
exec( | ||
httpRequest() | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you format better here please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object ValidateCaseDetails extends PerformanceTestsConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All naming in this class is completely messed up. You're not Validating a case here, you are creating a case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewed and all looks OK to me Object name ValidateCaseDetails is also looking fine to me. |
||
|
||
// val EventId = "applyForGrant" | ||
val EventId = "CREATE" | ||
val CreateCaseUrl = caseDataUrl(config.getString("validateCaseUrl")) | ||
val CreateCaseTokenUrl = s"${CreateCaseUrl.replaceAll("cases", "")}event-triggers/$EventId/token" | ||
println("create case url: " + CreateCaseUrl) | ||
println("create case token url: " + CreateCaseTokenUrl) | ||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("validateCaseDetails") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed url to validateUrl but other syntax looks fine |
||
println("Retrieving validateCaseDetails URL : " + url) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this mean? we don't retrieve urls There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Amended. it's just printing URL as output. |
||
|
||
val ReqPayload = StringBody(""" | ||
{ | ||
"data": { | ||
"TextField": "First Page", | ||
"NumberField": "123", | ||
"YesOrNoField": "Yes", | ||
"PhoneUKField": "02920001002", | ||
"EmailField": "[email protected]" | ||
}, | ||
"event": { | ||
"id": "CREATE", | ||
"summary": "", | ||
"description": "" | ||
}, | ||
"event_token": "${eventToken}", | ||
"ignore_warning": false | ||
} | ||
""") | ||
|
||
|
||
def validateCaseDatahttp() = { | ||
val token = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken() | ||
exec( | ||
//http("get create case event token") | ||
http("TX10_CCD_ValidateCaseDataEndpoint_validatecasedata_eventtoken") | ||
.get(CreateCaseTokenUrl) | ||
.header("ServiceAuthorization", token) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status.is(200),jsonPath("$.token").saveAs("eventToken")) | ||
).exec( | ||
//http("create case data") | ||
http("TX11_CCD_CCD_ValidateCaseDataEndpoint_validatecasedata") | ||
.post(url) | ||
.body( | ||
ReqPayload).asJson | ||
.header("ServiceAuthorization", token) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status is 200) | ||
) | ||
} | ||
|
||
|
||
println("ValidateCaseData: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val validateCaseData = scenario("Validate Case Data").during(TotalRunDuration minutes) { | ||
exec( | ||
validateCaseDatahttp() | ||
) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
|
||
val waitForNextIteration = pace(MinWaitForNextIteration seconds, MaxWaitForNextIteration seconds) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this var used anywhere? can't find any usage There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed this line. |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object WorkBasketInputDetails extends PerformanceTestsConfig { | ||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("workbasketInputDetails") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicated code. Why don't you reuse use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not duplicate. |
||
println("Retrieving workbasketInputDetails URL : " + url) | ||
|
||
def httpRequest() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken() | ||
http("TX08_CCD_WorkBasketInputDetails_workbasketInputDetails") | ||
.get(url) | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status in (200)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove not needed spaces please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not clear about this. remove what ? Amended println text and reformatted code. |
||
} | ||
|
||
println("WorkBasketInputDetails: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val getWorkbasketInputDetails = scenario("Work Basket Input Details").during(TotalRunDuration minutes) { | ||
exec( | ||
httpRequest() | ||
) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct formatting please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docStoreBashURL123? what does that means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docStoreBashURL123 not needed. removed