0

I want to skip a test case for now in laravel dusk intead of commenting or deleting it, but I could not find the documentation on how to skip the test case.

My Testcase looks like

<?php

namespace Tests\Browser\Auth;

use App\Models\User;
use DateTime;
use Faker\Factory;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

class AuthTest extends DuskTestCase
{
 

    // test I want to skip
    public function testName1()
    {
        $this->browse(function (Browser $browser) {
         // ...
        }
     }


    public function testName2()
    {
        $this->browse(function (Browser $browser) {
         // ...
        }
     }

}

Viraj Singh
  • 1,951
  • 1
  • 17
  • 27
  • Dusk extends PHPUnit, so you can just remove "test" from the beginning of the function name and it won't be run. However...this seems like a bad idea. Without commenting out or deleting the test function, you run a *huge* risk of confusion in the future. You may not notice that it's being skipped and expect it's functionality to be working, or make changes to the test and not notice it's not begin run. I very much advice against this. – Brian Thompson Nov 19 '21 at 14:28
  • 1
    The linked duplicate is a better alternative to my naming suggestion. PHPUnit has a `$this->markTestSkipped();` method that will print "S" to the output as a reminder that it is not being tested. – Brian Thompson Nov 19 '21 at 14:39
  • Thanks Brian. `this->markTestSkipped();` works for dusk as well as php unit. – Viraj Singh Nov 19 '21 at 15:51

0 Answers0