bdd

Cucumber can't find steps when running a single feature

我是研究僧i 提交于 2019-12-06 13:32:20
问题 I've just installed cucumber into a new rails project (first time setting it up from scratch) and it works wonderfully when running all tests ( bundle exec cucumber ) but can't find any of my steps when I run a single feature file. How might I start to debug this? rails (3.2.13) cucumber-rails (1.3.1) cucumber (>= 1.2.0) # file listing features/ ├── campaigns │ ├── donating_campaigns.feature │ └── viewing_campaigns.feature ├── step_definitions │ └── campaign_steps.rb └── support └── env.rb

BDD - should each scenario be self contained?

我怕爱的太早我们不能终老 提交于 2019-12-06 12:11:28
问题 I have a BDD feature containing multiple scenarios. Should each scenario be completely self contained and runnable individually? 回答1: Should be , yes. It is generally good practise in all forms of TDD (BDD included) to make sure that each "test" can run independently, and isn't coupled with or have a dependency on another test having been run first. This will help avoid creating a brittle test suite (i.e. one that is prone to breaking). That's not to say that you cannot chain readability

Application Testing with Rails

倾然丶 夕夏残阳落幕 提交于 2019-12-06 12:04:16
This is more of a general question and some sort of best practice discussion. How would one test a Rails application? There are mantras like BDD and TDD and frameworks like RSpec and Cucumber but how much is enough and what is the best way to go? Is it enough to use Cucumber as integration tests? Are you guys writing additional unit tests, too? So what and how is your Rails testing strategy? Looking forward to good opinions... How would one test a Rails application? Thoroughly, aiming for Eighty percent coverage and no less ! The actual decision as to "how" is easy, but "how much" can be a

Convert C# unit test names to English (testdox style)

青春壹個敷衍的年華 提交于 2019-12-06 08:23:59
问题 I have a whole bunch of unit tests written in MbUnit and I would like to generate plain English sentences from test names. The concept is introduced here: http://dannorth.net/introducing-bdd This is from the article: public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ... } renders something like this: CustomerLookup - finds customer by id - fails for duplicate customers - ... Unfortunately the tool quoted in the above

TDD和BDD

故事扮演 提交于 2019-12-06 07:58:52
摘自 https://www.cnblogs.com/Leo_wl/p/4780678.html 前言:   已经数月没有来园子了,写博客贵在坚持,一旦松懈了,断掉了,就很难再拾起来。但是每每看到自己博客里的博文的浏览量每天都在增加,都在无形当中给了我继续写博客的动力。最近这两天有听到Jbehave这个名词,上网查了一通,原来是和测试相关的,之前一直做开发,没有做过真正意义上的测试,对于测试的理解更是少之又少。通过这两天的查阅,现将自己的一些理解以及常见概念罗列出来。 正文:    Behavior Driven Development , 行为驱动开发 是一种 敏捷软件开发 的技术,它鼓励软件项目中的 开发者、QA和非技术人员或商业参与者 之间的协作。 在了解Behavior Driven Development之前,先介绍 Test-Driven Development(TDD) 即 测试驱动开发 ,它是一种 测试先于编写代码 的思想用于指导软件开发。测试驱动开发是敏捷开发中的一项核心实践和技术,也是一种设计方法论。TDD的原理是在开发功能代码之前,先编写单元测试用例代码,测试代码确定需要编写什么产品代码。 它的工作流程如下所示: TDD方法的一些特点: 有利于更加专注软件设计; 清晰地了解软件的需求; 很好的诠释了代码即文档。 我眼中的测试  

BDD and Behat special characters

血红的双手。 提交于 2019-12-06 06:33:31
问题 There is a similar question @ Gherkin in Behat and input validations scenarios However is not the same. My problem is that I need to had to scenario outlines examples or to arrays Given I have a problem with data | in | this | array | | how | can | I | | add | special | characters | Most of special characters are ok, but wat about quotes and pipes? special characters example: \|!"#$%&/()=?«»'{}[]'`^~*+ºª-_.:,;<>@ł€¶ŧ←↓→øþĸħŋđðßæ|«»¢“”nµ Thanks 回答1: I know that a year has passed since this was

How to test google analytics (garb) API with Rspec?

倖福魔咒の 提交于 2019-12-06 05:03:25
I'm using the garb gem to pull some basic stats, like pageviews, from Google Analytics. Everything's working correctly but I can't figure out the best way to test my API calls. Here's a paired down version of my Analytics class: class Analytics extend Garb::Model metrics :pageviews dimensions :page_path Username = 'username' Password = 'password' WebPropertyId = 'XX-XXXXXXX-X' # Start a session with google analytics. # Garb::Session.login(Username, Password) # Find the correct web property. # Property = Garb::Management::Profile.all.detect {|p| p.web_property_id == WebPropertyId} # Returns the

Is there a preferred BDD style unit-testing framework for Python?

房东的猫 提交于 2019-12-06 04:29:25
问题 I was wondering if there are any BDD-style 'describe-it' unit-testing frameworks for Python that are maintained and production ready. I have found describe, but it doesn't seem to be maintained and has no documentation. I've also found sure which reached 1.0, but it seems to just add syntactic sugar instead of writing assertions. What I'm really looking for is something similar to RSpec and Jasmine that enables me to setup test suites. The describe-it syntax that allows for testing multiple

White UIAutomation click() stops working on different platform

梦想的初衷 提交于 2019-12-06 03:49:59
问题 I'm using White to automate the BDD testing of our C# WPF UI. My first couple of tests are working well on my development machine (running Windows 7). However, when I try and run the same code on the build server (virtual machine running Windows server 2003 R2) it doesn't work correctly. In both cases the tests are run from the command line and the tests are using the Cuke4Nuke framework. In the case of the server I am accessing the server via Remote Desktop Connection. The code looks like:

When doing BDD, must I first TDD each piece of code needed to make an acceptance test pass?

泄露秘密 提交于 2019-12-06 02:15:04
问题 I've been given a kata to work on over the weekend. Before starting it I really just wanted to gather some thoughts. I'm not looking for the solution, just some ideas on the best approach/practice. From the conversation I had it would seem that I need to use a BDD --> ATDD (relate to scenarios in gherkin) --> TDD approach. I'm just looking to work out the best approach. My current thinking is to 1) Create a specflow project and distill the user story into a gherkin. 2) Create the associated