Added Scheduling
All checks were successful
Push image to registry / build-image (push) Successful in 4m20s
All checks were successful
Push image to registry / build-image (push) Successful in 4m20s
This commit is contained in:
@ -15,6 +15,7 @@ use App\Notification\Notifications\Hellcase\HellcaseNotificationLogin;
|
||||
use App\Notification\Providers\AllNotification;
|
||||
use Dom\XPath;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
use Laravel\Dusk\Browser;
|
||||
|
||||
class HellcaseJob extends BrowserJob
|
||||
@ -169,23 +170,24 @@ class HellcaseJob extends BrowserJob
|
||||
}
|
||||
|
||||
// If we see "availible in 20 HR 49 MIN", parse the hours and minute and reschedule
|
||||
$availibleInButton = $this->waitForElementContainingTextAndGetIt($browser, "available", 30);
|
||||
if ($availibleInButton != null) {
|
||||
$availibleInButton = $browser->driver->findElement(WebDriverBy::xpath('//button[contains(@class, "daily-free-banner__button")]'));
|
||||
if ($availibleInButton->getAttribute("disabled") == "true") {
|
||||
$hours = $availibleInButton->getText();
|
||||
$hours = explode(" ", $hours);
|
||||
$minutes = $hours[2];
|
||||
$hours = $hours[0];
|
||||
$minutes = $hours[4];
|
||||
$hours = $hours[2];
|
||||
// $this->reschedule($hours);
|
||||
|
||||
$this->jobRun->addArtifact(new JobArtifact([
|
||||
"name" => "Cadeau gratuit pas encore disponible",
|
||||
"content" => "Le cadeau gratuit journalier sera disponible dans $hours heures et $minutes minutes.\nDatboi se fera un plaisir d'aller le chercher pour vous."
|
||||
"content" => "Le cadeau gratuit journalier sera disponible dans {$hours} heures et {$minutes} minutes.\nDatboi se fera un plaisir d'aller le chercher pour vous."
|
||||
]));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->waitForAndClickText($browser, "Get Free Bonus", 30, true);
|
||||
// Click the dailyfree button
|
||||
$availibleInButton->click();
|
||||
|
||||
$lootElement = $browser->driver->findElement(WebDriverBy::xpath('//div[contains(@class, "daily-free-win-bonus")]'));
|
||||
$lootElement->takeElementScreenshot(HellcaseDailyFreeScreenshot::getImgFileAbsolutePath());
|
||||
@ -193,8 +195,6 @@ class HellcaseJob extends BrowserJob
|
||||
AllNotification::send(
|
||||
new HellcaseNotificationDailyFree($this->jobId, new HellcaseNotificationDailyFreeBody())
|
||||
);
|
||||
|
||||
sleep(5000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user