robertfausk / behat-panther-extension

Run your behat tests in a headless chrome/firefox - Symfony Panther extension for Behat
https://packagist.org/packages/robertfausk/behat-panther-extension
Other
30 stars 5 forks source link

Allow to pass variables/arrays to options #11

Closed platosinski closed 2 years ago

platosinski commented 2 years ago

PatherTestCaseTrait::startWebServer accepts $options and one of them can be array of env vars (https://github.com/symfony/panther/blob/39efc06a5958746844a523fb31f6cc5955b3c9e4/src/PantherTestCaseTrait.php#L116) but PantherConfiguration requires options to be scalar. Could you change scalarPrototype() inside addOptionsNode() to variablePrototype() (like you did it in addManagerOptionsNode())?

That change will allow to pass e.g. APP_ENV to Panther internal WebServerManager.

Additionally i would like to note that passing kernel_options to PantherDriver is useless, because these are not used, when PantherTestCaseTrait is used by class which doesn't extend KernelTestCase.

robertfausk commented 2 years ago

Thanks for your issue. I am currently at holidays. So I will have a deeper look at it next week.

platosinski commented 2 years ago

Do you have some time now to look at it?

robertfausk commented 2 years ago

@platosinski Have a look at v1.1.1 by simply doing a composer update --with-dependencies robertfausk/behat-panther-extension :balloon:

And sorry for long delay :pray:

platosinski commented 2 years ago

Great! Works like a charm! Thanks a lot!