Search code examples
codeception

Can I use a %variable% in module section of codeception environment file?


I tried to have the server address injected to the test with environment variable ABSOLUTE_URL so PhpBrowser would test against it. The config I wanted to do is something like this:

class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser:
            url: "%ABSOLUTE_URL%"

But I simply could not get it to work. Is there anyway I can do it?


Solution

  • Add params section to codeception.yaml file:

    params:
        - env
    

    Documented at https://codeception.com/docs/06-ModulesAndHelpers#Dynamic-Configuration-With-Parameters