Skip to content

Commit

Permalink
Merge pull request #239 from SwEnt-Group13/test/event-creation-e2e
Browse files Browse the repository at this point in the history
Test/event creation e2e
  • Loading branch information
Zafouche authored Dec 5, 2024
2 parents 9b4bc97 + 3c301fb commit 429d88a
Show file tree
Hide file tree
Showing 11 changed files with 399 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ dependencies {
implementation(libs.firebase.functions.ktx)
implementation(libs.play.services.location)
implementation(libs.firebase.messaging.ktx)
implementation(libs.androidx.espresso.contrib)

testImplementation(libs.test.core.ktx)
debugImplementation(libs.androidx.ui.tooling)
Expand Down
7 changes: 7 additions & 0 deletions app/src/androidTest/java/com/android/unio/HiltTestUtility.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.android.unio

import android.app.Application
import android.content.Context
import android.os.Bundle
import android.os.StrictMode
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.runner.AndroidJUnitRunner
import com.android.unio.end2end.EndToEndTest
Expand All @@ -13,6 +15,11 @@ import dagger.hilt.android.testing.HiltTestApplication
* configure the test application for Hilt.
*/
class HiltApplication : AndroidJUnitRunner() {
override fun onCreate(arguments: Bundle) {
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().permitAll().build())
super.onCreate(arguments)
}

override fun newApplication(cl: ClassLoader?, name: String?, context: Context?): Application {
return super.newApplication(cl, HiltTestApplication::class.java.name, context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ class EventCreationTest : TearDown() {

composeTestRule.waitUntil(10000) {
composeTestRule
.onNodeWithTag(EventCreationTestTags.LOCATION_SUGGESTION_ITEM + "45.512331")
.onNodeWithTag(EventCreationTestTags.LOCATION_SUGGESTION_ITEM_LATITUDE + "45.512331")
.isDisplayed()
}

composeTestRule
.onNodeWithTag(EventCreationTestTags.LOCATION_SUGGESTION_ITEM + "45.512331")
.onNodeWithTag(EventCreationTestTags.LOCATION_SUGGESTION_ITEM_LATITUDE + "45.512331")
.performClick()

composeTestRule.waitForIdle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ open class EndToEndTest : FirebaseEmulatorFunctions {
}

@After
fun tearDown() {
override fun tearDown() {
clearTest()
}

Expand Down
Loading

0 comments on commit 429d88a

Please sign in to comment.