Giter VIP home page Giter VIP logo

Comments (11)

developer9969 avatar developer9969 commented on June 12, 2024 1

thanks to you your tool is GREAT!

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

Ah - good catch... It has to do with the way I'm converting it into values for the dynamic.

I have no quick way of testing this but now, but maybe you could surround it with quotes to ... force it to be treated as string, as a workaround

from specflow.assist.dynamic.

developer9969 avatar developer9969 commented on June 12, 2024

thanks for your quick reply do you mean in specflow like this | myfield2 |"01"| not sure what you mean.

Also is there a way to force all the fields to be considered as string ?
thanks

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

@developer9969, yes the quotes as you wrote it is a suggestion for a workaround to see if you can force it to be a string. Or if you can prefix it with a letter - just to "trick" my library into treating it as a string.

Here's a description of the convention based type convention I'm using, to assist you in your tricking of my library.

Sadly there is no way to force it to be a string - and since I've used a convention based conversion function from the outset we probably have to add a configuration property to be able to change that.

Something like

  <specFlow.Assist.Dyamic>
		<useConventionBaseTypeConversion>false</useConventionBaseTypeConversion>
  </specFlow.Assist.Dyamic>

That means that if you set this value to false we will always just use strings. Otherwise, the default behaviour is to do the convention base type conversion as today.

@darrencauthon - what do you think? Would that be a good approach?

Sadly my Windows-time these day is ... seldom. Don't even have a virtual windows around anymore. If we like this approach I'll get around of making this happen.

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

@developer9969 now read my comment from late yesterday I see that it needs some more input.

As a workaround i mean that you can do _07 instead of 07

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

I've fixed this for you @developer9969

Read the documentation at https://github.com/marcusoftnet/SpecFlow.Assist.Dynamic/wiki/Conversion-conventions#disabling-type-conversion and get an updated version of SpecFlow.Assist.Dynamic from NuGet. 1.3.0 contains this fix.

Please let me know how it's working for you

from specflow.assist.dynamic.

developer9969 avatar developer9969 commented on June 12, 2024

Thanks for fixing this so promptly. It does work with your sample but not with mine try this
| Field |Value|
| myfield1 |02|
| myfield2 |01|

and see what you get ? Am I missing the obvious here
thanks again

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

Hmmm - sitting on a Mac again and I have no easy way to test this right now, but from the formatting above I'm thinking that maybe the | needs spaces on the side?

If my examples work, how about modifying them little by little and see if you can understand what is different?

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

@developer9969 that is a bug! A missing case that I didn't account for.

Uploading 1.3.1 version of this tool to nuget as we speak.

The gist of it is that you can create an instance from a table with one row of header and values - like this:

Scenario: There's ways to disable type conversion for instance creation
	When I create a dynamic instance from this table using no type conversion
		| Name   | Age | Birth date | Length in meters |
		| 012345 | 044 | 1972-13-09 | 1,96             | 
	Then the Name value should still be '012345'
	And the Age value should still be '044'
	And the birth date should stil be '1972-13-09'
	And length in meter should still be '1,96'

But your case is a special case, when there are two columns. Because that is interpreted by SpecFlow.Assist.Dynamic as a key/value table that will used like this:

Scenario: There's ways to disable type conversion for instance creation with key/value tables
	When I create a dynamic instance from this table using no type conversion
		| Key              | Value | 
		| Name             | 012345 | 
		| Age              | 044 | 
		| Birth date       | 1972-13-09 | 
		| Length in meters | 1,96 | 
	Then the Name value should still be '012345'
	And the Age value should still be '044'
	And the birth date should stil be '1972-13-09'
	And length in meter should still be '1,96'

But I didn't handle the second case (key/value pairs) until now. Thanks for pointing that out.

SpecFlow.Assist.Dynamic 1.3.1 should fix this for you.

Thank you for making my little tool better!

from specflow.assist.dynamic.

developer9969 avatar developer9969 commented on June 12, 2024

Hi debugged the code and for some reason it always hits the 1st "if" statement cannot work out why it thinks more than 1 rowcount is the way i layout the data in the feature?
image

image

anyway I will play with it at the weekend .

from specflow.assist.dynamic.

marcusoftnet avatar marcusoftnet commented on June 12, 2024

Happy to hear that @developer9969 - does that mean that it works, reg your debugging above? '

Please close the issue if you feel like it solved.

from specflow.assist.dynamic.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.