Files
DatBrowser/app/Browser/JobErrorScreenshot.php
Matthias Guillitte 6a95653c52
All checks were successful
Push image to registry / build-image (push) Successful in 5m20s
Added notification on job fail
2025-03-01 15:12:15 +01:00

28 lines
747 B
PHP

<?php
namespace App\Browser;
use Laravel\Dusk\Browser;
use function rtrim;
class JobErrorScreenshot {
public const IMG_FILE_NAME = "failure-";
private static function getFileName(int $jobId): string {
return static::IMG_FILE_NAME . $jobId . ".png";
}
public static function getImgFileAbsolutePath(int $jobId): string {
return rtrim(Browser::$storeScreenshotsAt, '/') . "/" . static::getFileName($jobId);
}
public static function getImgFileProjectPath(int $jobId): string {
return app_path("Browser/screenshots/" . static::getFileName($jobId));
}
public static function getImgFileExternalPath(int $jobId): string {
return "screenshots/" . static::getFileName($jobId);
}
}