移动应用测试框架—Calabash Android 简介
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 |
// 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"); } |
? 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! |
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
危害太大 100万美元购买iPhone漏洞
智能手机是最随身的产品,因此机内的资料安全,是用户最关注的,早前数据收集机构Zerodium,宣布只要有人可以找到iPhone的0-Day漏洞,就可以获得100万美元,却因此被外界称为恶魔。 危害太大 100万美元购买iPhone漏洞 只要你手上有一个可以破解iPhone的0-day漏洞,就可以获得100万美元,有两个漏洞就可以拿200万美元奖金,网络安全机构Zimperium飚示Zerodium做法动机不良,0-day漏洞是一种威力非常巨大的武器,高价悬赏iOS的0-day漏洞之后,更有机会把这些漏洞以更高价格卖给其他人。 如果Zerodium把0-day漏洞卖给不法份子,那么所有iOS用户的安全将会受到巨大的威胁,将漏洞卖给政府机构,那么iOS用户将会长时间处于监控之中。 本文转自d1net(转载)
- 下一篇
《OpenStack实战指南》—— 1.8 OpenStack的开发资源
本节书摘来自华章出版社《OpenStack实战指南》一 书中的第1章,第1.8节,作者:黄 凯 毛伟杰 顾骏杰 ,更多章节内容可以访问云栖社区“华章计算机”公众号查看。 1.8 OpenStack的开发资源 1.8.1 OpenStack社区 OpenStack是由开发商、企业、服务供应商、研究人员及用户共同组成的全球性的社区。关注OpenStack最好的方式就是访问OpenStack社区:www.openstack.org,通过社区可以第一时间了解OpenStack的动态。希望下面给出的这些链接可以帮助读者进一步了解OpenStack。OpenStack峰会:https://wiki.openstack.org/wiki/SummitOpenStack用户成员:https://wiki.openstack.org/wiki/OpenS
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- CentOS7编译安装Gcc9.2.0,解决mysql等软件编译问题
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- CentOS8编译安装MySQL8.0.19
- MySQL8.0.19开启GTID主从同步CentOS8
- SpringBoot2全家桶,快速入门学习开发网站教程
- CentOS7,CentOS8安装Elasticsearch6.8.6
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- Red5直播服务器,属于Java语言的直播服务器