symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.9k stars 213 forks source link

[v1.1.0] PANTHER_NO_HEADLESS adds --headless #486

Closed metaer closed 2 years ago

metaer commented 2 years ago

Bug in v1.1.0: PANTHER_NO_HEADLESS adds --headless option It behaves as PANTHER_HEADLESS (without "NO") would behave if it existed

        if ($_SERVER['PANTHER_NO_HEADLESS'] ?? true) {
            $args[] = '--headless';
            $args[] = '--window-size=1200,1100';
            $args[] = '--disable-gpu';
        }

if I have PANTHER_NO_HEADLESS=1 in my .env.local I expect that --headless option will not be added. In v1.0.1 it works this way. But in v1.1.0 it works vice versa.

metaer commented 2 years ago

It seems correct condition is:

if (!($_SERVER['PANTHER_NO_HEADLESS'] ?? false)) {
    $args[] = '--headless';
    $args[] = '--window-size=1200,1100';
    $args[] = '--disable-gpu';
}

Shoud I create PR ?

dunglas commented 2 years ago

Oops my bad. Yes please create a PR I'll tag a patch version ASAP.

metaer commented 2 years ago

PR: https://github.com/symfony/panther/pull/487

dunglas commented 2 years ago

Release tagged! Thanks @metaer