bdd

Routing problem with cucumber

喜欢而已 提交于 2019-12-04 07:40:25
I am working with rails 3 and cucumber, all is going well except for this little problem Given I am on the "edit automobile" page No route matches {:controller=>"automobiles", :action=>"edit"} (ActionController::RoutingError) Now the path is set in paths.rb as edit_automobile_path and in the routes.rb I have automobiles as a resource, I scaffolded it so please tell me what I am missing, clearly the route is defined and matches, because I ran rake routes and saw the route. please point me in the right direction In your features/support/paths.rb file for a path like this that specifies a unique

When writing a BDD feature, should I put previous user interaction into a Given step, or a When step?

半世苍凉 提交于 2019-12-04 07:35:38
I am trying to write requirements for a multi-step business process (via a wizard). I have many scenarios where user interactions with one screen will change whether you are allowed to pick options on another screen. For example (I've obscured the actual business, but the process and form of the steps is nearly identical): Feature: Personal Diagnostic Search Filter In order to select a Technician who offers Personal Diagnostics, when I've asked for a Personal Diagnostic As a Business Customer I want to limit my search to Technicians who offer Personal Diagnostics Background: Given a Business

What is the Path to Learn BDD on Ruby On Rails?

余生颓废 提交于 2019-12-04 07:25:39
问题 I want to start BDD on Ruby On Rails what should I learn? I don't know anything about BDD, RSpec or Cucumber. What is the best way to learn? Tutorials? Something that cover things like 'What behavior I should test?' etc. thanks! 回答1: RSpec specific; I keep these links for reference (might be advance for beginners). But just wanna share it with you. (Some of it probably already outdated but I think still worth a read) Rspec Link Fest - links to other references RSpec in Controllers: Testing

BDD and TDD for node.js?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 07:25:36
问题 What is used for BDD and TDD with node.js? I'm used to use Cucumber + RSpec. What's a good combo for node.js? thanks 回答1: Update Mocha gets my vote now! You could have a look at the testing modules section from the node.js modules page. For example Vows is a pretty popular BDD framework. Vows is a behavior driven development framework for Node.js. 回答2: Check out mocha - (github) Also mocha-cakes, my attempt for Cucumber syntax on mocha. 回答3: If you are used to rspec, Jasmine is pretty nice. I

Multi-language integration testing framework

孤者浪人 提交于 2019-12-04 05:58:16
Imagine that you have a fairly complex service-oriented architecture made by different components. Components are written in different languages (Java, PHP, Ruby) and communicate with each other in different ways (i.e. UI, REST API, in some cases sharing some DB tables, etc). I am trying to design an integration testing framework for some end-to-end testing. We already have unit/integration tests for the single components, but we would like to build something that fully tests our deployed system (in a real environment) end-to-end to make sure the functionalities (in terms of expected

How do we handle minor permutations of BDD scenarios?

拟墨画扇 提交于 2019-12-04 05:28:13
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 the appropriate level, as close to the code as possible, so that tests can be run with maximum

Cucumber: Automatic step file creation?

左心房为你撑大大i 提交于 2019-12-04 03:42:01
问题 When i run cucumber it displays the possible steps that i should define, an example from the RSpec book: 1 scenario (1 undefined) 4 steps (4 undefined) 0m0.001s You can implement step definitions for undefined steps with these snippets: Given /^I am not yet playing$/ do pending end When /^I start a new game$/ do pending end Then /^the game should say “Welcome to CodeBreaker”$/ do pending end Then /^the game should say “Enter guess:”$/ do pending end Is there a way that it will automaticly

How to test file download in Behat

帅比萌擦擦* 提交于 2019-12-04 03:24:43
问题 There is this new Export functionality developed on this application and I'm trying to test it using Behat/Mink. The issue here is when I click on the export link, the data on the page gets exported in to a CSV and gets saved under /Downloads but I don't see any response code or anything on the page. Is there a way I can export the CSV and navigate to the /Downloads folder to verify the file? 回答1: Assuming you are using the Selenium driver you could "click" on the link and $this->getSession()

Step definitions in external files in Behat

五迷三道 提交于 2019-12-04 03:21:06
Behat by default looks for the step definitions in file named FeatureContext (all steps in one file). Having a lot of steps, it's hard to maintain such a big file. I'd like to have one definition file per feature file. How can I have step definitions in external files? e.g. homepage.feature HomepageContext extends FeatureContext Use class inheritance and separate contexts. # /features/contexts/ AbstractContext extends BehatContext {} FeaturenameContext extends AbstractContext {} Then in /feature/FeatureContext.php import the context files: /** * Initializes context. * Every scenario gets it's

How to use bdd naming style with Resharper 4.5?

前提是你 提交于 2019-12-04 01:35:14
I just upgraded to Resharper 4.5 and now see that all my BDDish test methods are marked as not conforming to the naming standard. My naming convention is like this: public void Something_ShouldHaveThisResult() Resharper doesn't like the underscore in the method. Is there a way to turn this off, just for test methods? I have a normal naming convention for the rest of my code. On the menu: Resharper | Options -> Languages -> Common -> Naming Style: remove what ever naming style you want. They should have a "disable" feature, but they don't. How to change the ReSharper naming style for test