add resetBrowser method

This commit is contained in:
2022-10-05 09:11:22 +02:00
parent a1e2fdfb48
commit 57df041a0e
2 changed files with 15 additions and 1 deletions
+15
View File
@@ -339,6 +339,10 @@ class CommandorPage {
})
} else {
log("audioBtn not found")
console.log("audioBtn not found")
console.log("we are blocked")
//
await this.resetBrowser()
}
}
@@ -408,6 +412,17 @@ class CommandorPage {
}
}
async resetBrowser() {
console.log("will reset browser")
await this.device.shell("pm clear com.android.chrome")
await delay(1000)
await this.device.shell("am set-debug-app --persistent com.android.chrome")
await delay(1000)
await this.device.shell("pm am start -n com.android.chrome/com.google.android.apps.chrome.Main")
await delay(1000)
this.isTerminated = true
}
}
module.exports = CommandorPage