refactor: add DriverSession, move step cache to Driver session

This commit is contained in:
lilong.129
2024-09-02 12:14:45 +08:00
parent 5f61858b4d
commit 4c71fc02f9
13 changed files with 85 additions and 88 deletions

View File

@@ -648,13 +648,11 @@ func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err
}
// save attachments
cacheData := uiDriver.DataCache.GetAll()
for key, value := range cacheData {
session := uiDriver.Driver.GetSession()
for key, value := range session.GetAll() {
attachments[key] = value
}
uiDriver.DataCache.Clear() // clear step cache
attachments["driver_request_results"] = uiDriver.Driver.GetDriverResults()
session.Clear() // clear step cache
stepResult.Attachments = attachments
}()