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