Philip Black-Knight | 17 Nov 23:54 2014

[Cucumber] [JVM, Groovy] best practices regarding data base access and cleanup

I'd like to be able to crate users and other domain objects in the fly within my cucumber tests. We are using
cucumber-groovy (+GEB for browser automation) to test a Java/struts2 site. I'm able to access our
services from cucumber with no problem, but I'm wondering if there are any best practices to for cleanimg
up the DB after tests. I would love to be able to recreate the dB between scenarios, but that just isn't an
option at the moment....

 I've created some helper functions to create uses with roles specified in feature, e.g.

Given I login as a user with the roles:
 |role a|role b| role c|
when xxx
then yyy

I'm currentry using the same user name every time, and if the user already exists, I delete it before
creating the new one.  I would like to be able to leave things in a clean state after every test, but I'm not
sure how to go about it.  I've implemented the method to create users as part of a class that gets added to the world:

World {new UserUtils () }

In addition to adding a helper to create the user, the utilitiy class adds a reference to the service and
(when the user is created) a user object on the world, so step definitions can do:
 page.password.value = user.password
And the user gets propagated to every step.

I can see adding a number of these helpers for different domain types, so I'm wondering if there is a way to
register an After() hook when UserUtils is registered with the world.

Or is there another approach that I'm not thinking of. I don't think tags on the scenario will work since I
need different roles (or other parameters set on the user) for different tests, and these are really
'Given' conditions.
(Continue reading)

Robert | 17 Nov 17:26 2014
Picon

[Cucumber] Cucumber-JVM's --format option is deprecated

I recently updated to Cucumber 1.2.0 and I'm now facing the following warning message

WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead.

Here is the class containing the <at> CucumberOptions

import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith

<at> RunWith(Cucumber.class)
<at> CucumberOptions(
        features = ["classpath:features/"]
        , monochrome = true
        , format = ["pretty", "json:target/cucumber.json"]
//        , tags = ["~ <at> manual"]
        , glue = ["src/test/groovy/com/xyz/studio/qa/steps"]
)
class RunDnoteITCase {
}

What would be the equivalent of the above, but using the plugin option?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Ilias Choutopoulos | 14 Nov 20:16 2014
Picon

[Cucumber] error when trying to use cucumber-report with cucumber-spring and selenium-webdriver


receiving error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException:

when using latest versions of cucumber-report, cucumber-spring (also using spring 3.2.4.RELEASE) and selenium-webdiver 

If i remove the cucumber-report (v0.0.23) everything seems to be running finer, but if i enable the dependancy in pom.xml i get the error above. I'm not sure if selenium-webdriver is relevant thought. 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Ilias Choutopoulos | 14 Nov 17:39 2014
Picon

[Cucumber] selenium-webdriver, cucumber and cucumber-report

hello i have the latest versions of all these dependancies in my project

selenium-webdriver 2.44.0
cucumber 1.2.0 (all related deps and cucumber-spring are at 1.2.0)
and cucumber-report 0.0.23 

if i try to run my tests i get an error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException:

however when i remove the cucumber-report dependancy completely from pom.xml everything runs fine. 

do you know if there's some sort of incompatibility ??

thanks

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Ilias Choutopoulos | 14 Nov 20:25 2014
Picon

[Cucumber] [JVM][Cucumber-report] cannot inject auto wired dependancies when using cucumber-report dependancy


receiving error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException:

when using latest versions of cucumber-report, cucumber-spring (also using spring 3.2.4.RELEASE) and selenium-webdiver 

If i remove the cucumber-report (v0.0.23) everything seems to be running finer, but if i enable the dependancy in pom.xml i get the error above. I'm not sure if selenium-webdriver is relevant thought. 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
michael.kehr | 14 Nov 17:08 2014
Picon

[Cucumber] Transpose Examples Table

Hi there,

what I want to accomblish is to use a transposed version of my currently used examples table which looks like this:

 | col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 | col10 | col11 | col12 | ...
 | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".."  | ".."  | ".."  | ...
 | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".."  | ".."  | ".."  | ...
 | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".." | ".."  | ".."  | ".."  | ...

So you can see, we've got much more columns than rows which makes it mendatory to scroll left and right to be able to read the values.
I'd like to put it that way:

 | col1  | ".."| ".."| ".." |
 | col2  | ".."| ".."| ".." |
 | col3  | ".."| ".."| ".." |
 | col4  | ".."| ".."| ".." |
 | col5  | ".."| ".."| ".." |
 | col6  | ".."| ".."| ".." |
 | col7  | ".."| ".."| ".." |
 | col8  | ".."| ".."| ".." |
 | col9  | ".."| ".."| ".." |
 | col10 | ".."| ".."| ".." |
 | col11 | ".."| ".."| ".." |
 | col12 | ".."| ".."| ".." |
    .
    .
    .

Is there any way to solve my problem.
I have to Mention that I'm using Java for the step definitions and for the tests:

Thanks in advance

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Srisowrabha Kumar | 12 Nov 18:07 2014
Picon

[Cucumber] Test data and Cucumber

Hi All,

Would like to know everybody's experience working on Cucumber and handling test data. I could find couple of ways through which we can pass data for our tests. One being hard coded(in feature file) and other using  data table where the values are passed again in the feature file. Having known this, in a case where there are hundreds of test cases to be automated, its a pain to visit feature file and modify data for each regression. Looking forward for everyone's approach to such a situation.

Also, if there are other ways to handle test data, please provide your idea with a sample example.

Thank you,
Sowrabha

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
David Karl | 10 Nov 23:01 2014
Picon

[Cucumber] Given clause matches Then clause; any way to differentiate?

I feel like this must be a common problem for people, but I haven't found much about it.
Here's a typical situation:

Scenario: Log in to home page
Given I am not logged in
When I log in with valid credentials
Then I am on the home page

Scenario: Sign out from home page
Given I am on the home page
When I log out
Then I am on the login screen

In the first one, I want to use "I am on the home page" as a test, and use some kind of assertion to make sure that what I expect to happen has happened. In the second one, I want to perform some steps to make sure that the user is on the login screen. But they have the same string, so the scenarios will both get skipped due to the ambiguity.

From what I can gather, the best approach seems to be to change the wording of the two clauses. However, I am not directly responsible for writing these feature files. Should I talk to the BA who writes them and ask her to make sure that her Givens/Whens and Thens all have unique wording? If so, can someone please use the example above to demonstrate a better way of wording these two clauses?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
gola077 | 10 Nov 08:18 2014
Picon

[Cucumber] Rubymine- where to define class, in the env.rb or create new folder under support/page/loginpage.rbI

I'm new the Capybara/Cucumber. I'm using Rubymine.

I want to define class and module and call this in my steps.rb file. Can I get some help please.

This is how my env.rb file looks like

require 'rubygems'
require 'capybara/cucumber'
require 'selenium-webdriver'
require 'capybara-screenshot/cucumber'
require 'capybara/dsl'

Capybara.run_server = false
Capybara.default_driver = :selenium
Capybara.default_selector = :css

module Helpers
  def without_resynchronize
    page.driver.options[:
resynchronize] = false
    yield
    page.driver.options[:resynchronize] = true
  end
end

World(Capybara::DSL, Helpers)

Capybara.save_and_open_page_path = "/Testscreenshottest"

# Keep only the screenshots generated from the last failing test suite
Capybara::Screenshot.prune_strategy = :keep_last_run

# Keep up to the number of screenshots specified in the hash
Capybara::Screenshot.prune_strategy = { keep: 2 }

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Shikander Raja | 6 Nov 13:55 2014
Picon

[Cucumber] have_content() taking more time to execute

Hi,

I have a cucumber step to verify the text in a page.

Ex:

Then(/^I should see text "([^"])*"$/ do |text|
 page.should have_content(text)
end

I observed that the above step  is taking more time. Any best approach to find the text in a page?

Thanks,
 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Marcel Overdijk | 5 Nov 12:43 2014
Picon

[Cucumber] [Java, Spring] How to enable transactions by default?

To enable transactions I have to put <at> txn on the features or on the scenario's
Is there a way to enable transactions by default?


M

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane