James Poyser | 7 Feb 10:58 2016
Picon
Gravatar

[Cucumber] Rerunning failed scenario inside Around block

I'd like to find a way to re-run a failed scenario, before it's reported back (to our CI server in our case). If it fails twice, then it's reported as a failure.

This is to improve the reliability of browser automation tests. I'd like to set a global variable to slow down execution time on the second run. If it still fails, then it's a 'real' failure.

I was hoping this would work, but alas not - any ideas?

Around do |scenario, block|
  begin
    $slowdown = 0
    block.call
  rescue
    $slowdown = 1
    block.call
  end
end


--
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.
Styris | 6 Feb 00:44 2016
Picon

[Cucumber] help required...Cucumber JAVA framework

Hello everyone,


Looking to get some help from someone well-versed in using the JAVA Cucumber framework with some generic stuff...along with reports, parallel testing, and running tests in a certain way. I realize your time will be valuable so if we can hold a couple (or thereabouts) Skype/online sessions we can talk about some compensation to value for your time.
Please email me at appiumat-PkbjNfxxIATowKkBSvOlow@public.gmane.org Appreciate it!


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.
Ajay Sithagari | 5 Feb 23:06 2016
Picon

[Cucumber] Display Time inside the Html report

Hi,
When I run the the HTML report's  I can see the the DATE AND TIME on the  report (file name).
But I want to display the Date inside the HTML report( using with cucumber watir).



Thank You,
Ajay.

--
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.
aaron robertson | 5 Feb 20:47 2016
Picon

[Cucumber] Steps intended to fail

Hello,

I have a large step library written for a specific version of an application.
I want to be able to test that the steps are still functioning correctly in a new version of that application ( that they fail when they're supposed to ).
So I intentionally have tests that are written to fail, but this leaves my output full of failed tests.
Is there a way to specify that the next step of the scenario should fail, and if it does consider that successful?


--
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.
Piotr Klubinski | 5 Feb 11:03 2016
Picon

[Cucumber] [JVM][Spring] Cucumber Spring and class configuration

I'm struggling with Cucumber and Spring configuration. I'm writing selenium framework using Page Object Pattern, with BrowserFactory.

When I use <at> ComponentScan, <at> Component and <at> Autowire annotations everything works fine, but when I want to create a bit more complicated bean with <at> Bean annotation (BrowserFactory which registers few browser drivers) in <at> Configuration class it does not work, during debug I'm getting nulls on every single variable I'm trying to Autowire.

I'm using Spring 4.2.4, all cucumber dependencies in version 1.2.4.

Config:

<at> Configuration
public class AppConfig {

 
<at> Bean
 
<at> Scope("cucumber-glue")
 
public BrowserFactory browserFactory() {
 
BrowserFactory browserFactory = new BrowserFactory();
  browserFactory
.registerBrowser(new ChromeBrowser());
  browserFactory
.registerBrowser(new FirefoxBrowser());
 
return browserFactory; }    

 
<at> Bean(name = "loginPage")
 
<at> Scope("cucumber-glue")
 
public LoginPage loginPage() throws Exception {
 
return new LoginPage();
 
}  

 
<at> Bean(name = "login")
 
<at> Scope("cucumber-glue")
 
public Login login() {
 
return new Login(); }
 
}

POP:

public class LoginPage extends Page {

 
public LoginPage() throws Exception {
 
super();
 
}
 
...
}

Page:

public class Page {

 
<at> Autowired
 
private BrowserFactory browserFactory;

 
public Page() throws Exception{
 
...
 
}
}

Login:

public class Login {

 
<at> Autowired
 
private LoginPage loginPage;
 
 
public Login(){
 
}
 
...
}

Steps:

<at> ContextConfiguration(classes = {AppConfig.class})
public class LoginSteps {

 
<at> Autowired Login login;

 
public LoginSteps(){}

 
<at> Given("^an? (admin|user) logs in$")
 
public void adminLogsIn(Login.User user) throws Exception {
 
World.currentScenario().write("Logging in as " + user + "\n");
  login
.as(user);
 
}
}

Error:

cucumber.runtime.CucumberException: Error creating bean with name 'LoginSteps': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: Login LoginSteps.login; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'login': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private LoginPage Login.loginPage; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginPage' defined in AppConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [LoginPage]: Factory method 'loginPage' threw exception; nested exception is java.lang.NullPointerException

And now for the fun part... BrowserFactory in World class is properly Autowired!!

World:

public class World {

 
<at> Autowired
 
private BrowserFactory browserFactory;
 
...
}

--
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.
Piotr Klubinski | 5 Feb 09:02 2016
Picon

[Cucumber] Cucumber Spring and class configuration

I'm struggling with Cucumber and Spring configuration. I'm writing selenium framework using Page Object Pattern, with BrowserFactory.

When I use <at> ComponentScan, <at> Component and <at> Autowire annotations everything works fine, but when I want to create a bit more complicated bean with <at> Bean annotation (BrowserFactory which registers few browser drivers) in <at> Configuration class it does not work, during debug I'm getting nulls on every single variable I'm trying to Autowire.

I'm using Spring 4.2.4, all cucumber dependencies in version 1.2.4.

Config:

<at> Configuration public class AppConfig { <at> Bean <at> Scope("cucumber-glue") public BrowserFactory browserFactory() { BrowserFactory browserFactory = new BrowserFactory(); browserFactory.registerBrowser(new ChromeBrowser()); browserFactory.registerBrowser(new FirefoxBrowser()); return browserFactory; } <at> Bean(name = "loginPage") <at> Scope("cucumber-glue") public LoginPage loginPage() throws Exception { return new LoginPage(); } <at> Bean(name = "login") <at> Scope("cucumber-glue") public Login login() { return new Login(); } }

POP:

public class LoginPage extends Page { public LoginPage() throws Exception { super(); } ... }

Page:

public class Page { <at> Autowired private BrowserFactory browserFactory; public Page() throws Exception{ ... } }

Login:

public class Login { <at> Autowired private LoginPage loginPage; public Login(){} ... }

Steps:

<at> ContextConfiguration(classes = {AppConfig.class}) public class LoginSteps { <at> Autowired Login login; public LoginSteps(){ } <at> Given("^an? (admin|user) logs in$") public void adminLogsIn(Login.User user) throws Exception { World.currentScenario().write("Logging in as " + user + "\n"); login.as(user); } }

Error:

cucumber.runtime.CucumberException: Error creating bean with name 'LoginSteps': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: Login LoginSteps.login; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'login': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private LoginPage Login.loginPage; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginPage' defined in AppConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [LoginPage]: Factory method 'loginPage' threw exception; nested exception is java.lang.NullPointerException

And now for the fun part... BrowserFactory in World class is properly Autowired!!

World:

public class World { <at> Autowired private BrowserFactory browserFactory; ... }

--
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.
mihai bulhac | 5 Feb 00:31 2016
Picon
Gravatar

[Cucumber] [cucumber][jvm] how can I access Examples table from step definition?

Hi,

How can I access the data from Examples tabel (header & current execution row data) from a step definition without using parameters for that step?

Thanks,
Mihai

--
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.
Aniruddha chatterjee | 2 Feb 19:43 2016
Picon

[Cucumber] [cucumber][jvm] Asserting results from a asynchronous step

my cucumber scenario looks like this:-

Scenario: Test payment
 Given I login to terminal
 When payment token generated asynchronously
 Then user scans token
 And payment successful

So I want to asynchronously execute the step "payment token generated asynchronously" while at the same time proceeding with the next steps without blocking the execution of the scenario as a whole. I am doing this with the help of FutureTask. The step definition for the step "When payment token generated asynchronously" looks likes below:-

<at> When("^payment token generated asynchronously$")

public void generateToken() throws Throwable {


ExecutorService executor = Executors.newFixedThreadPool(2);

FutureTask<Object> futureTask1 = null;


futureTask1 = new FutureTask<Object>(new Callable<Object>() {


 public Object call() throws Exception {

                try {

                       generatePaymentToken();

 } catch (Throwable e) {

throw new Exception(e);

  }

return null;

    }

});


executor.execute(futureTask1);

// Shutdown the ExecutorService

executor.shutdown();

}

I do the futureTask1.get() at the After method of the scenario since I do not want to block the execution here and want the other downstream steps to execute at the same time this is executing
Now this works perfectly fine as long as there are no exceptions. But in case of exceptions the step does not fail and at best I can catch it in the After method and I am not able to fail the scenario.

Is there anyway I can make this work or any other alternate suggestions to it.


--
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.
Picon
Gravatar

[Cucumber] [announce] [i18n] [wip] steps2po: looking for code review

Hi!

I'm not completely new into this group. Unhappily I had to update my mail address. Have done some questions before.

Anyway, I'm writing to announce you a WIP code I've written to achieve a sort of i18n in regard to steps.
I say "a sort of" because it does not require by principle the source code being in English or any other language.
It was designed to work from any language to any language. So, there is no constrains about the language of the source text.

Basically it will generate .po files from _steps.rb and also deploy a filled .po file back into _steps.rb.

You can find cucumber-steps2po-file here: https://github.com/panchiniak/cucumber-steps2po-file

Barbor is incipiently using it here: en_arbor_field_steps.po

Thank you!

Rodrigo Panchiniak Fernandes

--
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.
Jeff Nyman | 31 Jan 09:22 2016
Picon
Gravatar

[Cucumber] [Ruby] Ordering of Required Libraries / Directories

For reasons specific to how they like things, a group I'm working with wants to have their Cucumber project directory setup be:

  project-repo
    pages
    specs
    steps
    support

The feature files go in `specs`, page objects go in `pages` and step definitions go in `steps`. Pretty much everything else, including `env.rb`, go in `support`. The problem is that their page definitions rely on certain libraries being required. And that's done in the support directory. The command they use to run Cucumber is (partially) this:

    -r support -r pages -r steps -r rspecs specs

They, as I, were hoping that this meant the directories would be required and thus loaded in that order. However, that appears to not be what happens. It looks like Cucumber alphabetizes the list and then loads in that alphabetized order.

Is there no way to get around this? If people are setting up their own directory structures, it's fairly likely that they may have a specific ordering they need and want to adhere to.

I know there are other ways I could get around this problem but I wanted to see if (1) this was intentional behavior and (2) there was any way to require directories in the order provided rather than simply alphabetical.

--
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.
Matt Payne | 28 Jan 21:17 2016

[Cucumber] Possible To Run 2 Profiles, One After The Other?

Hi,

So I have 2 profiles. Both execute the same features, but have slightly different contexts. I'd like to ensure that the same features work in both contexts, so I was thinking that I could run both profiles. At the same time, however, I'd like to not change the "public" interface to running the features - in other words, I'd like to still be able to run "cucumber features".

Hopefully that makes sense and someone has a suggestion!

Cheers,
Matt

--
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