bdd

SpecFlow - Find all scenarios from method step and Find all unimplemented steps

有些话、适合烂在心里 提交于 2019-12-12 10:23:34
问题 New to SpecFlow. When specs project become larger, organizing files and refactoring Given/When/Then string become troublesome. How to find Scenarios in feature file from method step. Sometimes I have a steps shared in a few scenarios and features but from the C# step method view how to 'Find All References' in feature file? How to get all unimplemented scenario steps (font color purple) in all features files so that I can implement the steps. Currently when I Run All tests, no warn about

InitializationError while running Cucumber JUnit Tests

巧了我就是萌 提交于 2019-12-12 10:20:53
问题 package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( format={"pretty"}, features= "src/features/" ) public class cucumberRunner { } Using: cucumber-core-1.2.4 cucumber-java-1.2.4 cucumber-junit-1.2.4 junit-4.12 Eclipse Mars.1 java 8 Error Trace: java.lang.NoClassDefFoundError: org/dom4j/Element at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class

When should I test Views separately in Cucumber & RSpec workflow?

…衆ロ難τιáo~ 提交于 2019-12-12 08:42:18
问题 After some time of doing Cucumber & RSpec BDD, I realized that many of my Cucumber features are just higher level view tests. When I start writing my scenario and then go down to RSpec, I don't ever write view specs, since I could just copy and paste part of the scenario, which would be ugly dupliacation. Take this scenario for example Scenario: New user comes to the site Given I am not signed in When I go to the home page Then I should see "Sign up free" I know that this isn't directly

How to set up individual tracing / logging with SpecFlow

耗尽温柔 提交于 2019-12-12 08:17:42
问题 For my SpecFlow tests, I want to setup an individual logging / tracing of the test progress during the execution of tests. E.g. i want to write all passed / failed steps started / ended scenarios started / ended features to the windows event log (in order to synchronize it with event log messages generated by other system components during the test). I tried to use the [BeforeFeature], [BeforeScenario], [BeforeStep] Hooks for doing that, but it turned out that I do not have all the required

How to communicate between contexts in behat 3?

丶灬走出姿态 提交于 2019-12-12 08:10:38
问题 I can't use getMainContext() and getSubcontext($alias) in version 3 any more. What is the way to communicate between context in version 3. Are context traits the only way? # behat.yml default: suites: guest_features: paths: [ %paths.base%/features/web ] filters: { role: guest } contexts: [ GuestContext ] user_features: paths: [ %paths.base%/features/web ] filters: { role: member } contexts: [ MemberContext ] groupled_features: paths: [ %paths.base%/features/web ] filters: { role: grouplead}

What javascript mocking frameworks are people using? [closed]

a 夏天 提交于 2019-12-12 07:29:43
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I'm using Jasmine for testing client & server side javascript and need to do some mocking. Has anyone got any suggestions for a good javascript mocking framework? 回答1: I tried this once, but ended up refactoring instead so it wasn't needed. It doesn't have dependencies, so it

Gherkin tests for webservice calls

只愿长相守 提交于 2019-12-12 02:37:34
问题 We are using Specflow for automating our regression suite but now we would like to take it to a next level of automating our webservices. Using the Gherkin “Gven-When-Then”, how can I use / write the webservices calls. For e.g : How do I write my given - when - then for the below request? Request <soapenv:Header/> <soapenv:Body> <ns:GetConsolidatedBookingAccountHistory> <ns:request> <ns1:ServiceAuthenticationRequest> <ns1:Password>?</ns1:Password> <ns1:Station>?</ns1:Station> <ns1:UserName>?<

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

Cucumber features test fail but single cucumber test passes facebook and twitter test

杀马特。学长 韩版系。学妹 提交于 2019-12-12 01:36:06
问题 I've created test to simulate logging in facebook and twitter to register on my app. When I run the individual cucumber test, it passes. However, when I run the entire cucumber test, it fails at the facebook and twitter logging in. Note: the point where it fails is the 2nd time the facebook and twitter scenario is used to login. The 1st time the feature used passed. When running cucumber features. Unable to find field "email" (Capybara::ElementNotFound) ./features/step_definitions/microsites

Ambiguous match error in cucumber step definitions

扶醉桌前 提交于 2019-12-12 01:31:25
问题 In my cucumber step definitions I have the following Then /^I should see "(.*?)"$/ do |text| page.should have_content(text) end Then /^I should see "(.*?)" within "(.*?)"$/ do |text,css| within(css) do page.should have_content(text) end end This causes an "Ambiguous Match" error by cucumber when I run the features. I can work around this error by passing the --guess flag to cucumber. But I'm wondering why cucumber is finding ambiguity in the above two step definitions when both are clearly