bdd

Zend Framework integration with Behat BDD

…衆ロ難τιáo~ 提交于 2019-12-02 17:39:19
Anyone has been using Behat with Zend Framework? Any examples on how to use both? curtisdf I got it working. It works with PHPUnit and Zend_Test so you can use all those nifty assertXYZ() methods. First, make sure you've got behat installed and available in your system $PATH . I did the following: sudo pear channel-discover pear.symfony.com sudo pear channel-discover pear.behat.org sudo pear install behat/behat Now, create a directory structure like so: features application ControllerTestCase.php bootstrap FeatureContext.php homepage.feature The features/application/ControllerTestCase.php

How to get parent node in Capybara?

落爺英雄遲暮 提交于 2019-12-02 17:22:19
I'm working with many jQuery plugins, that often create DOM elements without id or other identification properties, and the only way to get them in Capybara (for clicking for example) - is to get their neighbor (another child of its ancestor) first. But I didn't find anywhere, does Capybara support such things for example: find('#some_button').parent.fill_in "Name:", :with => name ? I really found jamuraa's answer helpful, but going for full xpath gave me a nightmare of a string in my case, so I happily made use of the ability to concatenate find's in Capybara, allowing me to mix css and xpath

Is BDD really applicable at the UI layer?

送分小仙女□ 提交于 2019-12-02 16:47:31
BDD is an "outside-in" methodology, which as I understand it, means you start with what you know. You write your stories and scenarios, and then implement the outermost domain objects, moving "inwards" and "deliberately" discovering collaborators as you go--down through service layers, domain layers, etc. For a collaborator that doesn't exist yet, you mock it (or "fake it") until you make it. (I'm stealing some of these terms straight from Dan North and Kent Beck). So, how does a UI fit into this? Borrowing from one of North's blog entries , he rewrites this: Given an unauthenticated user When

How to avoid anemic domain models, or when to move methods from the entities into services

心已入冬 提交于 2019-12-02 14:03:18
I have a common scenario that I am looking for some guidance from people more experienced with DDD and Domain Modeling in general. Say I start out building a blog engine, and the first requirement is that after an Article is posted, users can start posting Comments on it. This starts fine, and leads to the following design: public class Article { public int Id { get; set; } public void AddComment(Comment comment) { // Add Comment } } My MVC Controller is designed like this: public class ArticleController { private readonly IRepository _repository; public ArticleController(IRepository

How to use dynamic values for Karate Features

对着背影说爱祢 提交于 2019-12-02 14:01:23
问题 I've a need where I should use dynamic values in the features of my karate tests. I've came accross with some of the questions and answers like this: How to read input data from an excel spreadsheet and pass it JSON payload in karate framework? But no mather what how hard I try, I couln't make it happen. I believe I should share the code parts that I am trying to use, so that a discussion can start. I have a SOAP request for creating new users as below: <?xml version="1.0" encoding="utf-8"?>

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

人走茶凉 提交于 2019-12-02 13:53:55
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! 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 your Application Controller with rSpec Testing Controllers with rspec Using Rspec on Controllers RSpec in

TDD/BDD screencast/video resources [closed]

半腔热情 提交于 2019-12-02 13:46:14
I've recently finished watching the Autumn of Agile screencasts and I'm looking for more material of similar scope. Basically, I'm looking for screencasts that present TDD/BDD process while developing somewhat "real life" applications (or parts of them) - so no 20 minute intros please. I'm surprised not to find anything like that though. If you know of any resources that fit the requirement, please list them. Brett Schuchert from Object Mentor just posted a series of videos on TDD The videos are meant to be watched in order. GettingStarted Adding Basic Operators Removing Duplication Extracting

authlogic flash[:notice] does not show up in cucumber webrat step

折月煮酒 提交于 2019-12-02 10:22:49
I am running BDD steps with cucumber to implement my autlogic login behavior. Scenario: log in Given a registered user: "test@test.com" with password: "p@ssword" exists And I am on the homepage When I follow "Log in" And I fill in "Username" with "test@test.com" And I fill in "Password" with "p@ssword" And I open the page And I press "Login" And I open the page Then I should see "Login successful!" And I should see "Logout" this is my scenario and when I hit Then I should see "Login successful!" my cucumber step fails but only in webrat. I debugged with launchy and when the web-page appeard

How to use dynamic values for Karate Features

 ̄綄美尐妖づ 提交于 2019-12-02 07:53:13
I've a need where I should use dynamic values in the features of my karate tests. I've came accross with some of the questions and answers like this: How to read input data from an excel spreadsheet and pass it JSON payload in karate framework? But no mather what how hard I try, I couln't make it happen. I believe I should share the code parts that I am trying to use, so that a discussion can start. I have a SOAP request for creating new users as below: <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xxxxxx> <soapenv:Header/> <soapenv:Body> <int:createSubscriber soapenv:encodingStyle=

Can one Given When Then story drive > 1 JBhave Steps?

為{幸葍}努か 提交于 2019-12-02 06:52:23
问题 I've created a .story file with a Given When Then (GWT). Contact_List.story Scenario: Discover Contact Given I've a contact list of friends When one of them is online Then that friend is displayed in a list I'd like to have two levels of testing (a bunch of fast service layer tests, and a few UI tests). So I created the following using the exact same GWT language: ServiceSteps.java @Given("I've a contact list of friends") ... UISteps.java @Given("I've a contact list of friends") .... And