Skip to content
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

Test the Cupcake app: Android Basics with Compose #116

Open
LaEntropiaa opened this issue Nov 10, 2024 · 0 comments
Open

Test the Cupcake app: Android Basics with Compose #116

LaEntropiaa opened this issue Nov 10, 2024 · 0 comments

Comments

@LaEntropiaa
Copy link

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-test-cupcake?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-4-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-test-cupcake#4

In which task and step of the codelab can this issue be found?
In the task number 5, almost at the end of it

Describe the problem
Its not a big problem but the tests solutions the codelabs tells you to do on your own differ from the solution cod, for example:

See if you can write the tests to verify the following navigation states. Try implementing them on your own before looking at the solution.

  • Navigating to the Start screen by clicking the Up button from the Flavor screen
    (For this example you navigate from Flavor Screen to Start Screen, going back in the navigation)

@test
fun cupcakeNavHost_clickNextOnFlavorScreen_navigatesToPickupScreen() {
navigateToFlavorScreen()
composeTestRule.onNodeWithStringId(R.string.next)
.performClick()
navController.assertCurrentRouteName(CupcakeScreen.Pickup.name)
}

(The solution code provided navigates from Flavor Screen to PickUp Screen, goig up in the navigation)

As i said is not a big deal and only occurs with 2 of the test solutions

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant