Skip to content

Commit

Permalink
Merge pull request #12 from hmrc/BST-107692
Browse files Browse the repository at this point in the history
Perftests updated
  • Loading branch information
swathiguduguntla authored Jan 20, 2025
2 parents 2eb44c2 + 52d897c commit ea8faeb
Show file tree
Hide file tree
Showing 12 changed files with 1,406 additions and 248 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ lazy val root = (project in file("."))
.enablePlugins(GatlingPlugin)
.settings(
name := "tenure-cost-and-trade-records-performance-tests",
version := "0.1.0-SNAPSHOT",
scalaVersion := "2.13.10",
version := "2.0.0",
scalaVersion := "2.13.14",
//implicitConversions & postfixOps are Gatling recommended -language settings
scalacOptions ++= Seq("-feature", "-language:implicitConversions", "-language:postfixOps"),
// Enabling sbt-auto-build plugin provides DefaultBuildSettings with default `testOptions` from `sbt-settings` plugin.
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ object Dependencies {
private val gatlingVersion = "3.6.1"

val test = Seq(
"com.typesafe" % "config" % "1.4.2" % Test,
"uk.gov.hmrc" %% "performance-test-runner" % "5.6.0" % Test,
"com.typesafe" % "config" % "1.4.3" % Test,
"uk.gov.hmrc" %% "performance-test-runner" % "6.0.0" % Test,
"io.gatling" % "gatling-test-framework" % gatlingVersion % Test,
"io.gatling.highcharts" % "gatling-charts-highcharts" % gatlingVersion % Test,
"org.scalacheck" %% "scalacheck" % "1.17.0"
// "org.scalacheck" %% "scalacheck" % "1.17.0"
)

}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.2
sbt.version=1.9.9
13 changes: 6 additions & 7 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
resolvers += "HMRC-open-artefacts-maven" at "https://open.artefacts.tax.service.gov.uk/maven2"
resolvers += Resolver.url("HMRC-open-artefacts-ivy", url("https://open.artefacts.tax.service.gov.uk/ivy2"))(
resolvers += MavenRepository("HMRC-open-artefacts-maven2", "https://open.artefacts.tax.service.gov.uk/maven2")
resolvers += Resolver.url("HMRC-open-artefacts-ivy2", url("https://open.artefacts.tax.service.gov.uk/ivy2"))(
Resolver.ivyStylePatterns
)

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.9.0")

addSbtPlugin("io.gatling" % "gatling-sbt" % "4.1.5")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.22.0")
addSbtPlugin("io.gatling" % "gatling-sbt" % "4.1.5")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
30 changes: 28 additions & 2 deletions src/test/resources/journeys.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

journeys {

sendTradeAndCostInformationIntroductionPages = {
sendTradeAndCostInformationIntroductionPages = {
description = "user completes vacant property, download reference number, not connected to property and no reference number"
load = 2
parts = [
Expand All @@ -26,7 +26,7 @@ journeys {
No-reference-number,
Download-pdf-version
]

}

sendTradeAndCostInformationFor6011 = {
description = "user submits 6011 form"
Expand Down Expand Up @@ -104,6 +104,32 @@ journeys {
Additional-information-6030
]
}
sendTradeAndCostInformationFor6076 = {
description = "user submits 6076 form"
load = 4
parts = [
web-test-prep-for-6076,
About-property-6076,
Trading-History-6076,
Franchise-or-Lettings-6076,
Lease-or-Agreement-6076,
Additional-information-6076
]
}

sendTradeAndCostInformationFor6045 = {
description = "user submits 6045 form"
load = 4
parts = [
web-test-prep-for-6045,
About-property-6045,
Trading-History-6045,
Franchise-or-Lettings-6045,
Lease-or-Agreement-6045,
Additional-information-6045
]
}

}

#Default behaviour is to run all journeys. If that is not what you need you can specify the list of journeys to run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,82 @@ object AboutPropertyRequests extends HttpConfiguration with servicesConfig {
))
.check(status.is(303))

val getPropertyCurrentlyUsed: HttpRequestBuilder =
http("[GET] get property currently used page")
.get(s"$baseUrl/$route/property-currently-used")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))
def postPropertyCurrentlyUsed(option: String): HttpRequestBuilder =
http("[POST] post property currently used page")
.post(s"$baseUrl/$route/property-currently-used")
.formParam("propertyCurrentlyUsed[]", option)
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getRenewablesPlants: HttpRequestBuilder =
http("[GET] get renewables plants page")
.get(s"$baseUrl/$route/renewables-plants")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))

def postRenewablesPlants(option: String): HttpRequestBuilder =
http("[POST] post renewables plants page")
.post(s"$baseUrl/$route/renewables-plants")
.formParam("renewablesPlant", option)
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getThreeYearsConstructed: HttpRequestBuilder =
http("[GET] get three years constructed page")
.get(s"$baseUrl/$route/three-years-constructed")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))

def postThreeYearsConstructed(option: String): HttpRequestBuilder =
http("[POST] post three years constructed page")
.post(s"$baseUrl/$route/renewables-plants")
.formParam("threeYearsConstructed", option)
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getCostsBreakdown: HttpRequestBuilder =
http("[GET] get costs breakdown page")
.get(s"$baseUrl/$route/costs-breakdown")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))

def postCostsBreakdown(details: String): HttpRequestBuilder =
http("[POST] post costs breakdown page")
.post(s"$baseUrl/$route/costs-breakdown")
.formParam("costsBreakdown", details)
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getPlantAndTechnology: HttpRequestBuilder =
http("[GET] get plant and technology page")
.get(s"$baseUrl/$route/plant-and-technology")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))

def postPlantAndTechnology(details: String): HttpRequestBuilder =
http("[POST] post plant and technology page")
.post(s"$baseUrl/$route/plant-and-technology")
.formParam("plantAndTechnology", details)
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getGeneratorCapacity: HttpRequestBuilder =
http("[GET] get generator capacity page")
.get(s"$baseUrl/$route/generator-capacity")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))

def postGeneratorCapacity(capacity: String): HttpRequestBuilder =
http("[POST] get generator capacity page")
.post(s"$baseUrl/$route/generator-capacity")
.formParam("generatorCapacity", capacity)
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getWebsiteForProperty: HttpRequestBuilder =
http("[GET] get website for the property")
Expand Down Expand Up @@ -199,9 +275,6 @@ object AboutPropertyRequests extends HttpConfiguration with servicesConfig {
.check(status.is(303))





val getLicensableActivities: HttpRequestBuilder =
http("[GET] get licensable activities page")
.get(s"$baseUrl/$route/licensable-activities")
Expand Down Expand Up @@ -240,10 +313,6 @@ object AboutPropertyRequests extends HttpConfiguration with servicesConfig {
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))





val getLicensableActivitiesDetails: HttpRequestBuilder =
http("[GET] get licensable activities details")
.get(s"$baseUrl/$route/licensable-activities-details")
Expand Down Expand Up @@ -533,4 +602,74 @@ object AboutPropertyRequests extends HttpConfiguration with servicesConfig {
getCYAAboutTheProperty,
postCYAAboutTheProperty("yes")
)

def aboutYouAndPropertySection6076(form: String): Seq[HttpRequestBuilder] = Seq(
getHomePage,
getLoginPage,
postLoginPage("BN12 4AX", form),
getAreYouStillConnectedPage,
postAreYouStillConnectedPage("yes"),
getNameOfOperatorFromProperty,
postNameOfOperatorFromProperty("Dru"),
getTradingNameOwnTheProperty,
postTradingNameOwnTheProperty("no"),
getTradingNamePayingRent,
postPostTradingNamePayingRent("yes"),
getAreYouThirdParty,
postAreYouThirdParty("yes"),
getCYAConnectionToTheProperty,
postCYAConnectionToTheProperty("yes"),
getAboutYouPage,
postAboutYouPage("minion", "01234567899", "[email protected]"),
getContactDetailsQuestion,
postContactDetailsQuestion("yes"),
getAlternateContactDetails,
postAlternateContactDetails("10 Minion Street", "MinionsCity", "BN12 4AX"),
getRenewablesPlants,
postRenewablesPlants("intermittent"),
getThreeYearsConstructed,
postThreeYearsConstructed("yes"),
getCostsBreakdown,
postCostsBreakdown("costs breakdown details"),
getPlantAndTechnology,
postPlantAndTechnology("plant and technology name"),
getGeneratorCapacity,
postGeneratorCapacity("50 MW"),
getCYAAboutTheProperty,
postCYAAboutTheProperty("yes")
)

def aboutYouAndPropertySection6045(form: String): Seq[HttpRequestBuilder] = Seq(
getHomePage,
getLoginPage,
postLoginPage("BN12 4AX", form),
getAreYouStillConnectedPage,
postAreYouStillConnectedPage("yes"),
getVacantPropertiesPage,
postVacantProperties("no"),
getNameOfOperatorFromProperty,
postNameOfOperatorFromProperty("Dru"),
getTradingNameOwnTheProperty,
postTradingNameOwnTheProperty("no"),
getTradingNamePayingRent,
postPostTradingNamePayingRent("yes"),
getAreYouThirdParty,
postAreYouThirdParty("yes"),
getCYAConnectionToTheProperty,
postCYAConnectionToTheProperty("yes"),
getAboutYouPage,
postAboutYouPage("minion", "01234567899", "[email protected]"),
getContactDetailsQuestion,
postContactDetailsQuestion("yes"),
getAlternateContactDetails,
postAlternateContactDetails("10 Minion Street", "MinionsCity", "BN12 4AX"),
getPropertyCurrentlyUsed,
postPropertyCurrentlyUsed("fleetCaravanPark"),
getWebsiteForProperty,
postWebsiteForProperty("yes", "www.example.com"),
getCYAAboutTheProperty,
postCYAAboutTheProperty("yes")
)


}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,21 @@ object LeaseOrAgreementRequests extends HttpConfiguration with servicesConfig {
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))

val getProvideDetailsOfYourLease: HttpRequestBuilder =
http("[GET] get provide details of your lease")
.get(s"$baseUrl/$route/provide-details-of-your-lease")
.check(status.is(200))
.check(css("input[name=csrfToken]", "value").saveAs("csrfToken"))

def postProvideDetailsOfYourLease: HttpRequestBuilder =
http("[POST] post provide details of your lease")
.post(s"$baseUrl/$route/provide-details-of-your-lease")
.formParam("provideDetailsOfYourLease", "details")
.formParam("csrfToken", f"$${csrfToken}")
.check(status.is(303))



val getCurrentAnnualRent: HttpRequestBuilder =
http("[GET] get current annual rent page")
.get(s"$baseUrl/$route/current-annual-rent")
Expand Down Expand Up @@ -1334,4 +1349,19 @@ object LeaseOrAgreementRequests extends HttpConfiguration with servicesConfig {
postLegalOrPlanningRestrictionsDetails("details"),
getCYALeaseOrTenure,
postCYALeaseOrTenure("yes"))

val leaseOrAgreementSectionFor6076: Seq[HttpRequestBuilder] = Seq(
getAboutYourLandlord,
postAboutYourLandlordFor6015("Dru"),
getConnectionToLandlord,
postConnectionToLandlord("yes"),
getConnectedLandlordDetails,
postConnectedLandlordDetails("Connected to landlord details"),
getPropertyUseLeaseBackArrangement,
postPropertyUseLeaseBackArrangement("yes"),
getProvideDetailsOfYourLease,
postProvideDetailsOfYourLease,
getCYALeaseOrTenure,
postCYALeaseOrTenure("yes"))

}
Loading

0 comments on commit ea8faeb

Please sign in to comment.