When I am trying to use Espresso or any testing for that matter I get an error that there are no tests found even though I have one written.
I have tried multiple different formats for this test and none of them are working. The example test in Android Studio throws the same error.
I am pretty new to testing and I am not sure if I am confusing JUnit testing and Espresso together. I would like to figure out how to use Espresso but I know my current tests are simple enough to simply use a JUnit.
@RunWith(AndroidJUnit4.class)
@LargeTest
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestCaseA {
@Rule
public IntentsTestRule mActivityRule =
new IntentsTestRule<>(homeLobby.class);
@Before
public void setUp() throws Exception {
}
@Test
public void testEnsureIntentStarted() throws InterruptedException {
onView(withId(R.id.buttonGame)).perform(click());
assert( (Game.class.getName()).equals("Game"));
System.out.print("TEST");
}
@After
public void tearDown() throws Exception {
//After Test case Execution
}
}
I am trying to get a simple test working to ensure I have Espresso set up properly but I am getting the error
junit.framework.AssertionFailedError: No tests found in package.TestCaseA
The information I have in the build.gradle is as follows
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'org.java-websocket:Java-WebSocket:1.4.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
}
Aucun commentaire:
Enregistrer un commentaire