bdd

Specflow - How to use combination of multiple tables in scenario

半城伤御伤魂 提交于 2019-12-08 05:59:31
问题 I am using Specflow to perform BDD tests. I am trying to test my navigation menu on multiple browsers. Particularly making sure that buttons are showing up accross browsers. I do not want to create a bunch of tests for each menu item specifically on each browser and I do not want to create a large table that goes over every browser/menu item combination. Is there any way to specify 2 tables and then create a single scenario that performs the combinations of both? For example: Menu Items Table

Preparing data for a SpecFlow scenario [closed]

别等时光非礼了梦想. 提交于 2019-12-08 04:26:12
问题 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 3 years ago . I'm going to test a complex scenario which expects several other steps to have performed prior to it. For example , it can be equivalent to have proper data in a warehouse before goods are taken our from it. So in order for fetching to happen, it must first be made sure that

BDD/TDD: can dependencies be a behavior?

左心房为你撑大大i 提交于 2019-12-08 02:20:41
问题 I've been told not to use implementation details. A dependency seems like an implementation detail. However I could phrase it also as a behavior. Example: A LinkList depends on a storage engine to store its links (eg LinkStorageInterface). The constructor needs to be passed an instance of an implemented LinkStorageInterface to do its job. I can't say 'shouldUseLinkStorage'. But maybe I can say 'shouldStoreLinksInStorage'. What is correct to 'test' in this case? Should I test that it stores

How to use jsdom.jQueryify with jasmine-node?

人盡茶涼 提交于 2019-12-07 22:58:34
问题 Is it possible to user jasmine-node with the jQueryify feature of jsdom? What I'm trying to do is use NodeJS to test some JavaScript that depends on the presence of the DOM. Here is a reduced case of what I tried. When I run the script, jasmine-node recognizes the spec, but doesn't run the expect() : var fs = require('fs'), jsdom = require('jsdom'), window = jsdom.createWindow(), jasmine = require('jasmine-node') describe("jQueryify", function() { it('should run the test!', function () {

BDD/DDD Where to put specifications for basic entity validation?

家住魔仙堡 提交于 2019-12-07 14:26:39
问题 Alternatively, is basic entity validation considered a specification(s)? In general, is it better to keep basic entity validation (name cannot be null or empty, date must be greater than xxx) in the actual entity, or outside of it in a specification? If in a specification, what would that look like? Would you have a spec for each field, or wrap it all up in one EntityIsValid type spec? 回答1: It seems to me that once people have learned a little about DDD, they pick up the Specification pattern

Behave: How to import steps from another file?

徘徊边缘 提交于 2019-12-07 12:23:26
问题 I have just started using behave, a Pythonic BDD framework using Gherkin syntax. behave takes a feature, e.g.: Scenario: Calling the metadata API Given A matching server When I call metadata Then metadata response is JSON And response status code is 200 And a steps file, e.g.: ... @then('response status code is {expected_status_code}') def step_impl(context, expected_status_code): assert_equals(context.response.status_code, int(expected_status_code)) @then('metadata response is JSON') def

Capybara::ElementNotFound, but it is there

烈酒焚心 提交于 2019-12-07 12:10:30
问题 I'm getting the following error: Capybara::ElementNotFound: Unable to find field "username" ./spec/controllers/sessions_controller_spec.rb:10:in `block (3 levels) in <top (required)>' spec: require 'spec_helper' describe SessionsController do before :each do @user = FactoryGirl.create(:user) end context 'creating a new session' do it 'can set the current_user variable to the logged user' do visit '/login' fill_in 'username', with: 'gabrielhilal' #I have tried `Username` as well fill_in

Is there any difference between a feature spec and a view spec?

允我心安 提交于 2019-12-07 10:47:11
问题 I had a question about within dryness in Capybara here. Tom answered perfectly and in his answer he mentioned: Feature tests should be for testing larger behaviours in the system. Is there a difference between a feature spec and a view spec in Ruby on Rails? If possible explain it with some example please. Thank you. 回答1: Yes, feature and view specs are quite different. The first is a full integration test and the second tests a view in isolation. A feature spec uses a headless browser to

Can I nest TestCases with Nose?

本秂侑毒 提交于 2019-12-07 10:06:47
问题 I've become a fan of nested test case contexts in things like RSpec and Jasmine, and I'm wondering if there are any Nose plugins that implement a test finder that allows you to nest classes as context. The resulting tests would look something like the following: from nose.tools import * from mysystem import system_state class TestMySystem (TestCase): def setUp(self): system_state.initialize() class WhenItIsSetTo1 (TestCase): def setUp(self): system_state.set_to(1) def test_system_should_be_1

Multiple Match bindings found on line with two different parameters

拥有回忆 提交于 2019-12-07 09:55:23
问题 I have written two lines(When's) in my same feature file When user $action1$ $key1$ with $value1$ for $atttributeType_Value$ in $Filename1_SectionId1$ Then abc When user $action2$ $key2$ with $value2$ in $Filename2_SectionId2$ Then def and corresponding step definition in step definition file as [When(@"user (.*) (.*) with (.*) for (.*) in (.*)")] public void abc() { //operation } [When(@"user (.*) (.*) with (.*) in (.*)")] public void def() { //operation } But, its showing up an error as