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

Comments

Projects
None yet
2 participants
@mpgo13
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 7, 2016

Member

did you try:

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

?

Member

DavertMik commented Dec 7, 2016

did you try:

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

?

@mpgo13

This comment has been minimized.

Show comment
Hide comment
@mpgo13

mpgo13 Dec 7, 2016

Contributor

@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
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 8, 2016

Member

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

Member

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

@DavertMik DavertMik closed this in #3927 Jan 18, 2017

DavertMik added a commit that referenced this issue Jan 18, 2017

Config overriding improvements (#3927)
* Config overriding improvements: throw error when yaml can't be parsed, improved yaml parsing. Fixes #3820

* added new test for override option
@mpgo13

This comment has been minimized.

Show comment
Hide comment
@mpgo13

mpgo13 Feb 7, 2017

Contributor

thank you @DavertMik, works now 👍

Contributor

mpgo13 commented Feb 7, 2017

thank you @DavertMik, works now 👍

chris1312 added a commit to chris1312/Codeception that referenced this issue Jun 16, 2017

Config overriding improvements (#3927)
* Config overriding improvements: throw error when yaml can't be parsed, improved yaml parsing. Fixes #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