package de.nenick.espressomacchiato.elements;

import android.widget.TextView;

import org.junit.Before;
import org.junit.Test;

import de.nenick.espressomacchiato.test.views.BaseActivity;
import de.nenick.espressomacchiato.testbase.EspressoTestCase;

public class EspTextViewTest extends EspressoTestCase<BaseActivity> {

    private String textViewText = "my text";
    private int textViewId = android.R.id.text1;
    private EspTextView espTextView = EspTextView.byId(textViewId);

    @Before
    public void setup() {
        TextView textView = new TextView(activityTestRule.getActivity());
        textView.setId(textViewId);
        textView.setText(textViewText);
        textView.setTextColor(0xff000000);
        addViewToLayout(textView, BaseActivity.rootLayout);
    }

    @Test
    public void testReplaceText() {
        espTextView.assertTextIs(textViewText);
    }

    @Test
    public void testByText() {
        espTextView = EspTextView.byText(textViewText);
    }

    @Test
    public void testAssertTextColorIs() {
        espTextView.assertTextColorIs(0xff000000);
    }

    @Test
    public void testAssertTextColorResIs() {
        espTextView.assertTextColorResIs(android.R.color.black);
    }
}
@@ -967,32 +967,265 @@
 (textViewText);%0A
+        espTextView.assertIsDisplayedOnScreen();%0A    %7D%0A%0A    @Test%0A    public void testByAll() %7B%0A        espTextView = EspTextView.byAll().withId(textViewId).withIsDisplayed().build();%0A        espTextView.assertIsDisplayedOnScreen();%0A
     %7D%0A%0A    @Test

add test byAll matcher