Skip to content
Snippets Groups Projects
Commit f5f26cc1 authored by Matyáš Latner's avatar Matyáš Latner
Browse files

Project setup for Android Espresso tests

parent d29fd970
Branches testing
No related merge requests found
......@@ -34,11 +34,16 @@ repositories {
dependencies {
compile files('libs/Netconfdroid-1.0-SNAPSHOT.jar')
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:support-v4:23.1.1'
compile 'org.achartengine:achartengine:1.2.0'
compile 'ch.ethz.ganymed:ganymed-ssh2:262'
compile 'com.splunk.mint:mint:4.0.6'
compile 'com.jakewharton:butterknife:6.1.0'
androidTestCompile 'com.android.support:support-v4:23.1.1'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
}
ext {
......@@ -85,6 +90,8 @@ android {
buildConfigField 'String', 'APPLICATION_FULL_NAME', "\"${appName}\"";
buildConfigField 'String', 'BUG_SENSE_ID', project.hasProperty('RTOP_BUG_SENSE_ID') ? "\"${RTOP_BUG_SENSE_ID}\"" : "null"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
......
/*
* Copyright (C) 2016 CZ.NIC, z.s.p.o. <rtop@labs.nic.cz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.rtop.activities;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import cz.nic.rtop.R;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
@org.junit.runner.RunWith(AndroidJUnit4.class)
public class EntryActivityTest {
@Rule
public ActivityTestRule<EntryActivity> mActivityRule = new ActivityTestRule<>(EntryActivity.class);
@Test
public void changeText_sameActivity() {
onView(withId(R.id.entry_act_detect_ip_btn)).perform(click());
onView(withId(R.id.ipaddress_edittext)).check(matches(withText("192.168.1.1")));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment