Click the next button
All checks were successful
Push image to registry / build-image (push) Successful in 8m26s

This commit is contained in:
2025-03-11 19:33:44 +01:00
parent a693339f97
commit 8e356ac1ef

View File

@ -159,6 +159,8 @@ class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
try {
$buttons = $browser->driver->findElements(WebDriverBy::xpath('//a[text() = "Join for free"]'));
} catch (\Exception $e) {
$browser->screenshot(JobDebugScreenshot::getFileName($this->jobId));
AllNotification::send(new JobDebugNotification($this->jobId, "No join for free buttons found"));
return;
}
@ -169,15 +171,26 @@ class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
]));
}
foreach ($buttons as $button) {
$clicked = false;
while (!$clicked) {
try {
$nextSlideButton = $browser->driver->findElement(WebDriverBy::xpath('//button[@class="_button_1ygbm_7 _next_1ygbm_24"]'));
} catch (\Exception $e) {
$browser->screenshot(JobDebugScreenshot::getFileName($this->jobId));
AllNotification::send(new JobDebugNotification($this->jobId, "No next slide button found"));
return;
}
$clickedFailsCounter = 0;
while ($clickedFailsCounter < 7 && $clickedFailsCounter > 0) {
try {
$button->click();
} catch (\Exception $e) {
$clickedFailsCounter++;
try {
$nextSlideButton->click();
} catch (\Exception $_) {}
sleep(3);
continue;
}
$clicked = true;
sleep(3);
$clickedFailsCounter = -1;
}
sleep(5);
$this->joinGiveaway($browser);