lundi 4 février 2019

Can't to use import android.support.test.rule.ActivityTestRule

How I can to solve this problem:

In line "import android.support.test.rule.ActivityTestRule;" word "rule" is red

and in line words "ActivityTestRule" also are red

public ActivityTestRule mActivityRule = new ActivityTestRule(AuthorizationPresenter.class);

package by.hjhj;

import android.support.test.espresso.NoMatchingViewException;
import android.support.test.rule.ActivityTestRule;



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


import by.belinvestbank.presenter.authorization.AuthorizationPresenter;

public class Authorization {

    @Rule
    public ActivityTestRule<AuthorizationPresenter> mActivityRule = new ActivityTestRule(AuthorizationPresenter.class);

    @Before
    public void SetUp()throws Exception{
        Thread.sleep(4000);
        try {
            onView(allOf(withId(R.id.login),(isDisplayed()))).check(matches(isDisplayed()));
        }
        catch (NoMatchingViewException e) {
            pressBack();

        }
    }
}

Aucun commentaire:

Enregistrer un commentaire