mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-30 08:00:24 +00:00
play around with UI-Tests
This commit is contained in:
parent
dd1fbe86ea
commit
ce20d1f2bd
3 changed files with 11 additions and 5 deletions
|
@ -72,6 +72,7 @@ dependencies {
|
|||
androidTestCompile ('com.android.support.test:runner:0.5') {
|
||||
exclude module: 'support-annotations'
|
||||
}
|
||||
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
|
||||
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
|
||||
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.6.0'
|
||||
androidTestCompile group: 'commons-io', name: 'commons-io', version: '2.0.1'
|
||||
|
|
|
@ -4,6 +4,7 @@ package de.nicidienase.chaosflix;
|
|||
import android.content.Intent;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.support.test.uiautomator.UiDevice;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -19,6 +20,8 @@ import de.nicidienase.chaosflix.activities.ConferencesActivity;
|
|||
import de.nicidienase.chaosflix.network.MediaApiService;
|
||||
import okhttp3.mockwebserver.MockWebServer;
|
||||
|
||||
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
||||
|
||||
@LargeTest
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ConferencesActivityTest {
|
||||
|
@ -27,10 +30,13 @@ public class ConferencesActivityTest {
|
|||
public ActivityTestRule<ConferencesActivity> mActivityTestRule
|
||||
= new ActivityTestRule<>(ConferencesActivity.class, false, false);
|
||||
private static MockWebServer server;
|
||||
private UiDevice mDevice;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException, TimeoutException {
|
||||
mDevice = UiDevice.getInstance(getInstrumentation());
|
||||
|
||||
server = new MockWebServer();
|
||||
server.start();
|
||||
String serverUrl = server.url("").toString();
|
||||
|
@ -45,10 +51,9 @@ public class ConferencesActivityTest {
|
|||
|
||||
@Test
|
||||
public void conferencesActivityTest() throws InterruptedException {
|
||||
while(true){
|
||||
|
||||
}
|
||||
|
||||
mDevice.pressDPadRight();
|
||||
mDevice.pressDPadRight();
|
||||
mDevice.pressDPadCenter();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class MediaApiServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test1() throws IOException {
|
||||
public void testStreamingConferences() throws IOException {
|
||||
server.enqueue(TestHelper.getResponseForRaw(R.raw.streams_v2_json));
|
||||
|
||||
service.getStreamingConferences()
|
||||
|
|
Loading…
Reference in a new issue