Behrad,
Post by Behrad SadoughianThanks. I really appreciate everybody's help here and I am sorry if what
I said caused anybody think otherwise.
I am gradually reaching the point that I am in the wrong group. My
question is more about Cucumber-JVM implementation while anybody who is
kind enough to help starts to find the methodological issues of the
gherkins I bring here as examples. These are not my real gherkins. Just
examples and I just noticed I wrongly used "John" twice. It should be
another user name as you stated.
I understand that, but it makes it hard to understand your real issues.
Post by Behrad SadoughianI) If gherkin is a originally and collaboration tool not a test case
writing language really doesn't matter. When 99% (my figure) of people
are using it for tests, it is a testing tool (De Facto).
No, that's not true. See
https://cukes.info/blog/2014/03/03/the-worlds-most-misunderstood-collaboration-tool
And thinking of cucumber as a testing tool is a contributor to your
problems.
Post by Behrad SadoughianII) I wish people helped me to understand how my scenario can be
Listen to me. The gherkin is important, and relates to your problem as
far as I can tell.
Post by Behrad SadoughianI am testing the collaboration of different versions and presentation of
the same software. (iOS, Android, WebSite, ChromeApp, Windows). They do
the same thing and different users may use them at the same time. So for
example I need to be sure Windows-5.6.2.1 client can work with
Android-4.1.2.3. Like many other software, it needs concurrency, real
time collaboration etc scenarios.
I know how to write the gherkin. My gherkins are not 100 lines!!! I know
how to even implement this using dependency injection - or - adding a
suffix to all step definitions. That's what I am doing now. I found it
strange that the Cuke-JVM is trying to enforce and push a way of
development and came here to ask if there is any solution.
Your examples are showing a rudimentary understanding of how to write
gherkin, but you could do much better than that. How you write the
scenarios turns out to be quite important.
Post by Behrad SadoughianOn Mon, Apr 13, 2015 at 3:12 PM, George Dinwiddie
Behrad,
I think this is a very common situation and needed by many people. It is
not a mess up. There are many scenarios that you need such features and
if you think a bit you will explore more.
Can you name an example of another person who needs this?
*I know two different teams (other than my company)*
OK, I know hundreds who do not. Perhaps I can help you and those two
teams solve your problems without a rewrite of Cucumber.
Post by Behrad SadoughianWhen "John" is using his Android with version 4.2.1 of software installed
And he logs in
And he sends a chat "Lorem Ipsum" to "John"
When "John" is using his Android with version 7.8.2 of software installed
when he logs in
Then he should receive "Lorem Ipsum" from "John"
Where is the issue here, from your point of view?
*How can the same "when he logs in" step call version 7.8.2 of the glue
and the other one the 4.2.1? I wanted the previous step "When John..."
dynamically change the glues as a solution.*
You don't want to switch on the choice of step definition. I explained
that below.
Post by Behrad Sadoughian*
*
I would suggest not using "John" for both participants. Also, I
would avoid pronouns such as "he" when there are multiple actors in
a scenario. It's easier to keep track if their names are explicitly
specified.
*No, I didn't. This was an example.*
*
*
Nor would I generally suggest "And he logs in" as an explicit step.
I would assume that in most steps, and only explicitly state when
someone is NOT logged in. Perhaps in this case you're trying to
illustrate an asynchronous nature to the communication, where the
second John is notified after logging in. If that's the case, there
might be a way to illustrate that more explicitly.
*This is an example. The actual login steps are different.*
I'm suggesting that logging in is an incidental detail to the scenario.
Putting incidental steps into the scenario treats it as a programming
language rather than as a feature description.
Post by Behrad SadoughianIs this mess up? No it is not. My other example was not a mess up too.
It was just simplified to understand. What people tend to do here, it to
take examples very literal and assume other people are stupid.
I'm not assuming anyone is stupid. I am, however, suspecting that
your step definitions are more imperative than declarative. And I'm
suspecting that you're using the step definitions as a programming
language rather than extracting the programming part into a helper library.
*We write gherkins first and then add the support by programming. So it
is not like that. Please refer also to the points I and II above. *
If you do that, why do you end up with the same steps intending to mean
different things? Perhaps you're not collaborating enough, or not with
the right people.
Post by Behrad SadoughianPeople who bring examples have to make them simple because otherwise I
should write 100 lines and you should read 100 lines, and I have to
reveal things I am not allowed to.
Oh, dear. If your scenarios are 100 lines long, you have bigger
problems than I suspected.
*That was an example!!! I wanted to say that that it would make the
email longer than you can read.*
That might be better than shorter than is understandable. BDD is all
about having discussions so that everybody understands. Trying to
shortcut the process is not more efficient if it leads to misunderstanding.
You're right, though, that long emails can be poor vehicles for code. I
suggest creating a small GitHub project that shows your approach--one
that compiles and runs (even if it demonstrates an error). Put some care
into it, though, to make it representative of your real situation.
Post by Behrad SadoughianShould I expect the next question be: "Lorem Ipsum" is not proper words
and should not be sent in chats!?
There are a number of people on this list trying to help you. I'm
not sure you're taking their advice to heart. Instead, it seems
you're fixed on the solution of changing the design of Cucumber
rather than using it as it's designed. Of course, if it's really
"the best thing" for you, you can fork it and implement that. I
suspect it's only "the best thing" if someone else does the work.
*I know but I feel people but we should differentiate between help and
mind reading. I am now forking in places but I think it is not the best
approach. *
*The same reason, caused Java Packages and C# name spaces be added was
the same reason I need this feature.*
Cucumber is not a programming language. It's a collaboration tool.
Post by Behrad SadoughianI realize that some of the communication issues are due to language,
but also your simplified scenarios do not communicate your issue
well. Nor are you being specific about what is the problem. I think
there are solutions, but so far, it's hard for me to tell exactly
what you're trying to do.
*I think they do if you read them and look at them non-literally. Maybe
I am wrong.*
I cannot read your mind. If you cannot come up with representative
examples, I will misunderstand. People communicate better when they use
examples. That's the reason that Cucumber exists.
Post by Behrad Sadoughian*
*
You say that "glues conflict" but you're only showing steps. The
step definitions should call other code that performs the actual
interaction with the system.
*If steps definitions need to be unique, while your glue steps are not
unique, a glue conflict can happen.*
I do not understand what you mean by that. What is a "glue conflict?"
Post by Behrad SadoughianFor example, a step definition for 'When "John" is using his Android
with version 4.2.1 of software installed' and 'When "John" is using
his Android with version 7.8.2 of software installed' should
remember the platform and version associated with a user name. Then
when the same person (hence the desire to use different names, and
avoid pronouns) performs an action, the step definition can call
code appropriate for that platform and version. I think I would
model the platform and version as a class. An instance of that class
can be associated with John, and when John performs an action, the
method corresponding to that action can be called on that instance.
*This is the same forking solution that I am implementing. But when 99%
your steps are similar it is not easy to maintain forked generic glues
with dependency injection.*
I would not use dependency injection. I would use plain old java code.
Post by Behrad SadoughianDo remember that Cucumber is primarily a collaboration tool, and
secondarily a testing tool. Also remember that you will get more
help with inquiry than confrontation.
*I don't remember that and I don't think it is important at all. There
are many things in this world that their primary purpose was different.
I would definitely say:*
*
*
*- Gherkin/Cucumber is a test writing language*
*Unless you give me some statistics that shows more than 20% of people
are using it for some other purpose.*
You will be disappointed. As a friend once said, "You can use that
screwdriver to paint the wall if you want, but I don't think it will
work very well."
I think that you do not want my help. You already know all the answers,
and discount mine. The funny thing is that you are the one with
difficulties.
Good luck,
George
P.S. You have an odd way of showing appreciation.
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.