jbehave

Jacoco Test coverage report shows 0%

大兔子大兔子 提交于 2019-12-20 03:24:36
问题 I have to get the code coverage of a application while business test are executed from a different code base. I use: Maven as my build Jbehave as my testing framework. The test are written in java. My application is a set of war files deployed on tomcat. The application code base is separate from test code base. In getting the coverage I followed the below steps. 1 Compile the test code using maven. 2 Copy application classes from the place it was build (${app.code.dir}/target/classes) to $

Selenium WebDriver to select combo-box item?

99封情书 提交于 2019-12-18 12:55:28
问题 We are using Selenium WebDriver and JBehave to run "integration" tests on our web-app. I have a method that will enter a value into a form input. @When("I enter $elementId value $value") public void enterElementText(final String elementId, final String value) { final WebElement webElement = webdriver.findElement(By.id(elementId)); webElement.clear(); webElement.sendKeys(value); } But when I try to use this to select an item in a drop-down list it (unsurprisingly) fails java.lang

Jbehave get Story name inside @BeforeStory

こ雲淡風輕ζ 提交于 2019-12-12 15:34:53
问题 I would like to get the Story name in a method annotated with @BeforeStory. I need this for debugging purposes, cause i'm running a bunch of stories with runStoriesAsPaths and with multiple threads, and I'm trying to log wich thread is running wich story. There is a way to do this? THanks in advance. 回答1: first you need to create a new StoryReporter (extend that class). In that class you can add actions to be performed before/after story/scenario/step, and you have the story name. example:

jbehave + thucydides: how to override 300s timeout

放肆的年华 提交于 2019-12-12 14:04:18
问题 I'm using thucydides jbehave plugin to run Selenium tests. However, I can't run tests longer than 5 min in total due to jbehave timeout. I can't figure out how can thucydides/jbehave should be configured to override this limitation. Selenium tests use to be longer that 5 mins, so that should be an actual problem for many people. 回答1: To override the timeout the user should add thucydides.properties file to the main folder of the project (if you use thucidides jbehave archetype, there is no

Filtering with multiple metafilters in JBehave

烈酒焚心 提交于 2019-12-12 09:19:40
问题 Situation: In my current project we are running all kinds of different JBehave stories. Every ".story" file is related to a product and a flow. Example: xyz-cellphone-call.story would be the story describing making a phonecall with a cellphone. xyz-phone-call.story would be the story describing making a phonecall with a fixed-line phone. xyz-cellphone-browse.story would be the story describing browsing the internet with a cellphone. My question: In Jbehave you can add metaFilters to filter on

writing a JBehave story

我是研究僧i 提交于 2019-12-12 02:29:38
问题 This question isn't about REST , but about using the returned value from an invocation made in @When in the subsequent @Then . I am looking at using JBehave to test some calls to a REST api. First there is a post to create the user When I create a user with name Charles Darwin As I understand REST, and this is what the Atom api does, the id is returned in the location header, e.g. /user/22 . So then I want to assert something about the response. Then user was created with a valid Id I can do

How do i execute story files in specific order in serenity BDD Jbehave

隐身守侯 提交于 2019-12-12 02:09:58
问题 I Have few jbehave story files in stories folder. whenever i execute the scripts it takes in alphabetical order. ex: current execution aaa.story bbb.story ccc.story i want the execution to be ccc.story bbb.story and skip aaa.story is there a way to run specific stories in specific order. in Serenity BDD + Jbehave 回答1: You can use Meta: to tag stories/scenarios. This is useful if you want to run just subset of stories/scenarios or skip some of them. Example: Meta: @sometag Scenario: some

JBehave results displayed on a webpage

断了今生、忘了曾经 提交于 2019-12-11 21:25:58
问题 I have been working on a project that lets me test the behaviours of my companies webpage. I have written an API and the testcase I am working on runs through JUnitRunner and the test passes. The next step is to get the results displayed on a webpage, oes anyone know what plugin I need to get the JBehave results in HTML format or as a file. I know I should be posting my code but there is no problems with the code, I just need the output in a different formatt. Thanks 回答1: To get the HTML

A Java config analog of XML configuration not working

北城余情 提交于 2019-12-11 15:27:50
问题 TL/DR: The problem boils down to creating a custom Spring scope, injecting a prototype -like scoped bean into a singleton with proxyMode = ScopedProxyMode.TARGET_CLASS but still getting a singleton in the Java config version of the configuration (whereas it works fine with XML). UPDATE: Problem solved, see answer. I'm using jBehave to write BDD test scenarios for our Spring application. We recently thought that we need independence in executing test scenarios (meaning that test context has to

Adding @RunWith for jbehave-junit-runner breaks JBehave build using Maven

对着背影说爱祢 提交于 2019-12-11 11:49:08
问题 I'm using JBehave with my Maven build which I also develop in Eclipse and sometimes run the my unit tests with the JUnit runner in Eclipse. I found jbehave-junit-runner works well for beautifying the JBehave stories in the JUnit runner. However, adding jbehave-junit-runner seems to have broken my Maven build. Result of mvn clean install after installing https://github.com/codecentric/jbehave-junit-runner: [INFO] ------------------------------------------------------------- [ERROR] COMPILATION