diff --git a/src/Laravel/Commands/PestTestCommand.php b/src/Laravel/Commands/PestTestCommand.php index 112b394b..32650161 100644 --- a/src/Laravel/Commands/PestTestCommand.php +++ b/src/Laravel/Commands/PestTestCommand.php @@ -19,7 +19,7 @@ final class PestTestCommand extends Command * * @var string */ - protected $signature = 'pest:test {name : The name of the file} {--unit : Create a unit test}'; + protected $signature = 'pest:test {name : The name of the file} {--unit : Create a unit test} {--dusk : Create a dusk test}'; /** * The console command description. @@ -36,7 +36,7 @@ final class PestTestCommand extends Command /** @var string $name */ $name = $this->argument('name'); - $type = ((bool) $this->option('unit')) ? 'Unit' : 'Feature'; + $type = ((bool) $this->option('unit')) ? 'Unit' : (((bool) $this->option('dusk')) ? 'Browser' : 'Feature'); $relativePath = sprintf('tests/%s/%s.php', $type, diff --git a/stubs/Browser.php b/stubs/Browser.php new file mode 100644 index 00000000..ad9f2218 --- /dev/null +++ b/stubs/Browser.php @@ -0,0 +1,10 @@ +browse(function (Browser $browser) { + $browser->visit('/{name}') + ->assertSee('{name}'); + }); +});