bdd

Cuke4Nuke or SpecFlow?

拥有回忆 提交于 2019-12-29 11:48:11
问题 I am trying to decide if I should use Cuke4Nuke or SpecFlow. What are the pro/cons of each? Opinions on which is better and why. Thanks! 回答1: (I might be biased because I am involved with SpecFlow, but here my thoughts...) Cuke4Nuke is very close to Cucumber. This promises a lot of advantages: Compatibility Getting new features from Cucumber when Cucumber evolves (at least in theory, but language support is an example for this) Being a real part of the Cucumber community and the Cucumber

How do I verify jQuery AJAX events with Jasmine?

我只是一个虾纸丫 提交于 2019-12-27 10:57:53
问题 I am trying to use Jasmine to write some BDD specs for basic jQuery AJAX requests. I am currently using Jasmine in standalone mode (i.e. through SpecRunner.html ). I have configured SpecRunner to load jquery and other .js files. Any ideas why the following doesn't work? has_returned does not become true, even thought the "yuppi!" alert shows up fine. describe("A jQuery ajax request should be able to fetch...", function() { it("an XML file from the filesystem", function() { $.ajax_get_xml

How to setup Behat with Selenium Standalone Server and Firefox 49?

為{幸葍}努か 提交于 2019-12-25 12:43:29
问题 Can anyone explain in details how to setup and run Behat with Selenium Standalone Server 3.0.0-beta 4 and Firefox 49. Actually I have problem with setup behat.yml. I have try like it is explained How to run tests in behat on firefox 48.0 using selenium stand alone server? but no luck. 回答1: First of all, do you want to ride a grid or a basic Selenium server? The test will run in Windows, mac or ubuntu? Have you tried as I explain in the last comment of the second answer (in the link you found)

Testing loging in with Behat

孤人 提交于 2019-12-25 07:09:03
问题 So I have given such scenario and feature: Feature: User registration As an Unregistered User I want to be able to register to the system so that I can use it. Scenario: User successfully registers Given I am unregistered user When I register successfully into the system Then I should become a registered user And I should be logged on to the system I was thinking how to write the test. What do I assert. Lets talk about I should be logged in to the system. I had done testing with phpunit and

Specification Pattern vs Spec in BDD

耗尽温柔 提交于 2019-12-25 03:45:10
问题 I'm trying to explore Behavior Driven Design and Domain Driven Design. I'm getting that written specifications drive the tests in BDD, but also that business logic can be encapsulated using the specification pattern for re-use in domain objects and repositories, etc. Are these basically the same concept just used in different ways, used in conjunction together, or am I completely confusing the concepts? Please shed some light, if possible. 回答1: BDD or context specification is a style of

Naming Cucumber's Data Table

£可爱£侵袭症+ 提交于 2019-12-24 19:53:15
问题 I am creating test cases on forms that could contains over 50 parameters, some of them would show up when a certain set of questions would be answered specifically. The data tables were getting very long so I broke them into multiple data tables, each for a specific section of form. I don't want to add every heading in the step so I want to use the data table's name instead. Instead of: Scenario: . . . When I fill in <title> <first name> <surname> ... |title|first name|surname|...| . . . I

How does specflow handle multiple parameters?

五迷三道 提交于 2019-12-24 17:26:07
问题 As the title says how does specflow handle this x = AddUp(2, 3) x = AddUp(5, 7, 8, 2) x = AddUp(43, 545, 23, 656, 23, 64, 234, 44) The link I gave is how it is usually done. What i want to know is what should the annotation on the top be? [Then(@"What should I write here")] public static void AddUp(params int[] values) { int sum = 0; foreach (int value in values) { sum += value; } return sum; } 回答1: You add parameters by adding single quote marks like this: [When(@"I perform a simple search

TDD VS BDD: REST Service

ε祈祈猫儿з 提交于 2019-12-24 07:59:06
问题 I am all confused with TDD vs BDD :) How does TDD and BDD differ in each of below point? Development: Test case first, development follows next RestService(HTTP): Don't make rest calls? If so, a) do we return only hardcoded json using a mock object? b) how to handle REST call failures? We should have test case for that too? Especially for item 2, i have googled so many articles, but couldn't find a sample (code) approach on how to handle rest calls. 回答1: BDD and TDD are not comparable to each

Getting “required (…)+ loop did not match anything at input 'Scenario:'” error when using Background section in cucumber

醉酒当歌 提交于 2019-12-24 03:07:48
问题 I am writing a Karate DSL test to test a web service end point. I have defined my url base in karate-config.js file already. But when I try to use this in the Background section, I am getting the below error. Please help. Provided my feature file below. Error: "required (...)+ loop did not match anything at input 'Scenario:'" Feature: Test Data Management service endpoints that perform different operations with EPR Background: url dataManagementUrlBase Scenario: Validate that the contractor's

Having Multiple Step Files Opens Multiple Browsers

爱⌒轻易说出口 提交于 2019-12-23 22:27:51
问题 The Problem: If I have more than one Steps file, when I execute tests it seems that the WebDriver creation for each is being happening regardless of which test(s) I run. I was seeing a seemingly random Chrome Browser open up whenever I ran my tests. In an attempt to see if there was some sort of incompatibility between SpecFlow and ChromeDriver (a long shot, I know), I changed the WebDriver for my search tests to Firefox and left the WebDriver for my login tests as Chrome. No matter what test