MCPcopy
hub / github.com/httprunner/httprunner / TestIOSExpertTest

Function TestIOSExpertTest

examples/uitest/expert_test.go:165–317  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestIOSExpertTest(t *testing.T) {
166 testCase := &hrp.TestCase{
167 Config: hrp.NewConfig("iOS 专家用例").
168 WithVariables(map[string]interface{}{
169 "device": "${ENV(UDID)}",
170 "query": "${ENV(query)}",
171 "bundle_id": "com.ss.iphone.ugc.Aweme",
172 "app_name": "抖音",
173 }).
174 SetIOS(
175 uixt.WithUDID("$device"),
176 uixt.WithWDALogOn(true),
177 uixt.WithWDAPort(8700),
178 uixt.WithWDAMjpegPort(8800),
179 ),
180 TestSteps: []hrp.IStep{
181 // 温启动
182 // iOS 不支持前台 App 断言操作
183 hrp.NewStep("启动应用程序 app_launch").
184 IOS().
185 AppLaunch("$bundle_id").
186 Sleep(2),
187 hrp.NewStep("home 以及 swipe_to_tap_app 默认配置").
188 IOS().
189 Home().
190 SwipeToTapApp("$app_name").
191 Sleep(10),
192 hrp.NewStep("处理弹窗 close_popups 默认配置 以及 ui_ocr exists 断言").
193 IOS().
194 ClosePopups().
195 Validate().
196 AssertOCRExists("推荐", "进入抖音失败"),
197 // 直播赛道
198 hrp.NewStep("【直播】feed头像或卡片进房 swipe_to_tap_texts 自定义配置").
199 IOS().
200 SwipeToTapTexts(
201 []string{"直播", "直播中", "点击进入直播间"},
202 uixt.WithCustomDirection(0.5, 0.7, 0.5, 0.3),
203 uixt.WithScope(0.2, 0.2, 1, 0.8),
204 uixt.WithMaxRetryTimes(50),
205 uixt.WithWaitTime(1.5),
206 uixt.WithIdentifier("click_live"),
207 ),
208 hrp.NewStep("sleep 10s").
209 IOS().
210 Sleep(10),
211 hrp.NewStep("【直播】swipe 自定义配置 以及 back").
212 IOS().
213 Swipe(
214 0.5, 0.7, 0.5, 0.3,
215 uixt.WithIdentifier("slide_in_live"),
216 ).
217 Sleep(5).
218 Back().
219 Sleep(5),
220 // 搜索赛道
221 hrp.NewStep("【搜索】点击放大镜 tap_xy 自定义配置").
222 IOS().

Callers

nothing calls this directly

Calls 15

Dump2JSONMethod · 0.95
NewConfigFunction · 0.92
WithUDIDFunction · 0.92
WithWDALogOnFunction · 0.92
WithWDAPortFunction · 0.92
WithWDAMjpegPortFunction · 0.92
NewStepFunction · 0.92
WithCustomDirectionFunction · 0.92
WithScopeFunction · 0.92
WithMaxRetryTimesFunction · 0.92
WithIdentifierFunction · 0.92
WithIndexFunction · 0.92

Tested by

no test coverage detected