使用AppiumBooster打造心目中理想的自动化测试框架(8)

发表于:2016-09-12来源:debugtalk作者:Leo Lee点击数: 标签:Appium
;描述方式推荐使用 YAML 格式。 steps(测试步骤描述) 首先是对于单一操作步骤的描述。 从UI层面来看,每一个操作步骤都可以归纳为三个方面:定位控
;描述方式推荐使用YAML格式。

steps(测试步骤描述)

首先是对于单一操作步骤的描述。

从UI层面来看,每一个操作步骤都可以归纳为三个方面:定位控件、操作控件和检查结果。

AppiumBooster的做法是,将App根据功能模块进行拆分,每一个模块单独创建一个YAML文件,并保存在steps目录下。然后,在每个模块中以控件为单位,分别进行定义。

现以如下示例进行详细说明。


					
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

					
---
AccountSteps:
enter Login page:
control_id: tablecellMyAccountLogin
control_action: click
expectation: btnForgetPassword
 
input test EmailAddress:
control_id: txtfieldEmailAddress
control_action: type
data: leo.lee@debugtalk.com
expectation: sectxtfieldPassword
 
check if coupon popup window exists(optional):
control_id: inner_screen
control_action: has_control
data: btnViewMyCoupons
expectation: btnClose
optional: true

原文转自:http://debugtalk.com/post/build-ideal-app-automation-test-framework/