nunomaduro / laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.
MIT License
150 stars 20 forks source link

Multiple browsers #19

Closed shadoWalker89 closed 10 months ago

shadoWalker89 commented 4 years ago

Hi,

Laravel dusk allows to create more then one browser like this

$this->browse(function ($first, $second) {
    $first->loginAs(User::find(1))
          ->visit('/home')
          ->waitForText('Message');

    $second->loginAs(User::find(2))
           ->visit('/home')
           ->waitForText('Message')
           ->type('message', 'Hey Taylor')
           ->press('Send');

    $first->waitForText('Hey Taylor')
          ->assertSee('Jeffrey Way');
});

This is not possible in laravel zero due to always passing one browser in https://github.com/nunomaduro/laravel-console-dusk/blob/9ae9a9a47944f8490b7a6d6a25e0d01405fd8545/src/Manager.php#L30-L35

manelgavalda commented 4 years ago

Hey, Just created a PR for this. @owenvoke @nunomaduro I would appreciate if you can take a look at it. Thanks!