Laravel - Dusk 如何在生产环境中使用代码运行 dusk 命令?

问题描述 投票:0回答:1

在类的函数中我有这段代码

public function ....
...
$command = 'php artisan dusk --filter=FetchSingleProductDetailTest';
$output = shell_exec($command);
...

它在本地环境中有效,但在生产环境中无效,在生产环境上运行手动命令

php artisan dusk --filter=FetchSingleProductDetailTest
成功运行,没有错误,但无法使用代码运行 我尝试按照 this post 进行操作,但它返回错误
The "pest" option does not exist.
,即使我安装了
pestphp/pest-plugin-laravel, pestphp/pest
并运行了命令
php artisan pest:install

有什么办法可以解决这个问题吗?

laravel laravel-dusk
1个回答
0
投票

检查

composer.json
文件以确保
pest
列在 required 包下而不是 required-dev 下。

© www.soinside.com 2019 - 2024. All rights reserved.