Note that there are some explanatory texts on larger screens.

plurals
  1. POmarkTestSkipped() not working with sausage-based Selenium tests via Sauce Labs
    primarykey
    data
    text
    <p>I am using the <a href="https://github.com/jlipps/sausage" rel="nofollow">sausage</a> framework to run parallelized phpunit-based Selenium web driver tests through Sauce Labs. Everything is working well until I want to mark a test as skipped via markTestSkipped(). I have tried this via two methods: </p> <p>setting markTestSkipped() in the test method itself: </p> <pre><code>class MyTest { public function setUp() { //Some set up parent::setUp(); } public function testMyTest() { $this-&gt;markTestSkipped('Skipping test'); } } </code></pre> <p>In this case, the test gets skipped, but only after performing setUp, which performs a lot of unnecessary work for a skipped test. To top it off, phpunit does not track the test as skipped -- in fact it doesn't track the test at all. I get the following output:</p> <pre><code>Running phpunit in 4 processes with &lt;PATH_TO&gt;/vendor/bin/phpunit Time: &lt;num&gt; seconds, Memory: &lt;mem used&gt; OK (0 tests, 0 assertions) </code></pre> <p>The other method is by setting markTestSkipped() in the setUp method:</p> <pre><code>class MyTest { public function setUp() { if (!shouldRunTest()) { $this-&gt;markTestSkipped('Skipping test'); } else { parent::setUp(); } } protected function shouldRunTest() { $shouldrun = //some checks to see if test should be run return $shouldrun; } public function testMyTest() { //run the test } } </code></pre> <p>In this case, setUp is skipped, but the test still fails to track the tests as skipped. phpunit still returns the above output. Any ideas why phpunit is not tracking my skipped test when they are executed in this fashion?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload