dimanche 3 mai 2020

Test Driven development Databinding xml view not found

I am trying to learn some TDD and in my main_activity layout I included the

Here is my simple test

class MainActivityTest {

        @JvmField
        var rule = ActivityTestRule(MainActivity::class.java)

        //button test we do not to test text views in this concept
        @Test
        fun openDictionaryButtonTest(){
            onView(withId(R.id.open_dictionary_button)).perform(click())

        }



    } 

I know I am missing something, xml

<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">


        <!--button used to start the dictionary -->
        <Button
            android:id="@+id/open_dictionary_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           />

Aucun commentaire:

Enregistrer un commentaire