use local server
This commit is contained in:
@@ -461,24 +461,29 @@ class CommandorPage {
|
||||
await delay(getRandomWaitTime())
|
||||
try {
|
||||
if (!this.page.isClosed()) {
|
||||
this.page.evaluate(() => {
|
||||
let element = document.getElementsByClassName("btn")[0];
|
||||
if (typeof element !== 'undefined')
|
||||
document.getElementsByClassName("btn")[0].focus();
|
||||
})
|
||||
if (!this.isTerminated) {
|
||||
this.page.evaluate(() => {
|
||||
let element = document.getElementsByClassName("btn")[0];
|
||||
if (typeof element !== 'undefined')
|
||||
document.getElementsByClassName("btn")[0].focus();
|
||||
})
|
||||
}
|
||||
await delay(getRandomWaitTime())
|
||||
if (!this.page.isClosed()) {
|
||||
try {
|
||||
// remove debug flag
|
||||
// const validElement = await page.$('.btn');
|
||||
console.log("will click on valid button");
|
||||
await this.page.evaluate(() => {
|
||||
document.getElementsByClassName("btn")[0].click();
|
||||
})
|
||||
if (this.firstStart) {
|
||||
this.disconnectBrowser();
|
||||
await this.checkResultWithOcr();
|
||||
if (!this.isTerminated) {
|
||||
await this.page.evaluate(() => {
|
||||
document.getElementsByClassName("btn")[0].click();
|
||||
})
|
||||
if (this.firstStart) {
|
||||
this.disconnectBrowser();
|
||||
await this.checkResultWithOcr();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
log(e);
|
||||
await this.checkResultWithOcr()
|
||||
|
||||
Reference in New Issue
Block a user