Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8b1d3b6

Browse files
testing tutorials
1 parent 33bb839 commit 8b1d3b6

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

‎README.md‎

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,51 @@
11
# AndroidTestingTutorial
22
Getting started with Espresso Unit Testing
33

4-
# Why Testing?
4+
Why Testing?
5+
-------------------------------
56
testing is the process of evaluation a software item to detect differences between given input and expected output.
7+
<br/>
68

7-
# Categories of Testing
9+
Categories of Testing
10+
-------------------------------
811
1. Black box testing
912
2. White box testing<br>
1013
etc... others can be found <a href="http://www.softwaretestinghelp.com/types-of-software-testing/">here</a>
14+
<br/>
1115

12-
# Black box testing
16+
Black box testing
17+
-------------------------------
1318
Tests are based on requirements and functionality.
19+
<br/>
1420

15-
# White box testing
21+
White box testing
22+
-------------------------------
1623
Tests are based on coverage of code statements, branches, paths, conditions.
1724

18-
# TDD
25+
26+
27+
TDD
28+
-------------------------------
1929
Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only.
30+
<br/>
2031

21-
# Android Testing Tools
32+
Android Testing Tools
33+
-------------------------------
2234
1. <a href="https://developer.android.com/training/testing/ui-testing/espresso-testing.html">Espresso by google team</a>
2335
2. <a href="http://robolectric.org/">Roboletric</a>
2436
3. <a href="https://appium.io/slate/en/tutorial/android.html?ruby#">Appium</a>
2537

2638

2739

28-
# Espresso
40+
Espresso
41+
-------------------------------
2942
Mainly focused on UI and Thread idealization, which helps the unit tests to run without worring about api response state
3043
It checks the threads and waits for ui thread to be idealize which is dismiss progress bar or any event which shows that activity is performing some event.
44+
<br/>
3145

32-
# Why Espresso
46+
47+
Why Espresso
48+
-------------------------------
3349
Other tools like Roboletric is also famous for testing android apps but it has it's own android jar which is our basic android kit classes.
3450
As google updates their support library often it's hard to keep in update for Roboletric.
3551
And to mock the android classes becomes hard with Roboletric.
@@ -86,7 +102,9 @@ public class PerfomClickAndCheckTextError {
86102

87103
Like above I had taken resources.
88104

89-
# Tutorial 1
105+
Tutorial 1
106+
-------------------------------
107+
90108
We have started programming with hello world! program and for testing we will do the same. Simple step check the text is on the screen.
91109
but before that let's check how to <kbd>find view</kbd> from the screen in Espresso
92110

@@ -120,7 +138,8 @@ above code checked that screen has some textview having text Hello Floks!
120138
<br/>
121139
<br/>
122140

123-
# Tutorial 2
141+
Tutorial 2
142+
-------------------------------
124143
Now that we have successed in finding view and performing checks we will move to step 2 which is perform events like typing and clicking.
125144
to click
126145
````
@@ -129,7 +148,8 @@ onView(withText("Login")).perform(click());
129148
<br/>
130149
<br/>
131150

132-
# Tutorial 3
151+
Tutorial 3
152+
-------------------------------
133153
Merge click and checks in one
134154
````
135155
onView(withId(R.id.btnLoginButton)).perform(click());
@@ -138,7 +158,8 @@ Merge click and checks in one
138158
<br/>
139159
<br/>
140160

141-
# Tutorial 4
161+
Tutorial 4
162+
-------------------------------
142163
open activity with data in bundle as it's important to pass data with activity
143164

144165
you want to check activity with custom data
@@ -177,7 +198,8 @@ public class PassDataInActivityTest {
177198
````
178199

179200

180-
# Tutorial 5
201+
Tutorial 5
202+
-------------------------------
181203
Responding to external intents like gallery picks
182204
It's hard to control external apps as with device applications can have different views so it's not steady like your UI. in this condition what you can do is develop dependency injected code where you can mock the intents results or you can give result of intents in testing.
183205

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /