Robotium framework & Jenkins CI tools - TdT@Cluj #19

1,843 views
1,542 views

Published on

Meetup #19 @Cluj = Automated tests on Android - Robotium framework & Jenkins CI tools

Presentation of how you can:
• automate your tests for mobile platforms (O.S. Android) by using Robotium
• run your tests by using Jenkins

Knowledge level for the presentation: Beginner

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,843
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
46
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Robotium framework & Jenkins CI tools - TdT@Cluj #19

  1. 1. Automated tests on Android – Robotium framework and Jenkins CI tools Presenters: Dorel Natea and Mihai Băieșan
  2. 2. Content It’s Demo time!
  3. 3. Robotium • • • • Open-Source Test Automation Framework UI testing for Android Standalone jar Create automated tests for – *Native applications – *Hibrid applications • Easy to develop automated tests * http://bit.ly/1cKYGWY www.robotium.org
  4. 4. Robotium - structure Create a test class: public class MyAndroidActivityTest extends android.test.ActivityInstrumentationTestCase2 { Declare a Solo class instance private Solo solo; Create a test class constructor public MyAndroidActivityTest() { super("com.example", MyAndroidActivity.class); } Override the setUp() and tearDown() methods. @Override protected void setUp() throws Exception { super.setUp(); solo = new Solo(getInstrumentation(), getActivity()); } @Override protected void tearDown() throws Exception { solo.finishOpenedActivities(); getActivity().finish(); super.tearDown(); } Create a test method public void testDisplayedText() throws InterruptedException { solo.clickOnButton("Add blog hosted at WordPress.com");}
  5. 5. Robotium - methods solo.clickOnButton("Add self-hosted WordPress blog"); // Click on the button that has the following text displayed solo.waitForText("Account Details"); // Waiting for the text “Account Details” to be displayed on the screen solo.typeText((EditText)solo.getCurrentActivity().findViewById(R.id.url), “www.test.te"); // Type text “www.test.te" in the text field with the following id=> “url”
  6. 6. WordPress Free and open-source blogging tool. A content-management system. WordPress mobile app: Write, Edit, Publish posts in your site, check stats “Share with the world, your community, or your closest friends.”
  7. 7. Jenkins Open-Source continuous integration server Multiple jobs that can ran independently Trying to avoid CI bugs Jenkins Dashboard
  8. 8. Jenkins Create new job
  9. 9. Jenkins Jenkins Job Dashboard
  10. 10. Jenkins Jenkins Nodes
  11. 11. Jenkins Reports: – Test result
  12. 12. Jenkins & Emma Reports: – Code coverage report
  13. 13. It’s Demo Time!
  14. 14. Q&A
  15. 15. Other tools • Appium – http://appium.io/ • Calabash – http://calaba.sh/ • MonkeyTalk – http://www.gorillalogic.com/monkeytalk • Testdroid – http://bitbar.com/
  16. 16. References • Robotium – – • Zutubi Android junit report – • http://www.wordpress.com Useful blog: – • http://stackoverflow.com/ Wordpress – • http://www.genymotion.com/ Stackoverflow :D – • https://wiki.jenkins-ci.org/display/JENKINS/Emma+Plugin Genymotion – • http://emma.sourceforge.net/ Emma Jenkins plugin – • http://jenkins-ci.org/ Emma coverage tool – • http://zutubi.com/source/projects/android-junit-report/ Jenkins CI – • https://code.google.com/p/robotium/ http://code.google.com/p/robotium/wiki/RobotiumAPIDocumentation http://dnlkntt.wordpress.com Hierarchy Viewer – http://developer.android.com/tools/help/hierarchy-viewer.html

×