We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Correspond StackOverflow - https://stackoverflow.com/questions/79328816/startactivity-on-external-application-not-bring-it-foreground-in-task-of-testi
Think - it's my own lack of knowledge, but may be it's bug
Phone: POCO X3 Pro, Android version: 11 RKQ1.200826.002, MIUI 12.5.6
In AndroidManifest.xml i quiry visibility of external package
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <application>...</application> <queries> <package android:name="client.app" /> <!-- real package here --> </queries> </manifest>
So, PackageManager now allows to navigate to required package
In tests:
package my.app import android.util.Log import com.kaspersky.components.kautomator.component.text.UiButton import com.kaspersky.components.kautomator.screen.UiScreen import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test class ClientAppTest: TestCase() { val clientPackage = "client.app" object ClientAppScreen : UiScreen<ClientAppScreen >() { override val packageName: String = clientPackage val someButton = UiButton{withText("Some")} } @Test fun testPlus() = run { step("Open Rosneft") { with(device.targetContext) { val intent = packageManager.getLaunchIntentForPackage(clientPackage) intent!!.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) startActivity(intent) } ClientAppScreen{ someButton.isEnabled() someButton.click() } } } }
If not to do intent!!.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - it will be failed - required for application extra to current context.
intent!!.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
Problem is that application somehow "started" but not shown in foreground. So tests failed
If i manually launch application and bring it to front - test pass.
Other links in StackOverflow not cover problem for me
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Correspond StackOverflow - https://stackoverflow.com/questions/79328816/startactivity-on-external-application-not-bring-it-foreground-in-task-of-testi
Think - it's my own lack of knowledge, but may be it's bug
Phone: POCO X3 Pro, Android version: 11 RKQ1.200826.002, MIUI 12.5.6
In
AndroidManifest.xml
i quiry visibility of external packageSo, PackageManager now allows to navigate to required package
In tests:
If not to do
intent!!.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- it will be failed - required for application extra to current context.Problem is that application somehow "started" but not shown in foreground.
So tests failed
If i manually launch application and bring it to front - test pass.
Other links in StackOverflow not cover problem for me
The text was updated successfully, but these errors were encountered: