diff --git a/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt b/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt index 592c931af1..5dfc98ec8c 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt @@ -62,12 +62,12 @@ const val HTTP_NOT_FOUND = 404 class AndroidAssetDispatcher : Dispatcher() { private val mainThreadHandler = Handler(Looper.getMainLooper()) - override fun dispatch(request: RecordedRequest): MockResponse { + override fun dispatch(request: RecordedRequest?): MockResponse { val assetManager = InstrumentationRegistry.getInstrumentation().context.assets try { - val pathNoLeadingSlash = request.path.drop(1) - assetManager.open(pathNoLeadingSlash).use { inputStream -> - return fileToResponse(pathNoLeadingSlash, inputStream) + val pathWithoutQueryParams = Uri.parse(request?.path?.drop(1)).path + assetManager.open(pathWithoutQueryParams!!).use { inputStream -> + return fileToResponse(pathWithoutQueryParams, inputStream) } } catch (e: IOException) { // e.g. file not found. // We're on a background thread so we need to forward the exception to the main thread. diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt index cb017834e2..8acb984318 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt @@ -140,7 +140,6 @@ class SettingsPrivacyTest { } @Test - @Ignore("Passes locally, fails on CI. Fix in https://github.com/mozilla-mobile/fenix/issues/9189") fun saveLoginFromPromptTest() { val saveLoginTest = TestAssetHelper.getSaveLoginAsset(mockWebServer) @@ -166,7 +165,6 @@ class SettingsPrivacyTest { } @Test - @Ignore("Passes locally, fails on CI. Fix in https://github.com/mozilla-mobile/fenix/issues/9189") fun doNotSaveLoginFromPromptTest() { val saveLoginTest = TestAssetHelper.getSaveLoginAsset(mockWebServer)