Increase the timeouts for controls appearing, and decrease the time between checking the active time to every 30 seconds
This commit is contained in:
parent
080e5a611d
commit
b8b22fe869
1 changed files with 5 additions and 5 deletions
|
@ -58,14 +58,14 @@ async function run() {
|
||||||
|
|
||||||
if (page.url().includes("signin")) {
|
if (page.url().includes("signin")) {
|
||||||
try {
|
try {
|
||||||
await page.waitForSelector("button.btn.btn-orange", { timeout: 2500 });
|
await page.waitForSelector("button.btn.btn-orange", { timeout: 5000 });
|
||||||
await page.type("#labeled-input-signEmail", config.username);
|
await page.type("#labeled-input-signEmail", config.username);
|
||||||
await page.click("button.btn.btn-orange");
|
await page.click("button.btn.btn-orange");
|
||||||
await page.waitForTimeout(1500);
|
await page.waitForTimeout(1500);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
await page.waitForSelector("#labeled-input-password", { timeout: 2500 });
|
await page.waitForSelector("#labeled-input-password", { timeout: 5000 });
|
||||||
await page.waitForSelector("button.btn.btn-orange");
|
await page.waitForSelector("button.btn.btn-orange");
|
||||||
await page.type("#labeled-input-password", config.password);
|
await page.type("#labeled-input-password", config.password);
|
||||||
await page.click("button.btn.btn-orange");
|
await page.click("button.btn.btn-orange");
|
||||||
|
@ -73,7 +73,7 @@ async function run() {
|
||||||
break;
|
break;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
try {
|
try {
|
||||||
await page.waitForSelector(".nav-complex-inner .fa-caret-down", { timeout: 2500 });
|
await page.waitForSelector(".nav-complex-inner .fa-caret-down", { timeout: 5000 });
|
||||||
log("Successfully logged in");
|
log("Successfully logged in");
|
||||||
break;
|
break;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -133,7 +133,7 @@ async function run() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log(`${date.getHours()}:${date.getMinutes()} is outside the active time period between ${config.start_time} and ${config.end_time}`);
|
log(`${date.getHours()}:${date.getMinutes()} is outside the active time period between ${config.start_time} and ${config.end_time}`);
|
||||||
await page.waitForTimeout(60000);
|
await page.waitForTimeout(30000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ async function run() {
|
||||||
|
|
||||||
if (await clickButtonWithText(page, "Continue to payment")) {
|
if (await clickButtonWithText(page, "Continue to payment")) {
|
||||||
log("Continuing to payment...");
|
log("Continuing to payment...");
|
||||||
await page.waitForSelector("[placeholder=\"CVV2\"]", { timeout: 2500 });
|
await page.waitForSelector("[placeholder=\"CVV2\"]", { timeout: 5000 });
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
log("Filling out the cv2...");
|
log("Filling out the cv2...");
|
||||||
await page.type("[placeholder=\"CVV2\"]", config.cv2);
|
await page.type("[placeholder=\"CVV2\"]", config.cv2);
|
||||||
|
|
Loading…
Reference in a new issue