feat: add function call for XTDriver

This commit is contained in:
lilong.129
2025-05-10 09:50:00 +08:00
parent 9bafea53af
commit f6ad6c9eff
4 changed files with 20 additions and 6 deletions

View File

@@ -1,10 +1,23 @@
package uixt
import (
"time"
"github.com/httprunner/httprunner/v5/uixt/option"
"github.com/rs/zerolog/log"
)
// Call custom function, used for pre/post hook for actions
func (dExt *XTDriver) Call(desc string, fn func()) error {
startTime := time.Now()
fn()
log.Info().Str("desc", desc).
Int64("duration(ms)", time.Since(startTime).Milliseconds()).
Msg("function called")
return nil
}
func preHandler_TapAbsXY(driver IDriver, options *option.ActionOptions, rawX, rawY float64) (
x, y float64, err error) {