refactor: get window size

This commit is contained in:
lilong.129
2024-09-02 13:41:39 +08:00
parent 4c71fc02f9
commit ee51b30b06
9 changed files with 94 additions and 86 deletions
+5 -1
View File
@@ -44,11 +44,15 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S
return
}
windowSize, err := dExt.Driver.WindowSize()
if err != nil {
return
}
screenResult = &ScreenResult{
bufSource: bufSource,
imagePath: imagePath,
Tags: nil,
Resolution: dExt.WindowSize,
Resolution: windowSize,
}
// cache screen result
dExt.Driver.GetSession().addScreenResult(screenResult)