Download - Przyszłość ma na imię Mobile – testowanie i automatyzacja testów aplikacji mobilnych (Android)
Przyszłość ma imię mobile
Testowanie i automatyzacjaaplikacji mobilnych (Android)
Piotr Wicherski | TestWarez 2015
● Real user conditions as important as real devices
● Network performance,battery consumption,memory usage are leading causes of poor performance
Testowanie mobilne | Sieć
https://www.youtube.com/watch?v=nOFel7yNAsE
Testowanie mobilne | Sieć
http://techvidhya.in/ http://learnabouttelecom.blogspot.com/2012/06/gsm-core-network-base-station-subsystem.html
Testowanie mobilne | Symulator
https://github.com/Polidea/Cellular-Data-Network-Simulator
Cellular Data Network SimulatorFeatures
● Easy to use web and mobile interface
● Simulate: bandwidth, delay, loss, corruption,
occasional loss of signal
● Can capture the traffic and send it to CloudShark
● Apply limits per-device
● Works well in environment with multiple devices and
multiple testers
● Works well as virtual machine bridged with separate
wireless network
Requirements
● OpenWrt device running on Barrier
Breaker - can be router or virtual machine
● Two network interfaces - one for WAN and
one for WIFI/LAN
Testowanie mobilne | Czujniki
http://developer.android.com/guide/topics/sensors/sensors_overview.html
Testowanie mobilne | Fragmentacja
http://developer.android.com
Any versions with less than 0.1% distribution are not shown.
Testowanie mobilne | Urządzenia
Xiaomi success inspires every man and his dog to make smartphones in china
http://www.reuters.com/article/2015/07/13/us-china-smartphones-idUSKCN0PN2HA20150713
Testowanie mobilne | Wearables
Chipset Qualcomm Snapdragon™ 400 MSM8026
Display 1.65-inch LCD IPS (280 x 280)
Memory 4GB eMMC / 512MB RAM
Battery 400mAh
CPU Quad-core 1.2 GHz
Connectivity Bluetooth 4.0
Sensors 9-Axis (Gyro / Accelerometer / Compass)
Others Dust and Water Resistant (IP67)
Narzędzia
Intellij IDEA | Android Studio
Charles | mitmproxy
dex2jar
Atom
Dash 3
Reeder 2 | Pocket
SourceTree
Vysor
Genymotion
Narzędzia
Monkey
Cellular data network simulator
TestLink
VNC remote server
Fabric Beta
Google Analytics
ADB
AndroidTool for mac
Automatyzacja | Frameworki
Espresso
Robotium
Appium
Calabash
Imagrium
YSO Mobile Security Framework
https://mobilesecuritywiki.com/
Espresso
ViewMatchers - allows you to locate a view in the current view hierarchy
ViewActions - allows you to interact with views
ViewAssertions - allows you to assert the state of a view
check something
find Something
do something
Espresso
@Test public void firstStep() { onView(withId(R.id.my_view))
.perform(click())
.check(matches(isDisplayed()));}
ViewAssertion
ViewMatcher
ViewAction
Espresso | app/build.gradle
apply plugin: 'com.android.application'
android { ... defaultConfig { … testInstrumentationRunner ‘android.support.test.runner.AndroidJUnitRunner’ }
}dependencies { androidTestCompile 'com.android.support.test:runner:0.2' androidTestCompile 'com.android.support.test:rules:0.2'
// Espresso dependencies androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'}
https://goo.gl/U2Qsi9
Espresso
@RunWith(AndroidJUnit4.class)@LargeTestpublic class ChangeTextBehaviorTest { ... @Rule public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>( MainActivity.class);
@Test public void changeText_sameActivity() { onView(withId(R.id.editTextUserInput)) .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard()); onView(withId(R.id.changeTextBt)).perform(click());
onView(withId(R.id.textToBeChanged)).check(matches(withText(STRING_TO_BE_TYPED))); }}
https://goo.gl/U2Qsi9
Check that text was changed
Find EditText view
Start Activity under test
Type text, close keyboardthen press the button