From 54563973bd91581f2f2c2ce0fa5e6ec365c86ae5 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:19:16 +0800 Subject: [PATCH] make screenshot filenames sort by time --- features/bootstrap/FeatureContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 385c632..37355c9 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -59,7 +59,7 @@ private function takeScreenshot() { mkdir(self::SCREENSHOTS_PATH); } if (is_dir(self::SCREENSHOTS_PATH)) { - $path = self::SCREENSHOTS_PATH . date('d-m-y') . '-' . uniqid() . '.png'; + $path = self::SCREENSHOTS_PATH . date('Y-m-d_H:i:s_') . uniqid() . '.png'; file_put_contents($path, $screenshot); print "\n\nScreenshot: " . $path; }