Diana Menezes | 6 Mar 00:34 2015
Picon

[Cucumber] Run complete test suite against 3 different scenarios

Our app has 4 different ways to login. I am looking to run our test suite against all the 4 different login scenarios. 
Eg: <at> login1 then run the test suite.
  <at> login 2 then run the test suite so on and so forth. 

Any idea on how I can achieve this?

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.
Rajeshwari Sudhakar | 6 Mar 11:47 2015
Picon

[Cucumber] Is there a way to number the feature or the scenario ?

Hi all,

Is there a way to serial  number the feature or the scenario ?

Thanks  
Rajee

--
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.
sai krishna | 5 Mar 10:55 2015
Picon

[Cucumber] How to fetch the final result summary

Hi All,

I would want to fetch the final results summary from commandline to create custom reports. Something like this 
361 scenarios (28 failed, 333 passed)
2368 steps (27 failed, 105 skipped, 2236 passed)

I want to read the total scenarios pass and fail

Regards,
Sai

--
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.
ziffification | 5 Mar 00:27 2015
Picon

[Cucumber] Noob thinking about features scenarios and ?helper code?

Hi all


I am reading along with the cucumber book , and maybe jumping ahead a bit out of excitement (watching out for cars when i do that:) )
My end goal is to tie in some code I have re-written from python to query a REST API interface on a networking device and validate all the routes return 
proper JSON

so I have a piece of non CUCUMBER ruby code testdev('172.168.101.139') that retuns a PASSED or FAILED string 


def testdev(ip)
   test = "PASSED"
   hash = gethash('https://' + ip +'/views/')
   hash["views"].each do |view|
     routeapi = 'https://' + ip + '/views/' + view
     #print routeapi + "---" 
     subhash =  gethash(routeapi)
     answer = is_json(subhash)  
     if answer == false 
      test = "FAILED"
     end
   end
   return test
end


how would I write a FEATURE and steps that would call on the above function?



here is my inexperienced first try at writing a feature please have a look and let me know what is incorrect:

Feature: Validate DUT JSON
    JSON should be evaluated for all routes in API
    All API routes should return valid JSON
    If JSON is invalid for one or more route in API it has DUT failed 

  Scenario: Validate JSON
    Given there is a DUT with <IP> 
    When I run test code
    Then it should return the word PASSED

  Examples:
    |IP             |
    |172.168.101.133|
    |172.168.101.134|
    |172.168.101.135|
    |172.168.101.136|



steps
Given /there is a DUT with <IP> / do |IP| testdev('172.168.101.139') 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.
ziffification | 4 Mar 21:35 2015
Picon

[Cucumber] NOOB asks : writing step definition in python?



I am looking at this page
https://cukes.info/step-definitions.html

it seems to indicate I can I can write step definitions in python is this the case?



--
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.
Celina | 4 Mar 21:14 2015
Picon

[Cucumber] JVM: in feature file, can the value of placeholder come from external file?

I only worked on hard-coded value for scenario outlines before. Now I need to test some data come from some config file, is it possible to get the external data source from feature file? Thanks a lot for clarification.

--
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 Patterson | 4 Mar 16:39 2015

[Cucumber] Async JS unfun

At work we're using the old DatabaseCleaner truncation strategy / PhantomJS one-two in order to test some of our more ajax-reliant features.

We're seeing a problem where one Scenario ends up loading a page with async JS that takes a while to kick in, and a while to run. The Scenario ends, and DatabaseCleaner begins to truncate the tables, but the previous Scenario's page is still running in PhantomJS and occasionally is still executing JS that hits the server and performs DB queries. When that happens we get Postgres deadlocks and failed builds.

The only solution is to ensure that Phantom is no longer executing any on-page JS once the Scenario finishes, before DatabaseCleaner starts. The obvious place would seem to be the Around hook where DatabaseCleaner is called. Then page.visit('/some/safe/page'), or perhaps something that calls Phantom's page.stop API method (it's documentation TODO, but sounds like it might do the trick).

The problem with that is that the World object (self in the Around block) is only available for the first Scenario in each Feature. For subsequent Scenarios it's nil, so there's no way to call page.visit, and even if you delegate that to a step, the step raises an error because the World has gone away for it too...

For the moment, we've resorted to adding a final Safe Mode step to every Scenario, which is nasty but works.

Are there any obvious ways to do this I'm missing? If not, how might this be approached? Preventing code execution leaking betweens scenarios seems kind of important...

Thanks,

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.
Barry Nauta | 3 Mar 14:31 2015
Picon

[Cucumber] [CukeSpace] Reporting shows zero tests while tests have been executed

Hi all,

Currently investigating a migration from JBehave to Cucumber with Arquillian support (CukeSpace).

When I run my tests, the output shows success, altering my feature file makes the test fail, so I know that the steps are actually executed. However, the test-results (result in the file 'feature-overview.html) show up empty. Probably a simple configuration, but I have been searching for a long time and cannot find an answer.

I hope that this is the right place for help.

Thanks in advance for your help
Barry



The output show that the test has succeeded:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running be.nauta.bdd.calculator.CalculatorFeature
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.63 sec
Mar 03, 2015 2:28:18 PM cucumber.runtime.arquillian.reporter.CucumberReporter doReport
INFO: Cucumber report available at C:\javadev\prj\bdd\calculator\target\cucumber-report\feature-overview.html

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 8.688 s
Finished at: 2015-03-03T14:28:18+01:00
Final Memory: 14M/197M
------------------------------------------------------------------------

But as I said, the report shows NO tests

Here are my files, I have kept them a limited as possible.

Calculator.java
package be.nauta.bdd.calculator;

import javax.ejb.Stateless;

/**
 *
 * <at> author Barry
 */
<at> Stateless
public class Calculator implements CalculatorService {
    
    <at> Override
    public int add(int x, int y) {
        return x+y;
    }
    
    <at> Override
    public int sub(int x, int y) {
        return x-y;
    }
}

CalculatorService.java
package be.nauta.bdd.calculator;

import javax.ejb.Local;

/**
 *
 * <at> author Barry
 */
<at> Local
public interface CalculatorService {
    int add (int x, int y);
    int sub (int x, int y);
}

CalculatorFeature.java
package be.nauta.bdd.calculator;

import cucumber.api.CucumberOptions;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import cucumber.api.junit.Cucumber;
import cucumber.runtime.arquillian.ArquillianCucumber;
import cucumber.runtime.arquillian.CukeSpace;
import cucumber.runtime.arquillian.api.Features;
import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.shrinkwrap.api.Archive;
import static org.jboss.shrinkwrap.api.ShrinkWrap.create;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.runner.RunWith;

/**
 *
 * <at> author Barry
 */
<at> RunWith(CukeSpace.class)
<at> CucumberOptions(features="features/calculator.feature") 
public class CalculatorFeature {
    
    <at> Inject
    private CalculatorService calculator;
    
    private int result;
    
    <at> Deployment
    public static Archive<?> createDeployment() {
        return create(WebArchive.class, "calculator.war")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addClass(CalculatorService.class)
            .addClass(Calculator.class);
    }

    <at> Given("^a calculator$")
    public void check() {
        assertNotNull(calculator);
    }
    
    <at> When("^I add (\\d+) and (\\d+)$")
    public void add(int x, int y) {
        result = calculator.add(x, y);
    }
    
    <at> When("^I subtract (\\d+) and (\\d+)$")
    public void subtract(int x, int y) {
        result = calculator.sub(x, y);
    }

    <at> Then("^the result should be (\\d+)$")
    public void validateResult(int expected) {
        assertEquals(result,expected);
    }
}

arquillian.xml
<?xml version="1.0" encoding="UTF-8" ?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://jboss.org/schema/arquillian"
            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

  <defaultProtocol type="Servlet 3.0"/>

  <engine>
    <property name="deploymentExportPath">target/deployments</property>
  </engine>

  <extension qualifier="cucumber">
    <property name="report">true</property>
    <property name="report-directory">target/cucumber-report</property>
    <property name="featureHome">src/test/resrouces/features</property>
    <property name="tempDir">target/custom/features</property>
  </extension>

  <container qualifier="jbas7-managed">
    <configuration>
      <property name="jbossHome">target/jboss-as-7.1.1.Final</property>
    </configuration>
  </container>

  <container qualifier="jbas7-remote"/>

</arquillian>

calculator.feature
Feature: Calculate

    Scenario Outline: Add two numbers

        Given a calculator
        When I add 5 and 6
        Then the result should be 11

    Scenario Outline: Subtract two numbers
    
        Given a calculator
        When I subtract 6 and 5
        Then the result should be 1

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>be.nauta.bdd</groupId>
    <artifactId>calculator</artifactId>
    <version>0.1-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <arquillian.container.version>7.2.0.Final</arquillian.container.version>
        <arquillian.version>1.1.5.Final</arquillian.version>
        <cukespace.version>1.6.0-SNAPSHOT</cukespace.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${arquillian.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    <dependencies>
        <dependency>
            <groupId>org.jboss.javaee</groupId>
            <artifactId>jboss-javaee</artifactId>
            <version>5.0.1.GA</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>com.github.cukespace</groupId>
            <artifactId>cukespace-core</artifactId>
            <version>${cukespace.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <!-- Profiles -->
    <profiles>
        <profile>
            <id>arquillian-jboss-remote</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.arquillian.protocol</groupId>
                    <artifactId>arquillian-protocol-servlet</artifactId>
                    <scope>test</scope>
                </dependency>
    
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-remote</artifactId>
                    <version>${arquillian.container.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>

beans.xml file is empty

--
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.
Julien Biezemans | 3 Mar 13:12 2015
Picon

[Cucumber] [ANN] BDD Kickstart San Francisco

The Cucumber team is coming to the West Coast!

Julien Biezemans, author of Cucumber.js and Pat Maddox, well-known experienced BDDer, will be running a BDD and Cucumber training course together in San Francisco 21-23 April 2015.

Use the following exclusive discount code before March 14 and get 20% off: cukesgroup

See kickstartacademy.io/dates/bdd-san-francisco-usa for more information and booking.

--
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.
sathya sathya | 3 Mar 11:53 2015
Picon

[Cucumber] How to write Cucumber future files via Eclipse

Hi,
 
I am new to Cucumber and want to write future files via Eclipse
 
Any pointers ?
 
Thanks,
Reddy

--
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.
Dan Woodward | 2 Mar 17:38 2015
Picon

[Cucumber] Capturing the HTML report for a failed build in Bamboo/Maven

We use Bamboo as our build system and are in the process of switching to Cucumber as our test automation tool of choice. I really like the HTML reports that we get out of cucumber; we're able to capture a lot more useful information in context for failures.  The problem is that Bamboo doesn't seem to want to capture the reports after a build failure (using maven to execute the tests). I used to use Jenkins/Hudson and I seem to remember it being a lot easier to capture the results of tests and artifacts after a failed build.

Does anyone have any experience capturing the result of a failed 'mvn clean test' in bamboo?

Thanks,

Dan

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