?????ò??????Calabash Android ???
???????????? ???????[ 2014/12/18 16:50:24 ] ??????????????? Android
????????????? feature ????????????
????Feature: Login feature Scenario: As a valid user I can log into my app When I press "Add Contact"
????Then I see "Target Account"
????Then I enter "hello" into input field number 1 Then I enter "13817861875" into input field number 2 Then I enter "hengwen@hotmail.com" into input field number 3 When I press "Save"
????Then I wait for 1 second Then I toggle checkbox number 1 Then I see "hello"
???????? input field number ????? ContactAdder Activity ?????????????????д????????????????????????η?????? DSL ?д??????????磺
When I enter "hello" as "Contact Name"
step_definition
When (/^I enter "([^"]*)" as "([^"]*)"$/) do | text?? target |
index = case target
when "Contact Name": 1
...
end
steps %{
Then I enter #{text} into input field number #{index}
}end
???????? feature ??????????
???????? feature
??????????????????? apk ?????????£???????????Щ????
????App did not start (RuntimeError)
???????calabash-android??client??test server?????????????? AndroidManifest.xml ?????????
????<uses-permission android:name="android.permission.INTERNET" />
????ContacterManager ???????????
???????? ContacerManager ??????????????????????????????????? Save ???????????????????У????????????
????????????? $ANDROID_HOME/samples/android-19/legacy/ContactManager????????????
?????????? com.example.android.contactmanager.ContactAdder ??????? createContactEntry ??????????????? mSelectedAccount ?????ж?? ????????£?
// Prepare contact creation request
//
// Note: We use RawContacts because this data must be associated with a particular account.
// The system will aggregate this with any other data for this contact and create a
// coresponding entry in the ContactsContract.Contacts provider for us.
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
if(mSelectedAccount != null ) {
ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE?? mSelectedAccount.getType())
.withValue(ContactsContract.RawContacts.ACCOUNT_NAME?? mSelectedAccount.getName())
.build());
} else {
ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE?? null)
.withValue(ContactsContract.RawContacts.ACCOUNT_NAME?? null)
.build());
}....
if (mSelectedAccount != null) {
// Ask the Contact provider to create a new contact
Log.i(TAG??"Selected account: " + mSelectedAccount.getName() + " (" +
mSelectedAccount.getType() + ")");
} else {
Log.i(TAG??"No selected account");
}
??????????????????? apk ?????
???????к????
????calabash-android run <apk>
??????????????????????? calabash-android resign apk??
????????????????е??????
? calabash calabash-android run ContactManager.apk
Feature: Login feature
Scenario: As a valid user I can log into my app # features/my_first.feature:33135 KB/s (556639 bytes in 0.173s)3315 KB/s (26234 bytes in 0.007s)
When I press "Add Contact" # calabash-android-0.4.21/lib/calabash-android/steps/press_button_steps.rb:17
Then I see "Target Account" # calabash-android-0.4.21/lib/calabash-android/steps/assert_steps.rb:5
Then I enter "hello" into input field number 1 # calabash-android-0.4.21/lib/calabash-android/steps/enter_text_steps.rb:5
Then I enter "13817861875" into input field number 2 # calabash-android-0.4.21/lib/calabash-android/steps/enter_text_steps.rb:5
Then I enter "hengwen@hotmail.com" into input field number 3 # calabash-android-0.4.21/lib/calabash-android/steps/enter_text_steps.rb:5
When I press "Save" # calabash-android-0.4.21/lib/calabash-android/steps/press_button_steps.rb:17
Then I wait for 1 second # calabash-android-0.4.21/lib/calabash-android/steps/progress_steps.rb:18
Then I toggle checkbox number 1 # calabash-android-0.4.21/lib/calabash-android/steps/check_box_steps.rb:1
Then I see "hello" # calabash-android-0.4.21/lib/calabash-android/steps/assert_steps.rb:51 scenario (1 passed)9 steps (9 passed)0m28.304s
All pass??
?????????? gif ?? failed???????????????????е?????????????????????????????????е????????????????в???
???????
??????????? calabash-android ?????????????????????????????????????? Appium ????TesterHome ??????????????????????????watch and learn??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11