Thanks Thomas for your response.So we are using Cucumber to test different protocol level calls i.e. Diameter, RADIUA, SOAP etcJust for an example here for repetitive diameter call we are now writing same step again and again so feature file become clumsy and tough to maintain. For that we was trying to implement the loop call.One good news that finally by using Spring AOP I am able to implement that and now we can write feature file with loop grammar. And Loop grammar will just repeat all the steps till the loop end grammar reached.Given I loop 500 timesWhen I send .....Then I receive ....Given I end loop
for (int i = 1; i < loopSize; i++) { LOGGER.debug("\n------------------------------- Loop call {}/{}---------------------------------",i,loopSize); for (ProceedingJoinPoint loopCall : loopCallList) { try { loopCall.proceed(); LOGGER.debug("Call proceeded"); } catch (Throwable e) {
LOGGER.error("Loop Execution failed. Error:"+ e.getMessage());// LOGGER.error("\n------------------------------- Loop call {}/{} End ---------------------------------",i,loopSize);// throw new AssertionError(e.getMessage());// throw new PendingException(e.getMessage()); } finally { //TODO } } LOGGER.debug("\n------------------------------- Loop call {}/{} End ---------------------------------",i,loopSize); }
I think this implementation will be possible for only one single step. But I was looking for multiple steps within the loop and loop grammar will be generic implementation and will execute any step within it.
I think this implementation will be possible for only one single step. But I was looking for multiple steps within the loop and loop grammar will be generic implementation and will execute any step within it.
--
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/cs9fxMRbP3k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
Thank you all for all your suggestions and examples. My requirement may be sounds like nonsense but I would like to explain it so that I get more suggestions and avoid misunderstanding here .In my implementation I have tried to expose minimum Gherkin grammar for maximum test case coverage so with above example of Andrew(Tea making) may be I have glue implementation likeThen I add (.*) => here you can add Tea or Coffee or Coco and prepare your drinkAlso you can add Sugar by using the above step. But for Tea it may be 2 spoon and for Coffee it may be 3 spoon. So, here by writing the loop Gherkin grammar Sugar addition can be controlled and you can make your drink as you need.
Actually we have used cucumber to read the feature files(our test cases) and via glue implementation passed the call/control to our abstracted protocol simulator drivers i.e. Diameter, RADIUS, SOAP, REST, SMPP, SMTP, SCTP etc . And specifically for few protocol call validation loop or conditional check was essential.I will also request everyone not to break the best practices of cucumber and this may be a typical requirement very specific to our case and may not be generic to cucumber framework.//Samar
On Monday, 15 February 2016 14:04:47 UTC+5:30, Roberto Lo Giacco wrote:
Il giorno lunedì 15 febbraio 2016 07:53:01 UTC+1, Samar Mukherjee ha scritto:I think this implementation will be possible for only one single step. But I was looking for multiple steps within the loop and loop grammar will be generic implementation and will execute any step within it.It's not that difficult to understand if you just try to read without focusing on what you are looking for only: Cucumber IS NOT a testing framework.Creating a generic sequence of steps does make absolutely no sense in Cucumber or Gherkin, which means either you are misunderstanding what has been asked you to do or who gave you the goal doesn't understand what he is asking for.Steps should not be generic, on the other end they should specific enough to avoid ambiguity, each and every one of them.This does not mean you cannot have looping code, but the loop should not be exposed as such to the feature reader: the above example is perfect, you have to take your time and understand what we are trying to say because it is not about how to solve your problem, instead we are telling you your problem is caused by a misuse or misunderstanding of what Cucumber (and Gherking) is meant for.There are plenty of resources out there, most of them written by expert people or even the creators of Cucumber, which I suggest you read.Regards,Roberto
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.