java: Implement Initial TDD for further testing purposes

This commit is contained in:
rafal1137 2020-06-16 15:48:23 +02:00
parent 1a8ba6767a
commit a868cb2803
2 changed files with 43 additions and 0 deletions

View File

@ -29,6 +29,7 @@ android {
// libraries Gradle should build and package with your APK.
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
@ -70,5 +71,10 @@ dependencies {
api 'com.github.erz05:JoyStick:1.1.0'
implementation 'com.loopj.android:android-async-http:1.4.10'
implementation 'com.google.guava:guava:29.0-android'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.0'
androidTestImplementation 'com.android.support.test:runner:0.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
}

View File

@ -0,0 +1,37 @@
package org.etlegacy.app;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.robotium.solo.Solo;
import static org.junit.Assert.assertEquals;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class TestETL {
private Solo solo;
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("org.etlegacy.app", appContext.getPackageName());
}
@Test
public void clickOnNickEntry() throws Exception {
// Perform click on Nickname Entry
// TODO: Implement
}
}