Normally the first test you might write in calabash is to test the start of an activity.
For example consider that your app has a button(with text "Test"), and is configured to call 'launchTestActivity' onClick.
Android code to start the activity :
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 void launchTestActivity(View view) { | |
startActivity(new Intent(this, TestActivity.class)); | |
} |
Now to test this, you need to write the below Calabash feature :
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
Feature: Main page | |
Scenario: Verify that TestActivty is opened on Test click | |
Given I press "Test" | |
Then I wait for the "TestActivity" screen to appear |
Is it possible to start a Service this way?
ReplyDeleteIs it possible to start a Service this way?
ReplyDelete