Senaratne, Niranjala | 7 Jan 20:10 2015

Need JBehave Statistics

Hi, I would like to find our some statistics about JBehave. Whats its user base. ( Could be in terms of active downloads) . How many active user groups forums. Support for other tools. Can some one help me to get this information.

 

Thanks

  Niranjala

Venkatesh Laguduva | 7 Jan 08:50 2015
Picon

Running examples in parallel in JBehave BDD

Hi,
    I have a story file with 50+ examples listed below in the table and it takes really a lot of time; is there a way to run these examples in parallel? if not, what would be the best approach to reduce the execution time?

Thanks
Venkatesh Laguduva
Szabolcs Rugina | 19 Dec 14:28 2014
Picon

Re: Examples table and named parameter values with backslash character

Hi,

 

According to our discussion, I created the http://jira.codehaus.org/browse/JBEHAVE-1062 issue.

 

I hope the issue has all necessary information. I was confused a little bit about the affected and fix version, so please review that.

 

I am also looking forward for more contribution, but I am a beginner in contribution for open source projects, so will take some time to warm-up.

 

Regards,

rSzabi

 

From: Mauro Talevi [mailto:mauro.talevi-hQ+s5KbX5YmGglJvpFV4uA@public.gmane.org]
Sent: Wednesday, December 17, 2014 2:19 PM
To: user-b1QraVsTlj/IJWOP8RzEEmD2FQJk+8+b@public.gmane.org
Subject: Re: [jbehave-user] Excamples table and named parameter values with backslash character

 

Hi

I don't see any problem with the proposed solution. 

Can you please contribute it following:  http://jbehave.org/how-to-contribute.html

Cheers

On 17/12/2014 08:45, RUGINA Szabolcs-Gavril wrote:

Hi guys,

 

I have a situation where I need to use in an examples table values containing backslash characters.

Because somehow the backslash(es) are disappearing from the textual data what arrives to logic, I made a debug and checked the user mailing list.

 

Indeed first of all I need the backslashes for simulating newline character, as other user asked,

but I didn’t found any entry regarding the \ and $ characters as that would solve my problem.

 

During the debug I found, that the main cause is the String.replaceAll(regex, replacement) at ExamplesTable#replaceNamedParameters(Map<String, String> row)

used at line 339 at version 3.9.3 as:

 

replacedValue = replacedValue.replaceAll(namedKey, namedValue);

 

I don’t know, how widely is used the regex advanced functionality (grouping) when declaring named parameters and they values (with or without examples table),

but if is not,  changing the above line to

 

replacedValue = replacedValue.replaceAll(namedKey, java.util.regex.Matcher.quoteReplacement(namedValue));

 

would help some people.

 

Thanks in advance for your comments.

 

Best Regards,

 

Szabolcs Rugina

Java Developer

 

 



--
Rugina Szabolcs
ruginaszabolcs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Mobile: 0771483274
Fax: 0378105445






RUGINA Szabolcs-Gavril | 17 Dec 08:45 2014
Picon

Excamples table and named parameter values with backslash character

Hi guys,

 

I have a situation where I need to use in an examples table values containing backslash characters.

Because somehow the backslash(es) are disappearing from the textual data what arrives to logic, I made a debug and checked the user mailing list.

 

Indeed first of all I need the backslashes for simulating newline character, as other user asked,

but I didn’t found any entry regarding the \ and $ characters as that would solve my problem.

 

During the debug I found, that the main cause is the String.replaceAll(regex, replacement) at ExamplesTable#replaceNamedParameters(Map<String, String> row)

used at line 339 at version 3.9.3 as:

 

replacedValue = replacedValue.replaceAll(namedKey, namedValue);

 

I don’t know, how widely is used the regex advanced functionality (grouping) when declaring named parameters and they values (with or without examples table),

but if is not,  changing the above line to

 

replacedValue = replacedValue.replaceAll(namedKey, java.util.regex.Matcher.quoteReplacement(namedValue));

 

would help some people.

 

Thanks in advance for your comments.

 

Best Regards,

 

Szabolcs Rugina

Java Developer

 

Brent Barker | 12 Dec 19:48 2014
Picon

GivenStories in the middle of a scenario

Is it possible to run a GivenStories in the middle of a scenario?

My use case is, there are parts of the application that has steps that need to be performed to get to the correct area, but the test in that area is the same. Then, there are some steps afterwards that needs to be performed.


It would be easy to do it in two different scenarios, but the tricky part is that this needs to be performed for several different users, logging in via an examples table.

A thought is I could use composite steps to perform the required action, so I don't have to have a ton of duplicate copy/past steps in the various story files that need to perform this check. However, it is nice to see the actual steps taken in the story file.
Siaynoq | 19 Nov 04:29 2014
Picon

Changing candidateSteps while running a story

Dear JBehave Devs,

My question is simple (I hope): is it possible to change candidate steps (defined by useCandidateSteps() ) while a story is running? 

The reason is a bit more complicated: we have "cross-domain" testcases (e.g. doing something on a webpage then opening an iPhone app, going back to the webpage) - and the steps for these domains are separated by using different candidateSteps while starting up the framework.
Obviously while we switch to a different domain, we need those steps only...

An example scenario (not actual functionality):

Given I'm on the admin page for the customers
When I disable the login for User_A
And I switch to the iPhone app  //this would change the steplibrary?
And I log in                             //this step exists in both domains!
Then I get the error message: "Your login is disabled"

My guess is to do some magic in the Embedder, but maybe you know a more elegant solution.

As an additional info: we are using a specialised framework, so we can do "anything" - if this is possible at all.

I know it is not a good practice to mix different domain and business logic, but in a lot of cases this would give us more broad coverage while keeping the 

Regards,

Zoltan
Ireneusz Kordal | 17 Nov 23:05 2014
Picon

How to append additional lines to the report

Hi,

Is there a way to include in a report some additional lines of text 
passed from inside of step methods ? Most of our test are using some 
dynamic parameters generated by the application during runtime (unique 
case numbers, barcode numbers etc.), and I want to show these values in 
the report, so testers can easily see them directly on the report, and 
don't have to search through log files to find them (actually we are 
loging this information using log4j).
Some kind of functionality that they have in Thucidides: 
http://thucydides.info/docs/thucydides-one-page/thucydides.html#_using_step_methods_to_document_test_cases

For example:
Given A customer send us a request
When I scan a document on the scanner
And .........

 <at> Given("A customer send us a request")
public void a_customer_send_request(){
   String requestNumber = generateReuest();
   appendToReport("Request number is " + requestNumber );
   ...
}

 <at> When("I scan a document on the scanner")
public void i_scan_a_document(){
   String barcodeNumber = scanNewDocument();
   appendToReport("Barcode number is " + barcodeNumber );
  ...
}

And a final report might look like this:

Given A customer send us a request
    ==> Request number is 12345
When I scan a document on the scanner
    ==> Barcode number is 5554567

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Simon Kent | 10 Nov 18:30 2014

Version 3.9.5 Only displays last story duration in report view?

Hi


We were testing out an upgrade to JBehave 3.9.5 and noticed that our story reports only showed the duration of the last story run (we run all tests in one class).

On examination it looks like the write method in StoryManager always created a new durations file (see extract below). This is presumably the change for JBEHAVE-1041.

In previous versions (we were using 3.7.5) the report correctly showed the durations for all the stories.




  private void write(Properties p, String name) {
        File outputDirectory = configuration.storyReporterBuilder().outputDirectory();
        try {
            Writer output = new FileWriter(new File(outputDirectory, name));
            p.store(output, this.getClass().getName());
            output.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


Simon Kent
QA Manager
T: 01454 802431
E: skent-/VcaexCmnNCP2YhJcF5u+vpXobYPEAuW@public.gmane.org
Privileged or confidential information may be contained in this message. If you are not the addressee of this message please notify the sender by return and thereafter delete the message, and you may not use, copy, disclose or rely on the information contained in it. Internet e-mail may be susceptible to data corruption, interception and unauthorised amendment for which Gresham does not accept liability. Whilst we have taken reasonable precautions to ensure that this e-mail and any attachments have been swept for viruses, Gresham does not accept liability for any damage sustained as a result of viruses. Statements in this message that do not relate to the business of Gresham are neither given nor endorsed by the company or its directors. Gresham Computing plc Registered in England and Wales. Company No. 01072032 Registered Office: Aldermary House, 10-15 Queen Street, London, EC4N 1TX. Further information about Gresham Computing can be found on our website: www.gresham-computing.com
Brent Barker | 29 Oct 22:08 2014
Picon

Restarting Stories

Hi again,

Is there a way to restart a story if it has failed once before? I know there is a way to restart a scenario by throwing a RestartingScenarioFailure exception.

This would be useful for our selenium tests. There are countless things that can go wrong when running these browser tests. Since a false positive can cause people to quickly lose trust in the tests, others advised that this would be a good solution.

Thanks in advance!
-Brent
Zheng, Ayesha(AWF | 15 Oct 05:27 2014
Picon

Issue about GivenStories & Examples

Hi all,

 

I have a problem about GivenStories.

 

Assume A.story has 2 or more scenarios:

Scenario: A - 1

Meta: <at> id1 scenario1

Given actions with <Apara1>

When …

Examples:

|Apara1|

|value1|

 

Scenario: A-2

Meta: <at> id2 scenairo2

Given …

Examples: A2.table

 

 

 

B.story want to run only scenario A-1 for prepare with different data.

B.story:

Scenario: B - 1

GivenStories: A.story#{id1:scenario1}#{0} à Problem here.

Given actions with <Bpara1> and <Bpara2>

When …

Examples:

|Bpara1|Bpara2|Apara1|

|value1|value2|value3|

 

 

 

My problem is:

How can I use givenStories to match follow requirements:

1.       Run only Scenario A-1 in A.story.

2.       Pass data in Table Row 0 to givenStories A-1.

3.       Run Scenario B-1 with example data.

 

Thanks very much.

 

 

Best Regards,

Ayesha

 

kvitaliy | 9 Oct 12:15 2014
Picon

Examples and GivenStories

Hi All,

I have a problem with understanding of how to use GivenStories.

Assume, we have story file UserLogin.story with next text:

Scenario: user login
Meta:  <at> id1 userLogin

Given the user click on login button
When the user type '[login]'
AND the user type '[password]'
AND the user click on '[btn]'
Then something happens

Examples:
|login|password|btn|
|uloginrole1|upass|Login|
|uloginrole1|upass|Cancel|
|uloginrole2|upass|Login|
|uloginrole2|upass|Cancel|

Also, we have story in another file:

Scenario: scenario name

GivenStories: path/to/UserLogin.story

Given <<given conditions c1,c2,...,cK>>
When <<user actions with params p1,p2,...,pN>>
Then <<expectations e1,e2,...,eM>>
Examples:
|c1|c2|...|cK|p1|p2|...|pN|e1|e2|...|eM|
|c11|c21|...|cK1|p11|p21|...|pN1|e11|e21|...|eM1|
|c12|c22|...|cK2|p12|p22|...|pN2|e12|e22|...|eM2|
...............................................

So, two questions:
1. How can I run this scenario only for first row from given story 
(|uloginrole1|upass|Login|)?
2. Is it possible to run UserLogin as precondition only (i mean, i don't 
want to run it outside scenarios, which depends on it)?

Thanks.

Best regards,
Vitaliy

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane