-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1531 from httprunner/wcl
release v4.3.1 - feat: add option WithScreenShot - feat: run xctest before start ios automation - feat: run step with specified loop times - feat: add options for FindTexts - refactor: move all UI APIs to uixt pkg - docs: add examples for UI APIs
- Loading branch information
Showing
40 changed files
with
1,052 additions
and
590 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//go:build localtest | ||
|
||
package uitest | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/httprunner/httprunner/v4/hrp" | ||
"github.com/httprunner/httprunner/v4/hrp/pkg/uixt" | ||
) | ||
|
||
func TestAndroidKuaiShouFeedCardLive(t *testing.T) { | ||
testCase := &hrp.TestCase{ | ||
Config: hrp.NewConfig("直播_快手_Feed卡片_android"). | ||
WithVariables(map[string]interface{}{ | ||
"device": "${ENV(SerialNumber)}", | ||
}). | ||
SetAndroid( | ||
uixt.WithSerialNumber("$device"), | ||
uixt.WithAdbLogOn(true)), | ||
TestSteps: []hrp.IStep{ | ||
hrp.NewStep("启动快手"). | ||
Android(). | ||
AppTerminate("com.smile.gifmaker"). | ||
AppLaunch("com.smile.gifmaker"). | ||
Home(). | ||
SwipeToTapApp("快手", uixt.WithMaxRetryTimes(5)).Sleep(10), | ||
hrp.NewStep("处理青少年弹窗"). | ||
Android(). | ||
TapByOCR("我知道了", uixt.WithIgnoreNotFoundError(true)). | ||
Validate(). | ||
AssertOCRExists("精选", "进入快手失败"), | ||
hrp.NewStep("点击精选"). | ||
Android(). | ||
TapByOCR("精选", uixt.WithIndex(-1), uixt.WithOffset(0, -50)).Sleep(10), | ||
hrp.NewStep("点击直播标签,进入直播间"). | ||
Android(). | ||
SwipeToTapText("点击进入直播间", | ||
uixt.WithCustomDirection(0.9, 0.7, 0.9, 0.3), | ||
uixt.WithScope(0.2, 0.5, 0.8, 0.8), | ||
uixt.WithMaxRetryTimes(20), | ||
uixt.WithWaitTime(60), | ||
uixt.WithIdentifier("click_live"), | ||
), | ||
hrp.NewStep("等待1分钟"). | ||
Android(). | ||
Sleep(60), | ||
hrp.NewStep("上滑进入下一个直播间"). | ||
Android(). | ||
Swipe(0.9, 0.7, 0.9, 0.3, uixt.WithIdentifier("slide_in_live")).Sleep(60), | ||
hrp.NewStep("返回主界面,并打开本地时间戳"). | ||
Android(). | ||
Home().SwipeToTapApp("local", uixt.WithMaxRetryTimes(5)).Sleep(10). | ||
Validate(). | ||
AssertOCRExists("16", "打开本地时间戳失败"), | ||
}, | ||
} | ||
|
||
if err := testCase.Dump2JSON("android_feed_card_live_test.json"); err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
runner := hrp.NewRunner(t).SetSaveTests(true) | ||
err := runner.Run(testCase) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} |
Oops, something went wrong.