giorgiosironi / phpunit-selenium

Selenium RC integration for PHPUnit
http://www.phpunit.de/
Other
601 stars 270 forks source link

Run all methods including setUp, __constructor, ... #459

Open ondrejkrajcik-blogic opened 3 months ago

ondrejkrajcik-blogic commented 3 months ago

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());
    }
}