mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-09 09:49:33 +08:00
fix: resolve conflicts
This commit is contained in:
@@ -1 +1 @@
|
||||
v4.3.8.202406252100
|
||||
v4.3.9
|
||||
@@ -108,39 +108,25 @@ func (d *Device) features() (features Features, err error) {
|
||||
return features, nil
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
func (d Device) HasAttribute(key string) bool {
|
||||
=======
|
||||
func (d *Device) HasAttribute(key string) bool {
|
||||
>>>>>>> video-release
|
||||
_, ok := d.attrs[key]
|
||||
return ok
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
func (d Device) Product() (string, error) {
|
||||
=======
|
||||
func (d *Device) Product() (string, error) {
|
||||
>>>>>>> video-release
|
||||
if d.HasAttribute("product") {
|
||||
return d.attrs["product"], nil
|
||||
}
|
||||
return "", errors.New("does not have attribute: product")
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
func (d Device) Model() (string, error) {
|
||||
=======
|
||||
func (d *Device) Model() (string, error) {
|
||||
>>>>>>> video-release
|
||||
if d.HasAttribute("model") {
|
||||
return d.attrs["model"], nil
|
||||
}
|
||||
return "", errors.New("does not have attribute: model")
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
func (d *Device) Brand() (string, error) {
|
||||
if d.HasAttribute("brand") {
|
||||
return d.attrs["brand"], nil
|
||||
@@ -154,7 +140,6 @@ func (d *Device) Brand() (string, error) {
|
||||
return brand, nil
|
||||
}
|
||||
|
||||
>>>>>>> video-release
|
||||
func (d *Device) Usb() (string, error) {
|
||||
if d.HasAttribute("usb") {
|
||||
return d.attrs["usb"], nil
|
||||
@@ -162,11 +147,7 @@ func (d *Device) Usb() (string, error) {
|
||||
return "", errors.New("does not have attribute: usb")
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
func (d Device) transportId() (string, error) {
|
||||
=======
|
||||
func (d *Device) transportId() (string, error) {
|
||||
>>>>>>> video-release
|
||||
if d.HasAttribute("transport_id") {
|
||||
return d.attrs["transport_id"], nil
|
||||
}
|
||||
|
||||
@@ -62,9 +62,12 @@ type ScreenResult struct {
|
||||
Video *Video `json:"video,omitempty"`
|
||||
Popup *PopupInfo `json:"popup,omitempty"`
|
||||
|
||||
SwipeStartTime int64 `json:"swipe_start_time"` // 滑动开始时间戳
|
||||
SwipeFinishTime int64 `json:"swipe_finish_time"` // 滑动结束时间戳
|
||||
SwipeStartTime int64 `json:"swipe_start_time"` // 滑动开始时间戳
|
||||
SwipeFinishTime int64 `json:"swipe_finish_time"` // 滑动结束时间戳
|
||||
FetchVideoStartTime int64 `json:"fetch_video_start_time"` // 抓取视频开始时间戳
|
||||
FetchVideoFinishTime int64 `json:"fetch_video_finish_time"` // 抓取视频结束时间戳
|
||||
|
||||
FetchVideoElapsed int64 `json:"fetch_video_elapsed"` // 抓取视频耗时(ms)
|
||||
ScreenshotTakeElapsed int64 `json:"screenshot_take_elapsed"` // 设备截图耗时(ms)
|
||||
ScreenshotCVElapsed int64 `json:"screenshot_cv_elapsed"` // CV 识别耗时(ms)
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ func (dExt *DriverExt) swipeToTapApp(appName string, options ...ActionOption) er
|
||||
}
|
||||
|
||||
// automatic handling popups before swipe
|
||||
if err := dExt.ClosePopups(); err != nil {
|
||||
if err := dExt.ClosePopupsHandler(); err != nil {
|
||||
log.Error().Err(err).Msg("auto handle popup failed")
|
||||
}
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
|
||||
|
||||
// get app event trackings
|
||||
// retry 3 times if get feed failed, abort if fail 3 consecutive times
|
||||
fetchVideoStartTime := time.Now()
|
||||
currentVideo, err := crawler.getCurrentVideo()
|
||||
if err != nil || currentVideo.Type == "" {
|
||||
crawler.failedCount++
|
||||
@@ -204,6 +205,7 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
|
||||
// retry
|
||||
continue
|
||||
}
|
||||
fetchVideoFinishTime := time.Now()
|
||||
|
||||
// 直播预览流线上概率
|
||||
livePreviewProb := crawler.getLivePreviewProb()
|
||||
@@ -278,6 +280,9 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
|
||||
screenResult.SwipeStartTime = swipeStartTime.UnixMilli()
|
||||
screenResult.SwipeFinishTime = swipeFinishTime.UnixMilli()
|
||||
screenResult.TotalElapsed = time.Since(swipeFinishTime).Milliseconds()
|
||||
screenResult.FetchVideoStartTime = fetchVideoStartTime.UnixMilli()
|
||||
screenResult.FetchVideoFinishTime = fetchVideoFinishTime.UnixMilli()
|
||||
screenResult.FetchVideoElapsed = fetchVideoFinishTime.Sub(fetchVideoStartTime).Milliseconds()
|
||||
|
||||
var exitLive bool
|
||||
if crawler.isLiveTargetAchieved() {
|
||||
@@ -313,8 +318,11 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
|
||||
Video: currentVideo,
|
||||
|
||||
// log swipe timelines
|
||||
SwipeStartTime: swipeStartTime.UnixMilli(),
|
||||
SwipeFinishTime: swipeFinishTime.UnixMilli(),
|
||||
SwipeStartTime: swipeStartTime.UnixMilli(),
|
||||
SwipeFinishTime: swipeFinishTime.UnixMilli(),
|
||||
FetchVideoStartTime: fetchVideoStartTime.UnixMilli(),
|
||||
FetchVideoFinishTime: fetchVideoFinishTime.UnixMilli(),
|
||||
FetchVideoElapsed: fetchVideoFinishTime.Sub(fetchVideoStartTime).Milliseconds(),
|
||||
}
|
||||
dExt.cacheStepData.screenResults[time.Now().String()] = screenResult
|
||||
|
||||
|
||||
Reference in New Issue
Block a user