feat: add Init for driver

This commit is contained in:
lilong.129
2024-12-19 13:25:36 +08:00
parent 75f3853b79
commit dcd252f802
4 changed files with 21 additions and 8 deletions
+11
View File
@@ -53,6 +53,17 @@ func newDriverExt(device IDevice, driver IWebDriver, options ...DriverOption) (d
return dExt, nil
}
func (dExt *DriverExt) Init() error {
// unlock device screen
err := dExt.Driver.Unlock()
if err != nil {
log.Error().Err(err).Msg("unlock device screen failed")
return err
}
return nil
}
func (dExt *DriverExt) assertOCR(text, assert string) error {
var options []ActionOption
options = append(options, WithScreenShotFileName(fmt.Sprintf("assert_ocr_%s", text)))