feat: support action options for AppLaunch/AppTerminate

This commit is contained in:
lilong.129
2025-05-10 00:01:30 +08:00
parent 4a2276c7f0
commit 9bafea53af
5 changed files with 29 additions and 10 deletions

View File

@@ -91,18 +91,20 @@ func (s *StepMobile) WebLoginNoneUI(packageName, phoneNumber string, captcha, pa
return s
}
func (s *StepMobile) AppLaunch(bundleId string) *StepMobile {
func (s *StepMobile) AppLaunch(bundleId string, opts ...option.ActionOption) *StepMobile {
s.obj().Actions = append(s.obj().Actions, uixt.MobileAction{
Method: uixt.ACTION_AppLaunch,
Params: bundleId,
Method: uixt.ACTION_AppLaunch,
Params: bundleId,
Options: option.NewActionOptions(opts...),
})
return s
}
func (s *StepMobile) AppTerminate(bundleId string) *StepMobile {
func (s *StepMobile) AppTerminate(bundleId string, opts ...option.ActionOption) *StepMobile {
s.obj().Actions = append(s.obj().Actions, uixt.MobileAction{
Method: uixt.ACTION_AppTerminate,
Params: bundleId,
Method: uixt.ACTION_AppTerminate,
Params: bundleId,
Options: option.NewActionOptions(opts...),
})
return s
}