This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "br.com.luizmarcus.exemplotesteinterface" | |
minSdkVersion 15 | |
targetSdkVersion 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
private EditText user, pass; | |
private Button submit; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Rule | |
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>( | |
MainActivity.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4.class) | |
@LargeTest | |
public class LoginTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>( | |
MainActivity.class); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void executarTesteLoginContaErrada() { | |
//Insere o usuário no campo user | |
onView(withId(R.id.user)).perform(typeText("Usuario"), closeSoftKeyboard()); | |
//Insere a senha no campo pass | |
onView(withId(R.id.pass)).perform(typeText("Senha"), closeSoftKeyboard()); | |
//Clica no botao submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void executarTesteLoginContaCorreta() { | |
//Insere o usuário no campo user | |
onView(withId(R.id.user)).perform(typeText("Testeapp"), closeSoftKeyboard()); | |
//Insere a senha no campo pass | |
onView(withId(R.id.pass)).perform(typeText("Password"), closeSoftKeyboard()); | |
//Clica no botao submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4.class) | |
@LargeTest | |
public class LoginTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>( | |
MainActivity.class); | |
@Test | |
public void executarTesteLoginContaCorreta() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.luizmarcus.exemplopalette; | |
import android.content.Intent; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.net.Uri; | |
import android.provider.MediaStore; | |
import android.support.v7.app.AppCompatActivity; |