Xceptance / neodymium-library

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
MIT License
80 stars 11 forks source link

Using YAML reserved keywords in localization file causes an initialization error #68

Closed rkl-xc closed 5 years ago

rkl-xc commented 5 years ago

Using e.g. Yes: Ja; in the localization.yaml causes a test run to stop with an initialization error, that is currently not closer specified to the test developer. A solution might be to be to provide more feedback when occurred or to avoid this error in the means of localization.

occupant23 commented 5 years ago

Analyzed this problem and found it is hard to find a good solution for all auto conversions, that could happen in YAML.

So we decided to implement the proposed solution. When such errors occur we catch them and throw a RuntimeException providing the following message to the user:

Localization keys must be of type String. (e.g. use "Yes" instead of Yes as key. This is due to YAML auto conversion.

jowerner commented 5 years ago

Since the auto-conversion of certain literals to booleans is a common pitfall for YAML beginners, we should add a note to the Localization section in the wiki. Especially, that not only values are affected, but also keys.

occupant23 commented 5 years ago

added documentation