-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpeziOnboarding #129
Open
pauljohanneskraft
wants to merge
56
commits into
main
Choose a base branch
from
feature/spezi-onboarding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SpeziOnboarding #129
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
5e86439
SpeziOnboarding
pauljohanneskraft f8530e9
Merge branch 'main' into feature/spezi-onboarding
pauljohanneskraft bfc3a6f
update
pauljohanneskraft 6407397
Merge branch 'main' into feature/spezi-onboarding
Basler182 aaf29df
SpeziViews
pauljohanneskraft 11efb05
intermediate
pauljohanneskraft 5fa1c8d
Update SuspendButton implementation
pauljohanneskraft 37159b8
Update tests for PersonalInfo
pauljohanneskraft f3f516b
Finish up SpeziViews
pauljohanneskraft 306b46b
Rename test
pauljohanneskraft dc8133b
Fix import issues
pauljohanneskraft 4258420
Remove import issues
pauljohanneskraft e3baa1b
Add import
pauljohanneskraft 0a94bc5
Move files into the correct repositories
pauljohanneskraft 40601b4
Rename package
pauljohanneskraft 728e534
Remove nonimported usages of PersonNameComponents
pauljohanneskraft 7928eb2
Update previews
pauljohanneskraft d974d16
fix imports
pauljohanneskraft 5143693
detekt
pauljohanneskraft 2c8e57b
Fix tests
pauljohanneskraft 10a2543
fix
pauljohanneskraft 5c2d056
Update
pauljohanneskraft 6f5b66c
review adaptions
pauljohanneskraft e02bad3
tests
pauljohanneskraft 0a0fc2f
adapt tests
pauljohanneskraft 35f5076
update
pauljohanneskraft 307d84c
Adapt contact
pauljohanneskraft fcda9c7
Add modifier parameters
pauljohanneskraft 088e66f
Fix tests
pauljohanneskraft 2207da9
detekt
pauljohanneskraft c84e748
update
pauljohanneskraft d184b64
adapt tests
pauljohanneskraft 58dc269
small update
pauljohanneskraft 858c75f
Make sure to only trigger validation after the first input
pauljohanneskraft f3af7e3
detekt
pauljohanneskraft ace70d4
Add onSubmit
pauljohanneskraft 1e2b0a9
Merge branch 'feature/spezi-views' into feature/spezi-onboarding
pauljohanneskraft d61539f
detekt
pauljohanneskraft 7a94909
Merge completed
pauljohanneskraft f4bcd7a
Improve onboarding
pauljohanneskraft e3a1791
Add current state of SpeziOnboarding
pauljohanneskraft 7287d9a
Merge branch 'main' into feature/spezi-onboarding
pauljohanneskraft 3e83e41
detekt
pauljohanneskraft e34fccd
Update OnboardingTests
pauljohanneskraft 758b44c
Use IllegalOnboardingStep
pauljohanneskraft 3ca3568
Remove empty tests
pauljohanneskraft 3b9e3c2
Update Consent
pauljohanneskraft 602b794
Make it build
pauljohanneskraft b8af94b
Reduce changes
pauljohanneskraft 4e6e3ee
Bring back some old functionality
pauljohanneskraft b810c92
Remove unused type
pauljohanneskraft 7759e92
Remove consent from ENGAGE-HF
pauljohanneskraft bc9663c
Remove tests
pauljohanneskraft 2c4e8a7
update tests
pauljohanneskraft 32746ae
detekt
pauljohanneskraft 4eb35c8
Merge branch 'main' into feature/spezi-onboarding
pauljohanneskraft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
30 changes: 0 additions & 30 deletions
30
app/src/main/kotlin/edu/stanford/bdh/engagehf/onboarding/EngageConsentManager.kt
This file was deleted.
Oops, something went wrong.
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
70 changes: 0 additions & 70 deletions
70
app/src/test/kotlin/edu/stanford/bdh/engagehf/onboarding/EngageConsentManagerTest.kt
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
core/utils/src/main/kotlin/edu/stanford/spezi/core/utils/Standard.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,3 @@ | ||
package edu.stanford.spezi.core.utils | ||
|
||
interface Standard | ||
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
82 changes: 82 additions & 0 deletions
82
...rc/androidTest/kotlin/edu/stanford/spezi/module/onboarding/spezi/DynamicOnboardingTest.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,82 @@ | ||
package edu.stanford.spezi.module.onboarding.spezi | ||
|
||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import edu.stanford.spezi.module.onboarding.spezi.composables.DynamicOnboardingTestComposable | ||
import edu.stanford.spezi.module.onboarding.spezi.simulators.DynamicOnboardingSimulator | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class DynamicOnboardingTest { | ||
|
||
@get:Rule | ||
val composeRule = createComposeRule() | ||
|
||
@Before | ||
fun init() { | ||
composeRule.setContent { | ||
DynamicOnboardingTestComposable() | ||
} | ||
} | ||
|
||
@Test | ||
fun testDynamicOnboardingFlowONE() { | ||
dynamicOnboarding { | ||
assertTextExists("START") | ||
clickButton("ONE") | ||
assertTextExists("TITLE: ONE") | ||
clickButton("Next") | ||
assertTextExists("TITLE: TWO") | ||
clickButton("Next") | ||
assertTextExists("Done") | ||
assertTextExists("Dynamic Onboarding done!") | ||
} | ||
} | ||
|
||
@Test | ||
fun testDynamicOnboardingFlowTWO() { | ||
dynamicOnboarding { | ||
assertTextExists("START") | ||
clickButton("TWO") | ||
assertTextExists("TITLE: TWO") | ||
clickButton("Next") | ||
assertTextExists("Done") | ||
assertTextExists("Dynamic Onboarding done!") | ||
} | ||
} | ||
|
||
@Test | ||
fun testDynamicOnboardingFlowTHREE() { | ||
dynamicOnboarding { | ||
assertTextExists("START") | ||
clickButton("THREE") | ||
assertTextExists("TITLE: THREE") | ||
clickButton("Next") | ||
assertTextExists("TITLE: ONE") | ||
clickButton("Next") | ||
assertTextExists("TITLE: TWO") | ||
clickButton("Next") | ||
assertTextExists("Done") | ||
assertTextExists("Dynamic Onboarding done!") | ||
} | ||
} | ||
|
||
@Test | ||
fun testDynamicOnboardingFlowNext() { | ||
dynamicOnboarding { | ||
assertTextExists("START") | ||
clickButton("Next") | ||
composeRule.waitForIdle() | ||
assertTextExists("TITLE: ONE") | ||
clickButton("Next") | ||
assertTextExists("TITLE: TWO") | ||
clickButton("Next") | ||
assertTextExists("Done") | ||
assertTextExists("Dynamic Onboarding done!") | ||
} | ||
} | ||
|
||
private fun dynamicOnboarding(block: DynamicOnboardingSimulator.() -> Unit) { | ||
DynamicOnboardingSimulator(composeRule).apply { block() } | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
...androidTest/kotlin/edu/stanford/spezi/module/onboarding/spezi/SequentialOnboardingTest.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,80 @@ | ||
package edu.stanford.spezi.module.onboarding.spezi | ||
|
||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import edu.stanford.spezi.module.onboarding.spezi.composables.SequentialOnboardingTestComposable | ||
import edu.stanford.spezi.module.onboarding.spezi.simulators.SequentialOnboardingSimulator | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class SequentialOnboardingTest { | ||
|
||
@get:Rule | ||
val composeRule = createComposeRule() | ||
|
||
@Before | ||
fun init() { | ||
composeRule.setContent { | ||
SequentialOnboardingTestComposable() | ||
} | ||
} | ||
|
||
@Test | ||
fun testSequentialOnboarding() { | ||
sequentialOnboarding { | ||
assertTextExists("Things to know") | ||
assertTextExists("And you should pay close attention ...") | ||
|
||
assertTextExists("1") | ||
assertTextExists("A thing to know") | ||
assertTextDoesNotExist("2") | ||
assertTextDoesNotExist("Second thing to know") | ||
assertTextDoesNotExist("3") | ||
assertTextDoesNotExist("Third thing to know") | ||
assertTextDoesNotExist("4") | ||
assertTextDoesNotExist("Now you should know all the things!") | ||
|
||
clickButton("Next") | ||
|
||
assertTextExists("1") | ||
assertTextExists("A thing to know") | ||
assertTextExists("2") | ||
assertTextExists("Second thing to know") | ||
assertTextDoesNotExist("3") | ||
assertTextDoesNotExist("Third thing to know") | ||
assertTextDoesNotExist("4") | ||
assertTextDoesNotExist("Now you should know all the things!") | ||
|
||
clickButton("Next") | ||
|
||
assertTextExists("1") | ||
assertTextExists("A thing to know") | ||
assertTextExists("2") | ||
assertTextExists("Second thing to know") | ||
assertTextExists("3") | ||
assertTextExists("Third thing to know") | ||
assertTextDoesNotExist("4") | ||
assertTextDoesNotExist("Now you should know all the things!") | ||
|
||
clickButton("Next") | ||
|
||
assertTextExists("1") | ||
assertTextExists("A thing to know") | ||
assertTextExists("2") | ||
assertTextExists("Second thing to know") | ||
assertTextExists("3") | ||
assertTextExists("Third thing to know") | ||
assertTextExists("4") | ||
assertTextExists("Now you should know all the things!") | ||
|
||
clickButton("Continue") | ||
|
||
assertTextExists("Done") | ||
assertTextExists("Sequential Onboarding done!") | ||
} | ||
} | ||
|
||
private fun sequentialOnboarding(block: SequentialOnboardingSimulator.() -> Unit) { | ||
SequentialOnboardingSimulator(composeRule).apply { block() } | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...rc/androidTest/kotlin/edu/stanford/spezi/module/onboarding/spezi/WelcomeOnboardingTest.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,50 @@ | ||
package edu.stanford.spezi.module.onboarding.spezi | ||
|
||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import edu.stanford.spezi.module.onboarding.spezi.composables.WelcomeOnboardingTestComposable | ||
import edu.stanford.spezi.module.onboarding.spezi.simulators.WelcomeOnboardingSimulator | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class WelcomeOnboardingTest { | ||
|
||
@get:Rule | ||
val composeRule = createComposeRule() | ||
|
||
@Before | ||
fun init() { | ||
composeRule.setContent { | ||
WelcomeOnboardingTestComposable() | ||
} | ||
} | ||
|
||
@Test | ||
fun testWelcomeOnboarding() { | ||
welcomeOnboarding { | ||
assertTextExists("Welcome") | ||
assertTextExists("Spezi UI Tests") | ||
|
||
assertTextExists("Tortoise") | ||
assertTextExists("A Tortoise!") | ||
|
||
assertTextExists("Tree") | ||
assertTextExists("A Tree!") | ||
|
||
assertTextExists("Letter") | ||
assertTextExists("A letter!") | ||
|
||
assertTextExists("Circle") | ||
assertTextExists("A circle!") | ||
|
||
clickButton("Learn More") | ||
|
||
assertTextExists("Done") | ||
assertTextExists("Welcome Onboarding done!") | ||
} | ||
} | ||
|
||
private fun welcomeOnboarding(block: WelcomeOnboardingSimulator.() -> Unit) { | ||
WelcomeOnboardingSimulator(composeRule).apply { block() } | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please start creating correct modules as part of this PR already, you can use the script that I have shared. In iOS this is defined under Spezi package. Create a module under
modules:spezi
and define this interface there, and addmodules:spezi
dependency where you need thisThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to wait for this until SpeziAccount is merged, hope that's fine. Especially, I would want them to be self-contained (if this makes sense), i.e. to have no dependencies outside of their own package ecosystem and that will most likely mean that we will need to put some stuff into the packages that do not exist in the iOS version and that are Android-specific (e.g. SpeziTheme, etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I can do, is simply creating a single package for this interface, so that it isn't part of core:utils, if that's good enough