square / assertj-android

A set of AssertJ helpers geared toward testing Android.
https://square.github.io/assertj-android/
Apache License 2.0
1.58k stars 156 forks source link

assertThat Compilation Error with Text View #81

Closed aaalaniz closed 11 years ago

aaalaniz commented 11 years ago

I'm currently trying to integrate FEST with robolectric on my project. I succeeded in enabling robolectric but when I try to integrate FEST with one of my text views. I get the following:

java: cannot access android.animation.Animator class file for android.animation.Animator not found

The unit test looks as follows:

    @Test
    public void textViewVisible() {
        TextView textView = (TextView) mActivity.findViewById(R.id.my_id);
        assertThat(textView).isVisible()
                .hasCurrentTextColor(Color.parseColor("#34a7ff"))
                .containsText("1");
    }

I'm using Intellij and my module sdk is Android 2.3.3 Google Apis

JakeWharton commented 11 years ago

You have to compile with at least API 14 because of how the method lookup works.

aaalaniz commented 11 years ago

I switched to Android 4.1.2 and I now get the following:

java: cannot access org.fest.assertions.api.AbstractAssert class file for org.fest.assertions.api.AbstractAssert not found

JakeWharton commented 11 years ago

Looks like you need to fest-assert-core (and whatever dependencies it has) as well.

aaalaniz commented 11 years ago

Awesome. That worked. Thanks!