Jon Kern | 1 Mar 2012 01:03
Picon
Gravatar

Re: [Cucumber:10594] Testing recovery from server errors

ahhh, so you want to simulate when a filled-in form is submitted from an 
expired session.

jon

blog: http://technicaldebt.com
twitter: http://twitter.com/JonKernPA

Paul said the following on 2/29/12 5:02 PM:
> What I'm attempting to test is, at any point in the process, the user
> can step away from the browser for a while, then come back and click
> something. It is my wish that the user has a good experience when
> doing that. And I think this would be really hard to test manually.
>
> On normal GET requests, I know Devise does a good job of sending you
> to the log in page, and redirecting you back to where you need to go.
> I don't feel the need to test that.
>
> However, if the user clicks a link that POSTs some data through ajax,
> then what will happen is that html is returned that is the Devise
> login page. The user's data is not saved.
>
> I plan to detect that situation in the browser and pop up a dialog
> asking the user for a password, then resubmitting the request.
> However, before I do that, I would like to write a test.
>
> I suspect that a number of other people have the exact same situation,
> so before I recreate the wheel, I thought I would see if there were
> any existing Best Practices for this situation.
>
(Continue reading)

Paul Harris | 1 Mar 2012 13:42
Picon

[Cucumber:10595] cucumber-jvm equivalent of jbehave <at> BeforeStory and <at> AfterStory

Hi,

I was wondering if there was a way to perform the equivalent of
 <at> BeforeStory and  <at> AfterStory (from Jbehave) in cucumber-jvm. What I
would basically like is a way to have something run once before a
feature file and once when it is done. I tried to look into the the
hooks but they seem to work on a per scenario basis only.

I would also be interested in knowing if there is also a hook above
this e.g. it will run once regardless of the number of feature files
before anything is done and once after everything is complete.

I might be being stupid and have just missed how to accomplish this,
with ruby it is was obviously done outside of cucumber in the ruby
files itself so it might be that I have to do the same here.

Thanks for help,

Paul

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.

Aslak Hellesøy | 1 Mar 2012 13:51
Picon
Gravatar

[Cucumber:10597] Re: cucumber-jvm equivalent of jbehave <at> BeforeStory and <at> AfterStory



On Thursday, March 1, 2012 12:42:32 PM UTC, Paul Harris wrote:
Hi,

I was wondering if there was a way to perform the equivalent of
<at> BeforeStory and <at> AfterStory (from Jbehave) in cucumber-jvm. What I
would basically like is a way to have something run once before a
feature file and once when it is done. I tried to look into the the
hooks but they seem to work on a per scenario basis only.


No, currently not.

What is it that you want to run once per feature, and why only once?
 
I would also be interested in knowing if there is also a hook above
this e.g. it will run once regardless of the number of feature files
before anything is done and once after everything is complete.


Regular static java code blocks. And regular java shutdown hooks.

Aslak

I might be being stupid and have just missed how to accomplish this,
with ruby it is was obviously done outside of cucumber in the ruby
files itself so it might be that I have to do the same here.

Thanks for help,

Paul

--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cukes/-/JD7bs6cHl9UJ.
To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to cukes+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
Klaus Bayrhammer | 1 Mar 2012 14:08
Picon
Favicon

[Cucumber:10597] Run specific scenarios identified by names

Hi,


Is there a way to run specific scenarios in Cucumber-jvm when I want to identify them by their names?

Given the feature-file calc.feature

Feature: Basic Arithmetic
  Background: A Calculator
    Given a calculator I just turned on

  Scenario: Addition
    # Try to change one of the values below to provoke a failure
    When I add 4 and 5
    Then the result is 9

  Scenario: AnotherAddition
    # Try to change one of the values below to provoke a failure
    When I add 4 and 7
    Then the result is 11

Can I run the scenario "Another Addition" with a command like Main.main("features/calc.feature#AnotherAddition"). I know there is a way to run specific line numbers of a feature but they are likely to be changed so I would prefer a mechanism to identify scenarios by their names.

Greets Klaus


--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cukes/-/50dNQTp52MgJ.
To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to cukes+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
aslak hellesoy | 1 Mar 2012 14:24
Picon
Gravatar

Re: [Cucumber:10598] Run specific scenarios identified by names

On Thu, Mar 1, 2012 at 1:08 PM, Klaus Bayrhammer
<klaus.bayrhammer@...> wrote:
> Hi,
>
> Is there a way to run specific scenarios in Cucumber-jvm when I want to
> identify them by their names?
>

Not yet: https://github.com/cucumber/cucumber-jvm/issues/233

> Given the feature-file calc.feature
>
> Feature: Basic Arithmetic
>   Background: A Calculator
>     Given a calculator I just turned on
>
>   Scenario: Addition
>     # Try to change one of the values below to provoke a failure
>     When I add 4 and 5
>     Then the result is 9
>
>   Scenario: AnotherAddition
>     # Try to change one of the values below to provoke a failure
>     When I add 4 and 7
>     Then the result is 11
>
> Can I run the scenario "Another Addition" with a command
> like Main.main("features/calc.feature#AnotherAddition"). I know there is a
> way to run specific line numbers of a feature but they are likely to be
> changed so I would prefer a mechanism to identify scenarios by their names.
>
> Greets Klaus
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/50dNQTp52MgJ.
> To post to this group, send email to cukes@...
> To unsubscribe from this group, send email to
> cukes+unsubscribe@...
> For more options, visit this group at
> http://groups.google.com/group/cukes?hl=en.

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.

Graham Berks | 1 Mar 2012 15:41
Gravatar

[Cucumber:10599] Using xstream to generate objects from table definitions.

Hi, do you have an example to follow ?

Going from RC13 to RC16 has broken our tests with the current xstream
conversions we are doing.

Thanks

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.

Graham Berks | 1 Mar 2012 15:44
Gravatar

[Cucumber:10600] Re: Using xstream to generate objects from table definitions.

Specifically the  <at> XStreamAlias we use to convert names fails.

Has something been removed to introduce these types to xstream ?

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.

Jeff Nyman | 1 Mar 2012 15:45
Picon
Gravatar

[Cucumber:10601] Cuking it Right -- Large Contexts

So I'm continually in search of how to "Cuke it Right" and I keep
stumbling over things when you have applications that are more complex
than your average shopping cart. What I'm hoping to do here is have
any and all critique what I present and tell me where I'm either doing
it wrong or missing an approach that I should be using.

Here's the context:

(1) I work on an application that has Plans that are associated with
Studies. Different studies may cause different default values in the
plans.

(2) We currently have no "gold data" -- meaning data I can rely on
being in place. The idea is that our tests create all data conditions.

Here's the intent of the tests:

(1) When a plan is associated with a study that is set up as phase 4,
the default values on plans should be checked.

(2) When a plan is associated with a study that is set up as anything
other than phase 4, the default values on plans should be checked.

As you can guess, the defaults differ based on the plan->study
association.

So here is an example of what I came up with just for the context
(meaning the Given):

============================
Feature: Changes to Plans Based on Study Phase

Background:
    Given a new study with
      | Name  | Test Study 1 |
      | Phase | 4 no IND |
    And a new study with
      | Name  | Test Study 2 |
      | Phase | 2 |

    Given a new plan with
      | Name  | Test Plan 1  |
      | Location | USA  |
      | Number of Sites | 10 |
      | Subjects to Randomize | 10 |
      | Avg Grant Amount | 100
      | MOH/FDA Delay | 0 |
      | Location | Canada |
      | Number of Sites | 10 |
      | Subjects to Randomize | 10 |
      | Avg Grant Amount | 100
      | MOH/FDA Delay | 0 |

    And a new plan with
      | Name  | Test Plan 2  |
      | Location | USA   |
      | Number of Sites | 10 |
      | Subjects to Randomize | 10 |
      | Avg Grant Amount | 100
      | MOH/FDA Delay | 0 |
      | Location | Canada |
      | Number of Sites | 10 |
      | Subjects to Randomize | 10 |
      | Avg Grant Amount | 100
      | MOH/FDA Delay | 0 |
============================

Yikes, huh? But that is the full context needed for the tests. I need
two studies and I need two plans. One study has a specific type of
phase and the other study has a different one. The two plans are
needed because each plan will have to be associated with one of the
studies. Specifically:

Test Plan 1 associated with Test Study 1
Test Plan 2 associated with Test Study 2

The locations are important because those are part of what are being
checked as part of the test.

Originally I tried to provide a sort of "signature" to make the
context shorter, like this:

============================
    And a new plan with
      | Name  | Test Plan 2  |
      | Location | USA    | 10 | 10 | 100 | 0 |
      | Location | Canada | 10 | 10 | 100 | 0 |
============================

Here the location lines would be "signatures" for values. In other
words, the "convention" is that if the row starts with Location, the
next cell must be the country and the next four cells will be defined
behind the scenes. But that doesn't work, of course, because then I
have differing columns.

Hopefully I've provided enough context for why I came up with what I
did above. What I'm curious about is what I could have done better or
even entirely differently.

I haven't even gotten to the When and Then yet because I'm worried
about inundating this post. But just so you all have some context,
here is what a typical When-Then looks like when used with the above
context:

============================
Scenario: Verify defaults on Site tab
    When the Site tab is viewed on plan named "Test Plan 1"
    Then the following fields will have the following values:
      | Percent of sites identified by sponsor:
| 100 | 20 |
      | Percent of sites requiring a pre-study site visit (in-person):
| 0   | 0  |
      | Percent of sites requiring site initiation visits (in-person):
| 0   | 0  |
      | Percent of onsite close-out visits:
| 0   | 0  |
      | Percent of sites requiring a QA audit:
| 0   | 0  |
      | Percent of sites using BOTH a central and a local IRB/EC:
| 0   | 0  |
      | Percent of sites using ONLY a central IRB/EC:
| 0   | 0  |
      | Percent of sites using ONLY a local IRB/EC:
| 0   | 0  |
============================

There would be another scenario that verifies the Site tab on Test
Plan 2. Those long names you see there in the first column are the
actual names of the labels in our application. Testers are asked to
put them in exactly because it cuts down on guesswork regarding how
much or how little of the label to put in place.

I know this is a long example and a lot to parse through but if anyone
has any ideas, I'm certainly willing to listen.

- Jeff

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.

ruud144 | 1 Mar 2012 15:24
Picon

[Cucumber:10602] custom message for expectation possible

hi group,

I started using cucumber recently; it is a bit of another approach (I
used the ruby built-in test/unit), but I like it.
I am not a fluent cucumber or Rspec user yet, so I hope you can help
me with this one:

I want to make a custom message for the line

message.should == 'success'

but I somehow do not have enough understanding of how to pass the
custom message to the should routine. Can you help me?

thanks in advance, Ruud

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.

aslak hellesoy | 1 Mar 2012 15:52
Picon
Gravatar

Re: [Cucumber:10603] Using xstream to generate objects from table definitions.

On Thu, Mar 1, 2012 at 2:41 PM, Graham Berks <graham@...> wrote:
> Hi, do you have an example to follow ?
>

Not sure what you mean.

> Going from RC13 to RC16 has broken our tests with the current xstream
> conversions we are doing.
>

Did you try RC14 and RC15? Might be easier to spot where the
regression was introduced.

Also - need some code to reproduce the regression. Can you file a
ticket please? Or better - a pull request with a failing feature, for
example in the java-calculator examples module.

See changes here:

https://github.com/cucumber/cucumber-jvm/compare/v1.0.0.RC13...v1.0.0.RC14
https://github.com/cucumber/cucumber-jvm/compare/v1.0.0.RC14...v1.0.0.RC15
https://github.com/cucumber/cucumber-jvm/compare/v1.0.0.RC15...v1.0.0.RC16
https://github.com/cucumber/cucumber-jvm/compare/v1.0.0.RC13...v1.0.0.RC16

Aslak

> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cukes@...
> To unsubscribe from this group, send email to cukes+unsubscribe@...
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>

--

-- 
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes@...
To unsubscribe from this group, send email to cukes+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.


Gmane