From 93fd78206f89cecc40a6c7f0855b72ca7d2ed0b0 Mon Sep 17 00:00:00 2001 From: divya-manivannan-hmrc <175815017+Divya-Manivannan-hmrc@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:40:40 +0000 Subject: [PATCH 1/2] DDCE-6203 - Remove sbt-accessibility-linter --- README.md | 11 --- a11y/FrontendAccessibilitySpec.scala | 129 --------------------------- build.sbt | 2 +- project/AppDependencies.scala | 4 +- project/plugins.sbt | 15 ++-- run_all_tests.sh | 2 +- 6 files changed, 11 insertions(+), 152 deletions(-) delete mode 100644 a11y/FrontendAccessibilitySpec.scala diff --git a/README.md b/README.md index 0a5a1f83..30fe2b4f 100644 --- a/README.md +++ b/README.md @@ -69,17 +69,6 @@ sm2 --start MERCHANDISE_IN_BAGGAGE_ALL --appendArgs '{"PAYMENTS_PROCESSOR":["-Dm * Run the UI tests which can be found [here](https://github.com/hmrc/merchandise-in-baggage-ui-tests). -### Running Accessibility Tests - -#### Prerequisites -Have node installed on your machine. - -#### Execute tests -To run the tests locally, simply run: -```bash -sbt clean A11y/test -``` - ## Enabling 'Admin Mode' This service is built to accept traffic from the `admin.tax.service.gov.uk` domain as well for assisted digital journeys. diff --git a/a11y/FrontendAccessibilitySpec.scala b/a11y/FrontendAccessibilitySpec.scala deleted file mode 100644 index 2b6b97c0..00000000 --- a/a11y/FrontendAccessibilitySpec.scala +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2024 HM Revenue & Customs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.scalacheck.Arbitrary -import play.api.data.Form -import play.api.data.Forms._ -import play.api.mvc.RequestHeader -import play.twirl.api.Html -import uk.gov.hmrc.merchandiseinbaggage.auth.AuthRequest -import uk.gov.hmrc.merchandiseinbaggage.config.AppConfig -import uk.gov.hmrc.merchandiseinbaggage.controllers.{DeclarationGoodsRequest, DeclarationJourneyRequest} -import uk.gov.hmrc.merchandiseinbaggage.forms._ -import uk.gov.hmrc.merchandiseinbaggage.model.api._ -import uk.gov.hmrc.merchandiseinbaggage.model.api.calculation.CalculationResults -import uk.gov.hmrc.merchandiseinbaggage.model.core.{PurchaseDetailsInput, ThresholdAllowance} -import uk.gov.hmrc.merchandiseinbaggage.stubs.PayApiStub._ -import uk.gov.hmrc.merchandiseinbaggage.views.html._ -import uk.gov.hmrc.scalatestaccessibilitylinter.views.AutomaticAccessibilitySpec - -class FrontendAccessibilitySpec extends AutomaticAccessibilitySpec { - - private val appConfig: AppConfig = app.injector.instanceOf[AppConfig] - private val emailForm: Form[Email] = EnterEmailForm.mandatoryForm - private val optionEmailForm: Form[Option[Email]] = EnterEmailForm.optionalForm - private val booleanForm: Form[Boolean] = Form("value" -> boolean) - private val stringForm: Form[String] = Form("value" -> text) - private val authRequest = AuthRequest( - request = fakeRequest, - credentials = None, - isAssistedDigital = false - ) - private val declarationJourneyRequest = new DeclarationJourneyRequest( - declarationJourney = completedDeclarationJourney, - request = authRequest - ) - private val declarationGoodsRequest = new DeclarationGoodsRequest( - declarationJourneyRequest = declarationJourneyRequest, - goodsEntry = completedImportGoods - ) - - implicit val arbRequestHeader: Arbitrary[RequestHeader] = fixed(fakeRequest) - implicit val arbHtml: Arbitrary[Html] = fixed(Html("")) - implicit val arbForm: Arbitrary[Form[_]] = fixed(booleanForm) - implicit val arbString: Arbitrary[String] = fixed("http://something") - implicit val arbFormString: Arbitrary[Form[String]] = fixed(stringForm) - implicit val arbAppConfig: Arbitrary[AppConfig] = fixed(appConfig) - implicit val arbEnterEmailForm: Arbitrary[Form[Email]] = fixed(emailForm) - implicit val arbEnterOptionEmailForm: Arbitrary[Form[Option[Email]]] = fixed(optionEmailForm) - implicit val arbDeclarationType: Arbitrary[DeclarationType] = fixed(DeclarationType.Import) - implicit val arbGoodsDestination: Arbitrary[GoodsDestination] = fixed(GoodsDestinations.GreatBritain) - implicit val arbDeclaration: Arbitrary[Declaration] = fixed(declaration) - implicit val arbJourneyType: Arbitrary[JourneyType] = fixed(JourneyTypes.New) - implicit val arbCheckYourAnswersImport: Arbitrary[CalculationResults] = fixed(aCalculationResultsWithNoTax) - implicit val arbCheckYourAnswersAmendExport: Arbitrary[Amendment] = fixed(aAmendment) - implicit val arbCheckYourAnswersExport: Arbitrary[YesNo] = fixed(YesNo.Yes) - implicit val arbJourneyDetailsEntry: Arbitrary[Form[JourneyDetailsEntry]] = fixed( - JourneyDetailsForm.form(DeclarationType.Import, journeyDate) - ) - implicit val arbPreviousDeclarationDetails: Arbitrary[ThresholdAllowance] = fixed(aThresholdAllowance) - implicit val arbPurchaseDetailsExport: Arbitrary[Form[PurchaseDetailsInput]] = fixed(PurchaseDetailsForm.form) - implicit val arbTravellerDetails: Arbitrary[Form[Name]] = fixed(TravellerDetailsForm.form) - implicit val arbAuthRequest: Arbitrary[AuthRequest[_]] = fixed(authRequest) - implicit val arbDeclarationJourneyRequest: Arbitrary[DeclarationJourneyRequest[_]] = fixed(declarationJourneyRequest) - implicit val arbDeclarationGoodsRequest: Arbitrary[DeclarationGoodsRequest[_]] = fixed(declarationGoodsRequest) - - val viewPackageName = "uk.gov.hmrc.merchandiseinbaggage.views.html" - - override def layoutClasses: Seq[Class[Layout]] = Seq(classOf[Layout]) - - override def renderViewByClass: PartialFunction[Any, Html] = { - case agentDetailsView: AgentDetailsView => render(agentDetailsView) - case cannotAccessPageView: CannotAccessPageView => render(cannotAccessPageView) - case cannotUseServiceIrelandView: CannotUseServiceIrelandView => render(cannotUseServiceIrelandView) - case cannotUseServiceView: CannotUseServiceView => render(cannotUseServiceView) - case checkYourAnswersAmendExportView: CheckYourAnswersAmendExportView => render(checkYourAnswersAmendExportView) - case checkYourAnswersAmendImportView: CheckYourAnswersAmendImportView => render(checkYourAnswersAmendImportView) - case checkYourAnswersExportView: CheckYourAnswersExportView => render(checkYourAnswersExportView) - case checkYourAnswersImportView: CheckYourAnswersImportView => render(checkYourAnswersImportView) - case customsAgentView: CustomsAgentView => render(customsAgentView) - case declarationConfirmationView: DeclarationConfirmationView => render(declarationConfirmationView) - case declarationNotFoundView: DeclarationNotFoundView => render(declarationNotFoundView) - case enterEmailView: EnterEmailView => render(enterEmailView) - case enterOptionalEmailView: EnterOptionalEmailView => render(enterOptionalEmailView) - case eoriNumberView: EoriNumberView => render(eoriNumberView) - case errorTemplate: ErrorTemplate => render(errorTemplate) - case exciseAndRestrictedGoodsView: ExciseAndRestrictedGoodsView => render(exciseAndRestrictedGoodsView) - case goodsDestinationView: GoodsDestinationView => render(goodsDestinationView) - case goodsInVehicleView: GoodsInVehicleView => render(goodsInVehicleView) - case goodsOriginView: GoodsOriginView => render(goodsOriginView) - case goodsOverThresholdView: GoodsOverThresholdView => render(goodsOverThresholdView) - case goodsRemovedView: GoodsRemovedView => render(goodsRemovedView) - case goodsTypeView: GoodsTypeView => render(goodsTypeView) - case goodsVatRateView: GoodsVatRateView => render(goodsVatRateView) - case importExportChoice: ImportExportChoice => render(importExportChoice) - case journeyDetailsPage: JourneyDetailsPage => render(journeyDetailsPage) - case newOrExistingView: NewOrExistingView => render(newOrExistingView) - case noDeclarationNeededView: NoDeclarationNeededView => render(noDeclarationNeededView) - case paymentCalculationView: PaymentCalculationView => render(paymentCalculationView) - case previousDeclarationDetailsView: PreviousDeclarationDetailsView => render(previousDeclarationDetailsView) - case progressDeletedView: ProgressDeletedView => render(progressDeletedView) - case purchaseDetailsExportView: PurchaseDetailsExportView => render(purchaseDetailsExportView) - case purchaseDetailsImportView: PurchaseDetailsImportView => render(purchaseDetailsImportView) - case removeGoodsView: RemoveGoodsView => render(removeGoodsView) - case retrieveDeclarationView: RetrieveDeclarationView => render(retrieveDeclarationView) - case reviewGoodsView: ReviewGoodsView => render(reviewGoodsView) - case searchGoodsCountryView: SearchGoodsCountryView => render(searchGoodsCountryView) - case serviceTimeoutView: ServiceTimeoutView => render(serviceTimeoutView) - case testOnlyDeclarationJourneyPage: TestOnlyDeclarationJourneyPage => render(testOnlyDeclarationJourneyPage) - case travellerDetailsPage: TravellerDetailsPage => render(travellerDetailsPage) - case valueWeightOfGoodsView: ValueWeightOfGoodsView => render(valueWeightOfGoodsView) - case vehicleRegistrationNumberView: VehicleRegistrationNumberView => render(vehicleRegistrationNumberView) - case vehicleSizeView: VehicleSizeView => render(vehicleSizeView) - } - - runAccessibilityTests() -} diff --git a/build.sbt b/build.sbt index 8b6b9980..ff50d22c 100644 --- a/build.sbt +++ b/build.sbt @@ -23,4 +23,4 @@ lazy val it = project .dependsOn(microservice % "test->test") // the "test->test" allows reusing test code and test dependencies .settings(itSettings()) -addCommandAlias("scalafmtAll", "all scalafmtSbt scalafmt Test/scalafmt A11y/scalafmt it/Test/scalafmt") +addCommandAlias("scalafmtAll", "all scalafmtSbt scalafmt Test/scalafmt it/Test/scalafmt") diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index ffff5357..a83274fb 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -6,13 +6,13 @@ object AppDependencies { private val compile: Seq[ModuleID] = Seq( "uk.gov.hmrc" %% "bootstrap-frontend-play-30" % bootstrapVersion, - "uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "11.3.0", + "uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "11.5.0", "uk.gov.hmrc.mongo" %% "hmrc-mongo-play-30" % "2.3.0", "com.beachape" %% "enumeratum-play" % "1.8.2", "org.webjars.npm" % "accessible-autocomplete" % "3.0.0", "com.softwaremill.quicklens" %% "quicklens" % "1.9.9", "org.typelevel" %% "cats-core" % "2.12.0", - "io.github.samueleresca" %% "pekko-quartz-scheduler" % "1.2.2-pekko-1.0.x" + "io.github.samueleresca" %% "pekko-quartz-scheduler" % "1.3.0-pekko-1.1.x" ) private val test: Seq[ModuleID] = Seq( diff --git a/project/plugins.sbt b/project/plugins.sbt index db2cadd1..1c954cb5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,11 +3,10 @@ resolvers += Resolver.url("HMRC-open-artefacts-ivy2", url("https://open.artefact Resolver.ivyStylePatterns ) -addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.22.0") -addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0") -addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.5") -addSbtPlugin("io.github.irundaia" % "sbt-sassify" % "1.5.2") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.1") -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") -addSbtPlugin("uk.gov.hmrc" % "sbt-accessibility-linter" % "1.0.0") +addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.22.0") +addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0") +addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.5") +addSbtPlugin("io.github.irundaia" % "sbt-sassify" % "1.5.2") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.1") +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") diff --git a/run_all_tests.sh b/run_all_tests.sh index 3b61f019..59e4592c 100755 --- a/run_all_tests.sh +++ b/run_all_tests.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -sbt clean compile scalafmtAll coverage test it/test coverageOff coverageReport A11y/test dependencyUpdates +sbt clean compile scalafmtAll coverage test it/test coverageOff coverageReport dependencyUpdates From 23e9cda56448a296f7162ae7edb95108985bebd6 Mon Sep 17 00:00:00 2001 From: divya-manivannan-hmrc <175815017+Divya-Manivannan-hmrc@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:59:27 +0000 Subject: [PATCH 2/2] reverted "pekko-quartz-scheduler" to the original version and removed mention of a11y in README.md --- README.md | 2 +- project/AppDependencies.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30fe2b4f..222a279d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The stride roles for the admin mode are `tps_payment_taker_call_handler,digital_ ## Running Tests -To run unit tests, integration tests, a11y tests, scalafmt, coverage and check dependencies, execute the script: +To run unit tests, integration tests, scalafmt, coverage and check dependencies, execute the script: ```bash ./run_all_tests.sh diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index a83274fb..9db6cb5e 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -12,7 +12,7 @@ object AppDependencies { "org.webjars.npm" % "accessible-autocomplete" % "3.0.0", "com.softwaremill.quicklens" %% "quicklens" % "1.9.9", "org.typelevel" %% "cats-core" % "2.12.0", - "io.github.samueleresca" %% "pekko-quartz-scheduler" % "1.3.0-pekko-1.1.x" + "io.github.samueleresca" %% "pekko-quartz-scheduler" % "1.2.2-pekko-1.0.x" ) private val test: Seq[ModuleID] = Seq(