Skip to content

Docker context : using Selenium With the Built-In Web Server #674

@adpeyre

Description

@adpeyre

Hi,

The following configuration can't be used in a Docker context. I need to specify 0.0.0.0 as the host for the built-in PHP server, and use the PHP container name as the $baseUri.".

$client = Client::createPantherClient(
    options: [
        'hostname': '0.0.0.0' 
        'browser' => PantherTestCase::SELENIUM,
    ],
    managerOptions: [
        'host' => 'http://selenium-hub:4444', // the host of the Selenium Server (Grid)
        'capabilities' => DesiredCapabilities::firefox(), // the capabilities of the browser
    ],
);

Would it be possible to add a new base_uri option to separate the server binding and the base URI configuration?

Currently, I need to do something like this :

static::startWebServer(['hostname' => '0.0.0.0', 'port' => 9080]);
self::$baseUri = 'http://my_container_php:9080';
$client = static::createPantherClient(
    options: [
        'browser' => PantherTestCase::SELENIUM,
    ],
    managerOptions: [
        'host' => 'http://selenium:4444/wd/hub', // the host of the Selenium Server (Grid)
        'capabilities' => DesiredCapabilities::chrome(), // the capabilities of the browser
    ],
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions