bdd

BDD, what's a feature?

痴心易碎 提交于 2019-12-10 03:03:56
问题 I'm just starting with BDD and I'm trying to build a small app, so I can see it working in a real environment, but I'm having trouble deciding what should be a feature. I'm building a tiny shop. I decided that "Compare products" will be a feature and "User can checkout as guest" will be one, but to get to that, I first need to list products. My question is, should "There should be a list of products" be a feature? Thanks! 回答1: It should probably be a feature, but try wording it from a user's

Can you define instance variables during Cucumber's Given, When, and Then step definitions

偶尔善良 提交于 2019-12-09 18:35:56
问题 I know with Cucumber, you can define instance variables during a Given step definition. This instance variable becomes part of the World scope. Then you can access this instance variable during step definitions of When and Then. Can you define instance variables also during When and Then step definitions and access them in the later When and Then step definitions? If it's possible, is it even a common practice to define instance variables during When and Then step definitions? Thank you. 回答1:

How do we handle minor permutations of BDD scenarios?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 17:58:56
问题 I'm loving the BDD approach to development, but I've bumped into a concern with how far to go. This comment from ThoughtWorks most recent Radar gives me pause: "The advent of behavior-driven design (BDD) testing frameworks like Cucumber, combined with browser automation tools like Selenium, has encouraged widespread use of acceptance testing at the browser level. This unfortunately encouraged doing the bulk of testing where the cost to run the tests is the greatest. Instead, we should test at

sql error cannot start a transaction within a transaction while testing with cucumber

[亡魂溺海] 提交于 2019-12-09 17:16:23
问题 I'm new to cucumber and I'm learning BDD When I'm trying to fill a form and create a record this sqlite error is shown, though there's no error when I tried the code manually in my browser. I'm using rails 4. here is my controller code class Admin::ItemsController < ApplicationController def index @items=Item.all end def new @item=Item.new end def create @item=Item.new items_params respond_to do |format| if @item.save format.html { redirect_to admin_items_path } else format.html { redirect_to

How do I test error conditions in HTML5 pages with cucumber?

こ雲淡風輕ζ 提交于 2019-12-09 08:08:56
问题 I am testing web application behavior with Cucumber (using Selenium and Watir under the hood). My web app has HTML5 pages and makes use of the new "required" attribute. If I have a data entry form with a required field, and I submit that form with the field blank, I would like to verify that the web app correctly responds with an error condition. Unfortunately, when testing using an HTML5 web browser, the error message that pops up on a failed field validation does not appear to be accessible

Debugging JBehave scenarios

╄→гoц情女王★ 提交于 2019-12-09 06:55:05
问题 I'm having trouble debugging my jbehave tests. I cannot get maven to start the jbehave tests and stop at a breakpoint. I have this in my pom: <pluginManagement> <plugins> <plugin> <groupId>org.jbehave</groupId> <artifactId>jbehave-maven-plugin</artifactId> <version>2.0.1</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.jbehave</groupId> <artifactId>jbehave-maven-plugin</artifactId> <executions> <execution> <id>run-scenarios-found</id> <phase>test</phase>

How to write User Stories for technical implementation details? [closed]

跟風遠走 提交于 2019-12-09 04:50:16
问题 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 2 years ago . I'm trying to work in a more organised way and started adopting user stories. I think I have misunderstanding of how should I use user stories for technical stuff. Let's say I'm coding an app that gives me the ranking of my site for a certain Keyword in Google. The user story

SpecFlow and complex objects

断了今生、忘了曾经 提交于 2019-12-09 04:07:02
问题 I'm evaluating SpecFlow and I'm a bit stuck. All samples I have found are basically with simple objects. Project I'm working on heavily relies on a complex object. A close sample could be this object: public class MyObject { public int Id { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } public IList<ChildObject> Children { get; set; } } public class ChildObject { public int Id { get; set; } public string Name { get; set; } public int Length { get;

Best ways to write BDD for long stories

a 夏天 提交于 2019-12-08 23:27:55
问题 We have recently started using BDD to write our requirements. It's been really helpful, it made the communication between analysts and developers a lot easier. (Combined with user interfaces, and old school requirements) Now we are thinking about writing our test cases with BDD. When I search online for the best practices I see a lot of different variations on how to write it. There are some examples like: Given > And(s) > When > And(s) > Then > And(s) Given > And(s) > When > Then > And(s)

Factory Girl: How to set up a has_many/through association

穿精又带淫゛_ 提交于 2019-12-08 23:19:53
问题 I've been struggling with setting up a has_many/through relationship using Factory Girl. I have the following models: class Job < ActiveRecord::Base has_many :job_details, :dependent => :destroy has_many :details, :through => :job_details end class Detail < ActiveRecord::Base has_many :job_details, :dependent => :destroy has_many :jobs, :through => :job_details end class JobDetail < ActiveRecord::Base attr_accessible :job_id, :detail_id belongs_to :job belongs_to :detail end My Factory: