Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override capabilities in configuration #3820

Closed
mpgo13 opened this issue Dec 7, 2016 · 4 comments
Closed

Can't override capabilities in configuration #3820

mpgo13 opened this issue Dec 7, 2016 · 4 comments
Labels
BUG

Comments

@mpgo13
Copy link
Contributor

@mpgo13 mpgo13 commented Dec 7, 2016

What are you trying to achieve?

Overriding capabilities in configuration file.

codecept run -o "config: modules: \Helpers\MyWebDriver: capabilities: build: 1234"

My goal is to have kind-of parameters for configuration files. I know that I can only override the global codeception.yml file, which works for a simple level like 'config: key: value', but not for a deeper level than that (as in the example above).

What do you get instead?

Actual Result is configuration doesn't get overrided.

Details

  • Codeception version: 2.2.6
  • PHP Version: 7.0.11
  • Operating System: MacOS Sierra
  • Installation type: Phar
@DavertMik
Copy link
Member

@DavertMik DavertMik commented Dec 7, 2016

did you try:

codecept run -o "modules: config: \Helpers\MyWebDriver: capabilities: build: 1234"

?

@mpgo13
Copy link
Contributor Author

@mpgo13 mpgo13 commented Dec 7, 2016

@DavertMik yes, i tried many combinations, the only thing that worked was

codecept run -o "modules: config:  \Helper\AlexWebDriver:   capabilities:    build: '1234'"

(by indenting with spaces). This seems to allow yaml to parse it correctly. It produces PHP warnings though:

Notice: Uninitialized string offset: 0 in /myproject/codeception/codeception/src/Codeception/Command/Run.php on line 406
@DavertMik
Copy link
Member

@DavertMik DavertMik commented Dec 8, 2016

Thanks for the report, that looks like a bug. I will try to fix that

@DavertMik DavertMik added the BUG label Dec 8, 2016
@DavertMik DavertMik added this to the 2.2.8 milestone Dec 8, 2016
DavertMik added a commit that referenced this issue Jan 18, 2017
…, improved yaml parsing. Fixes #3820
DavertMik added a commit that referenced this issue Jan 18, 2017
* Config overriding improvements: throw error when yaml can't be parsed, improved yaml parsing. Fixes #3820

* added new test for override option
@mpgo13
Copy link
Contributor Author

@mpgo13 mpgo13 commented Feb 7, 2017

thank you @DavertMik, works now 👍

chris1312 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
* Config overriding improvements: throw error when yaml can't be parsed, improved yaml parsing. Fixes Codeception#3820

* added new test for override option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.