Closed bencestab closed 9 months ago
URL of codelab
https://developer.android.com/codelabs/android-basics-kotlin-write-instrumentation-tests?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fandroid-basics-kotlin-write-instrumentation-tests#3
In which task and step of the codelab can this issue be found?
package com.example.tiptime
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.action.ViewActions.typeText import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 import org.hamcrest.Matchers.containsString import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class) class CalculatorTests {
@get:Rule() val activity = ActivityScenarioRule(MainActivity::class.java)
@Test fun calculate_20_percent_tip() { onView(withId(R.id.cost_of_service_edit_text)) .perform(typeText("50.00"))
onView(withId(R.id.calculate_button)).perform(click()) onView(withId(R.id.tip_result)) .check(matches(withText(containsString("$10.00"))))
} }
Describe the problem
a step is missing from the @Test :
.perform(ViewActions.closeSoftKeyboard())
Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.
URL of codelab
https://developer.android.com/codelabs/android-basics-kotlin-write-instrumentation-tests?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fandroid-basics-kotlin-write-instrumentation-tests#3
In which task and step of the codelab can this issue be found?
package com.example.tiptime
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.action.ViewActions.typeText import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 import org.hamcrest.Matchers.containsString import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class) class CalculatorTests {
@get:Rule() val activity = ActivityScenarioRule(MainActivity::class.java)
@Test fun calculate_20_percent_tip() { onView(withId(R.id.cost_of_service_edit_text)) .perform(typeText("50.00"))
} }
Describe the problem
a step is missing from the @Test :
.perform(ViewActions.closeSoftKeyboard())
Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.