mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 04:42:42 +08:00
feat: 优化无用逻辑
This commit is contained in:
@@ -139,11 +139,6 @@ func (wd *WDADriver) Setup() error {
|
||||
// Store base URL for building full URLs
|
||||
baseURL := fmt.Sprintf("http://localhost:%d", localPort)
|
||||
wd.Session.SetBaseURL(baseURL)
|
||||
|
||||
if err = wd.initMjpegClient(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// create new session
|
||||
if err := wd.InitSession(nil); err != nil {
|
||||
return errors.Wrap(code.DeviceHTTPDriverError, err.Error())
|
||||
@@ -840,6 +835,10 @@ func (wd *WDADriver) triggerWDALog(data map[string]interface{}) (rawResp []byte,
|
||||
|
||||
func (wd *WDADriver) ScreenRecord(opts ...option.ActionOption) (videoPath string, err error) {
|
||||
log.Info().Msg("WDADriver.ScreenRecord")
|
||||
err = wd.initMjpegClient()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
timestamp := time.Now().Format("20060102_150405") + fmt.Sprintf("_%03d", time.Now().UnixNano()/1e6%1000)
|
||||
fileName := filepath.Join(config.GetConfig().ScreenShotsPath(), fmt.Sprintf("%s.mp4", timestamp))
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package option
|
||||
|
||||
func NewAIServiceOptions(opts ...AIServiceOption) *AIServiceOptions {
|
||||
services := &AIServiceOptions{}
|
||||
services := &AIServiceOptions{
|
||||
Enable: true,
|
||||
}
|
||||
for _, option := range opts {
|
||||
option(services)
|
||||
}
|
||||
@@ -9,6 +11,7 @@ func NewAIServiceOptions(opts ...AIServiceOption) *AIServiceOptions {
|
||||
}
|
||||
|
||||
type AIServiceOptions struct {
|
||||
Enable bool `json:"enable,omitempty" yaml:"enable,omitempty"`
|
||||
CVService CVServiceType `json:"cv_service,omitempty" yaml:"cv_service,omitempty"`
|
||||
LLMService LLMServiceType `json:"llm_service,omitempty" yaml:"llm_service,omitempty"`
|
||||
LLMConfig *LLMServiceConfig `json:"llm_config,omitempty" yaml:"llm_config,omitempty"` // advanced LLM configuration
|
||||
|
||||
Reference in New Issue
Block a user