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

Add ability to pass in custom values via config #55

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

Cruikshanks
Copy link
Member

Currently the config Quke exposes is for controlling how it runs and behaves. However feedback has shown that projects based on Quke often require their own configuration values. A common example is usernames and passwords for accounts when testing features that require authentication.

Now there are options for dealing with this; setting environment variables and then reading them in within the project being the most obvious solution. You could even write your own configuration mechanism if you had the necessary skills.

However Quke is specifically targeted at team members who may not have development backgrounds, and therefore aims to make creating acceptance tests as simple as possible.

For this reason, and from speaking with current users we have chosen to extend the existing configuration functionality in Quke to allow users to add their own custom values, which they can then access from the Quke config class within their projects. This means users only have to think about one source for all the configuration within their projects, the .config.yml file.

This change adds a new method to Quke::Configuration called custom(), which returns whatever values have been set under a root node called custom in the .config.yml file. Being YAML, this could be simple key value pairs, or a whole new object in itself.

We have also expanded the section on configuration in the README.md to cover this, providing examples of the things you can add and how to access them from your projects.

@Cruikshanks Cruikshanks added the enhancement New feature or request label Mar 7, 2017
@Cruikshanks Cruikshanks self-assigned this Mar 7, 2017
Currently the config Quke exposes is for controlling how it runs and behaves. However feedback has shown that projects based on Quke often require their own configuration values. A common example is usernames and passwords for accounts when testing features that require authentication.

Now there are options for dealing with this; setting environment variables and then reading them in within the project being the most obvious solution. You could even write your own configuration mechanism if you had the necessary skills.

However Quke is specifically targeted at team members who may not have development backgrounds, and therefore aims to make creating acceptance tests as simple as possible.

For this reason, and from speaking with current users we have chosen to extend the existing configuration functionality in Quke to allow users to add their own custom values, which they can then access from the Quke config class within their projects. This means users only have to think about one source for all the configuration within their projects, the `.config.yml` file.

This change adds a new method to `Quke::Configuration` called `custom()`, which returns whatever values have been set under a root node called `custom` in the `.config.yml` file. Being YAML, this could be simple key value pairs, or a whole new object in itself.

We have also expanded the section on configuration in the README.md to cover this, providing examples of the things you can add and how to access them from your projects.
@Cruikshanks Cruikshanks merged commit 322c847 into master Mar 7, 2017
@Cruikshanks Cruikshanks deleted the feature/custom-config branch March 7, 2017 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant