From af96f996ee17ee04b7bc18dc781fc9cff9f80894 Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Wed, 19 Mar 2025 18:15:06 +0100 Subject: [PATCH] Fix debug notifications not being sent --- app/Browser/Jobs/HellcaseBattles/HellcaseBattlesJob.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Browser/Jobs/HellcaseBattles/HellcaseBattlesJob.php b/app/Browser/Jobs/HellcaseBattles/HellcaseBattlesJob.php index 4d36e68..b973cbc 100644 --- a/app/Browser/Jobs/HellcaseBattles/HellcaseBattlesJob.php +++ b/app/Browser/Jobs/HellcaseBattles/HellcaseBattlesJob.php @@ -2,6 +2,7 @@ namespace App\Browser\Jobs\HellcaseBattles; +use App\Browser\JobDebugScreenshot; use App\Browser\Jobs\Hellcase\HellcaseJob; use App\Models\HellcaseBattle; use App\Models\Job; @@ -70,13 +71,12 @@ class HellcaseBattlesJob extends HellcaseJob implements ShouldBeUniqueUntilProce $browser->visit('https://hellcase.com/casebattle'); $browser->waitForText("CASES", 30, true); - AllNotification::send(new JobDebugNotification($this->jobId, "I hate niggers")); - // Sort by price try { $sortByPriceDiv = $browser->driver->findElement(WebDriverBy::xpath("//*[span[contains(text(), 'Value')]]")); $sortByPriceDiv->click(); } catch (Exception $e) { + $browser->screenshot(JobDebugScreenshot::getFileName($this->jobId)); AllNotification::send(new JobDebugNotification($this->jobId, "Failed to sort by price")); return; } @@ -112,9 +112,7 @@ class HellcaseBattlesJob extends HellcaseJob implements ShouldBeUniqueUntilProce private function sendFinishedBattles(Browser $browser) { // foreach battle that we didn"t already planned to add with $this->battlesToAdd foreach (HellcaseBattle::all() as $battle) { - dump($battle); if (!array_key_exists($battle->getUrl(), $this->battlesToAdd)) { - dump("finished"); $browser->visit($battle->getUrl()); try { @@ -130,7 +128,7 @@ class HellcaseBattlesJob extends HellcaseJob implements ShouldBeUniqueUntilProce } private function sendBattle(Browser $browser, HellcaseBattle $battle) { - AllNotification::send(new JobDebugNotification($this->jobId, "Battle sent" . $battle->getUrl())); + AllNotification::send(new JobDebugNotification($this->jobId, "Battle sent" . $battle->getUrl(), screenshotProjectPath:null)); } private function createNewBattles() {