-
Notifications
You must be signed in to change notification settings - Fork 20
ADFA-2738 connectedV8DebugAndroidTest Part 2 of 3: onboarding repairs #1176
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
Merged
hal-eisen-adfa
merged 9 commits into
stage
from
ADFA-2738-connectedV8DebugAndroidTest-part2-projects
Apr 15, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2b68e91
Repairs for the onboarding flow
hal-eisen-adfa efe2786
CodeRabbit fixes
hal-eisen-adfa 3a96ccd
Another batch of CodeRabbit fixes
hal-eisen-adfa 38d0c6b
Refactor; import resource
hal-eisen-adfa 6660f48
Remove orchestrator
hal-eisen-adfa 65c80bd
Minor fixes
hal-eisen-adfa 3e87c95
Simplify animation logic
hal-eisen-adfa 324cae8
Restore missing close-curly-brace
hal-eisen-adfa 7d20d4a
Merge branch 'stage' into ADFA-2738-connectedV8DebugAndroidTest-part2…
hal-eisen-adfa 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 hidden or 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
200 changes: 200 additions & 0 deletions
200
app/src/androidTest/kotlin/com/itsaky/androidide/EndToEndTest.kt
This file contains hidden or 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,200 @@ | ||
| package com.itsaky.androidide | ||
|
|
||
| import androidx.test.core.app.ActivityScenario | ||
| import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled | ||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
| import androidx.test.platform.app.InstrumentationRegistry | ||
| import androidx.test.uiautomator.UiSelector | ||
| import com.itsaky.androidide.activities.SplashActivity | ||
| import com.itsaky.androidide.helper.advancePastWelcomeScreen | ||
| import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText | ||
| import com.itsaky.androidide.helper.grantAllRequiredPermissionsThroughOnboardingUi | ||
| import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi | ||
| import com.itsaky.androidide.resources.R as ResourcesR | ||
| import com.itsaky.androidide.screens.OnboardingScreen | ||
| import com.itsaky.androidide.screens.PermissionScreen | ||
| import com.itsaky.androidide.screens.PermissionsInfoScreen | ||
| import com.itsaky.androidide.utils.PermissionsHelper | ||
| import com.kaspersky.kaspresso.testcases.api.testcase.TestCase | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Assert.assertFalse | ||
| import org.junit.Assert.assertTrue | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
|
|
||
| /** | ||
| * Single continuous E2E test that drives the app from first launch through | ||
| * onboarding, project creation, builds, and beyond. | ||
| * | ||
| * The activity launches once and stays alive. Each stage is a Kaspresso | ||
| * `step()` so failures report exactly which stage broke. | ||
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| class EndToEndTest : TestCase() { | ||
|
|
||
| private val targetContext | ||
| get() = InstrumentationRegistry.getInstrumentation().targetContext | ||
|
|
||
| private val acceptText: String | ||
| get() = targetContext.getString(ResourcesR.string.privacy_disclosure_accept) | ||
|
|
||
| private val learnMoreText: String | ||
| get() = targetContext.getString(ResourcesR.string.privacy_disclosure_learn_more) | ||
|
|
||
| private val dialogTitle: String | ||
| get() = targetContext.getString(ResourcesR.string.privacy_disclosure_title) | ||
|
|
||
| @Test | ||
| fun test_endToEnd() = run { | ||
|
|
||
| // ── Launch ── | ||
|
|
||
| step("Launch app") { | ||
| ActivityScenario.launch(SplashActivity::class.java) | ||
| Thread.sleep(1000) | ||
| } | ||
|
|
||
| // ── Welcome Screen ── | ||
|
|
||
| step("Verify welcome screen") { | ||
| OnboardingScreen { | ||
| greetingTitle.isVisible() | ||
| greetingSubtitle.isVisible() | ||
| nextButton { | ||
| isVisible() | ||
| isClickable() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| advancePastWelcomeScreen() | ||
|
|
||
| // ── Permissions Info Screen ── | ||
|
|
||
| step("Verify privacy disclosure dialog") { | ||
| val d = device.uiDevice | ||
| val title = d.findObject(UiSelector().text(dialogTitle)) | ||
| assertTrue("Dialog title missing", title.waitForExists(2_000)) | ||
| assertTrue("Accept button missing", d.findObject(UiSelector().text(acceptText)).exists()) | ||
| assertTrue("Learn more button missing", d.findObject(UiSelector().text(learnMoreText)).exists()) | ||
| } | ||
|
|
||
| step("Accept privacy disclosure") { | ||
| clickFirstAccessibilityNodeByText(acceptText) | ||
| device.uiDevice.waitForIdle() | ||
| } | ||
|
|
||
| step("Verify permissions info content") { | ||
| flakySafely(timeoutMs = 2_000) { | ||
| PermissionsInfoScreen { | ||
| introText { isVisible() } | ||
| permissionsList { isVisible() } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| step("Verify NEXT button on permissions info") { | ||
| OnboardingScreen.nextButton { isVisible(); isClickable() } | ||
| } | ||
|
|
||
| step("Verify privacy dialog does not reappear") { | ||
| assertFalse( | ||
| "Dialog should not reappear", | ||
| device.uiDevice.findObject(UiSelector().text(dialogTitle)).exists(), | ||
| ) | ||
| } | ||
|
|
||
| // ── Permissions Screen ── | ||
|
|
||
| step("Advance to permissions list") { | ||
| val d = device.uiDevice | ||
| val nextObj = d.findObject(UiSelector().descriptionContains("NEXT")) | ||
| if (!nextObj.waitForExists(3_000)) { | ||
| throw AssertionError("NEXT button not found on permissions info slide") | ||
| } | ||
| clickFirstAccessibilityNodeByText( | ||
| searchText = "NEXT", | ||
| errorLabel = "NEXT", | ||
| matchBy = { node -> | ||
| val desc = node.contentDescription?.toString() ?: "" | ||
| val text = node.text?.toString() ?: "" | ||
| desc.contains("NEXT", ignoreCase = true) || text.contains("NEXT", ignoreCase = true) | ||
| }, | ||
| ) | ||
| d.waitForIdle() | ||
| } | ||
|
|
||
| val required = PermissionsHelper.getRequiredPermissions(targetContext) | ||
|
|
||
| step("Verify all permission items") { | ||
| flakySafely(timeoutMs = 3_000) { | ||
| PermissionScreen { | ||
| title { isVisible() } | ||
| subTitle { isVisible() } | ||
| rvPermissions { | ||
| isVisible() | ||
| isDisplayed() | ||
| } | ||
| assertEquals(required.size, rvPermissions.getSize()) | ||
|
|
||
| rvPermissions { | ||
| required.forEachIndexed { index, item -> | ||
| childAt<PermissionScreen.PermissionItem>(index) { | ||
| title { | ||
| isVisible() | ||
| hasText(item.title) | ||
| } | ||
| description { | ||
| isVisible() | ||
| hasText(item.description) | ||
| } | ||
| grantButton { | ||
| isVisible() | ||
| isClickable() | ||
| hasText(R.string.title_grant) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| grantAllRequiredPermissionsThroughOnboardingUi() | ||
|
|
||
| step("Confirm all permissions granted") { | ||
| flakySafely(timeoutMs = 3_000) { | ||
| assertTrue(PermissionsHelper.areAllPermissionsGranted(targetContext)) | ||
| } | ||
| } | ||
|
|
||
| step("Confirm all grant buttons disabled") { | ||
| device.uiDevice.waitForIdle() | ||
| PermissionScreen { | ||
| rvPermissions { | ||
| required.indices.forEach { index -> | ||
| childAt<PermissionScreen.PermissionItem>(index) { | ||
| grantButton { | ||
| isNotEnabled() | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| step("Tap Finish installation") { | ||
| // The button is in the gesture exclusion zone — use accessibility click | ||
| clickFirstAccessibilityNodeByText("Finish installation") | ||
| } | ||
|
|
||
| step("Wait for IDE setup to complete") { | ||
| waitForMainHomeOrEditorUi( | ||
| device.uiDevice, | ||
| maxWaitMs = 60_000L, | ||
| ) | ||
| } | ||
|
|
||
| // ── Future phases (project creation, builds, preferences) go here ── | ||
| } | ||
| } | ||
This file contains hidden or 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
132 changes: 0 additions & 132 deletions
132
app/src/androidTest/kotlin/com/itsaky/androidide/PermissionsScreenTest.kt
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.