0

I am new to using calabash for android, which is a end to end testing framework for android. Iam trying to test a feature where on pressing a button in my app I am taken back to the android home screen. Could someone help me with the test for this scenario? Here is what I have till now

Feature: Return to Home Screen

   Scenario: As a user 
     When I press the "GO" button
     Then I should see "HomeActivity" screen appear

I am stuck at the second line. I have tried several alternatives like trying to use the id (Don't think I got the correct id. Does the android home activity have a predefined id?) or different names to test if the home activity appears.

Satyam
  • 645
  • 2
  • 7
  • 20

1 Answers1

0

I've created a new action to do exactly that on my github branch

For TabActivities it returns the tag of the current tab. For other Activities it returns the class name.

actual_activity = performAction('get_activity_name')['bonusInformation']
raise Exception "Expected #{expected_activity} activity but was #{actual_activity}" unless actual_activity == expected_activity
Nicholas Albion
  • 3,096
  • 7
  • 33
  • 56