-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from cucumber/allow_field_injection_of_hooks_…
…in_hilt Allow field injection of hooks in HiltObjectFactory
- Loading branch information
Showing
15 changed files
with
116 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
cucumber-android-hilt/src/test/java/io/cucumber/android/hilt/SomeCucumberHook.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.cucumber.android.hilt | ||
|
||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class SomeCucumberHook @Inject constructor() { | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
cucumber-android-hilt/src/test/java/io/cucumber/android/hilt/StepsWithBaseClass.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.cucumber.android.hilt | ||
|
||
import dagger.hilt.android.testing.HiltAndroidTest | ||
import javax.inject.Inject | ||
|
||
abstract class BaseSteps { | ||
|
||
@Inject | ||
lateinit var someCucumberHook: SomeCucumberHook | ||
|
||
@Inject | ||
lateinit var someDependencies: SomeDependencies | ||
} | ||
|
||
@HiltAndroidTest | ||
class StepsWithBaseClass:BaseSteps() { | ||
@Inject | ||
lateinit var someSingletonDependency: SomeSingletonDependency | ||
} |
1 change: 0 additions & 1 deletion
1
cucumber-android-hilt/src/test/resources/robolectric.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
sdk=33 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
sdk=33 | ||
shadows=io.cucumber.android.shadows.ExtendedShadowPackageManager,io.cucumber.android.shadows.ShadowDexFile |
1 change: 0 additions & 1 deletion
1
cucumber-junit-rules-support/src/test/resources/robolectric.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
sdk=33 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
cukeulator/src/androidTest/java/cucumber/cukeulator/test/BaseKotlinSteps.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cucumber.cukeulator.test | ||
|
||
import androidx.compose.ui.test.SemanticsMatcher | ||
import androidx.compose.ui.test.SemanticsNodeInteraction | ||
import androidx.compose.ui.test.SemanticsNodeInteractionCollection | ||
import androidx.compose.ui.test.SemanticsNodeInteractionsProvider | ||
import cucumber.cukeulator.GreetingService | ||
import javax.inject.Inject | ||
|
||
abstract class BaseKotlinSteps: SemanticsNodeInteractionsProvider { | ||
|
||
@Inject | ||
lateinit var composeRuleHolder: ComposeRuleHolder | ||
|
||
@Inject | ||
lateinit var greetingService: GreetingService | ||
|
||
override fun onAllNodes(matcher: SemanticsMatcher, useUnmergedTree: Boolean): SemanticsNodeInteractionCollection { | ||
return composeRuleHolder.composeRule.onAllNodes(matcher, useUnmergedTree) | ||
} | ||
|
||
override fun onNode(matcher: SemanticsMatcher, useUnmergedTree: Boolean): SemanticsNodeInteraction { | ||
return composeRuleHolder.composeRule.onNode(matcher, useUnmergedTree) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters