I have environment configuration in my acceptance.suite.yml config file. One of the parameters is language. I need to know this parameter value in the actual test code to be able to drive test steps correctly.
acceptance.suite.yml config content:
class_name: WebGuy
modules:
enabled:
- WebDriver
- WebHelper
- Db
config:
WebDriver:
browser: firefox
env:
eng:
modules:
config:
WebDriver:
url: 'localhost'
lang: en
esp:
modules:
config:
WebDriver:
url: 'localhost'
lang: es
How can I get the language parameter value?
codecept run --steps : print step-by-step execution. codecept run -vv : print steps and debug information. codecept run --debug : alias for -vv. codecept run -vvv : print Codeception-internal debug information.
Codeception is very flexible framework that you can use to write your Selenium tests.
assertGreaterThanOrEqual. Asserts that a value is greater than or equal to another value.
I had the same problem and found help on Codeception forums. Here's how you can access config content as mentioned by user Dan.
$config = \Codeception\Configuration::config();
$apiSettings = \Codeception\Configuration::suiteSettings('api', $config);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With