-
Notifications
You must be signed in to change notification settings - Fork 14
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
String parameter beginning with numbers are wrongly interpreted as numbers #190
Comments
Re-opening to cover the following case #191 (comment) |
We also need to be careful with a simple |
I believe this is covered in the current code. I've tried the following.
Have you tried running it? |
In 0.3.5 I'm getting "1" passed down as a number instead of string. This is my step.
And this is my step implementation: @Step("Write <value> into <name>")
public static async writeInto(value: string, name: string) { /*...*/ } To clarify: this step is a part of test that will check that the field shows "invalid phone number" warning. Is it possible to get the correct type from the implementation method definition instead of blindly trying to convert to number if it fits? |
Describe the bug
Say we have spec like this one:
* Get product with id "81423165-ad04-4c7b-9f85-75d1a8aa1b0d"
Since #186, which now uses
Number.parseFloat
directly instead ofNumber
constructor in thePrimitiveParser
, strings like the UUID above or even parameters which could be product IDs like "012345" are now successfully converted to Number (instead ofNaN
), dropping useful characters in the process (excess hex letters for the UUID, leading zeroes for the product ID)...which makes it pretty much unusable right now.To Reproduce
Steps to reproduce the behavior:
Just use a UUID or a static parameter beginning with one or more 0
Expected behavior
A clear and concise description of what you expected to happen.
With a spec like:
* Get product with id "81423165-ad04-4c7b-9f85-75d1a8aa1b0d"
and an implementation like:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: