phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

Run all methods including setUp, __constructor, ...

Open ondrejkrajcik-blogic opened this issue 1 year ago • 1 comments

Hi,

I create first test

When I run my test phpunit run all methods including setUp, __constructor and others

When I downgrade phpunit/phpunit from 9.6.8 to 9.3.11 then only methods with prefix "tests" are started.

Is there some incompatibility?

<?php

use PHPUnit\Extensions\Selenium2TestCase;

require_once __DIR__ . '/../bootstrap.php';

class ExampleTest extends Selenium2TestCase
{
    public $browser = 'firefox';

    protected function setUp(): void
    {
        $this->setBrowser($this->browser);
        $this->setBrowserUrl('http://jmather.com/');
    }

    public function testTitle()
    {
        $this->url('/');
        $title = "It's Majax";
        $this->assertEquals($title, $this->title());
    }

    public function testSomeNavigation()
    {
        $this->url('/');
        $this->byXPath('//section[@class="widget widget_categories"]//a[text() = "PHP"]')->click();
        $title = "PHP | It's Majax";
        $this->assertEquals($title, $this->title());
    }
}

ondrejkrajcik-blogic avatar May 01 '24 09:05 ondrejkrajcik-blogic