【发布时间】:2018-04-18 10:52:18
【问题描述】:
我需要使用 cron 运行 Laravel (5.6.13) Dusk 测试。
我已经设置了时间表,但它不起作用。
日志中没有错误或某些信息。可能是设置不正确?
从控制台手动运行时,一切正常。
\app\Console\Kernel.php:
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule)
{
$schedule->command('dusk tests/Browser/ProductComment.php')->everyFifteenMinutes();
}
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
【问题讨论】:
-
你怎么知道它不起作用?你有错误吗?
-
为什么要每 15 分钟运行一次测试?
-
@TheFallen> 所有测试都有日志系统,将信息(开始和结束时间)插入数据库。
-
您应该使用
->sendOutputTo('file.log')保存执行的输出以查看发生了什么。
标签: laravel laravel-dusk