bdd

JSpec no longer supported?

陌路散爱 提交于 2019-12-14 01:20:09
问题 Coming from the Ruby community I'm looking for a BDD-testing framework for Javascript/Node.js. I was JSpec and thought it would be the right choice because I used RSpec in Ruby. But on their GitHub page http://github.com/visionmedia/jspec it says it's no longer supported. They are abandoning this project? Does this mean I shouldn't use it since it's not being maintained anylonger? 回答1: I'd recommend you take a look at either: Jasmine and Jasmine-species or Vows.js and Kyuri Alternatively

Using Background title as Background in cucumber

♀尐吖头ヾ 提交于 2019-12-13 20:29:36
问题 Let's say I use Background feature which has the below steps: Background: My pre-requisites Given Step one When Step Two Then Step Three .... Then Step Fifteen So basically my Background has 15 common steps that is required for a set of scenario to run. My question is : Is it possible to use the Background title My pre-requisites in other feature files, instead of writing down all the 15 steps as Background? Or is there any other way to handle this more gracefully. 回答1: You can create a

Is there a way to set variables in a scenario and use them in another scenario in karate framework?

∥☆過路亽.° 提交于 2019-12-13 18:09:42
问题 I get a value in the response by running one of the scenarios and I would like to use that value in the next scenario. Is there a way to set variables in the context of a feature with karate? I know I can call another feature from within the feaure, but I don't want to move that scenario in another feature and do the call. 回答1: Please note that having scenarios depend on another is considered a bad practice, and I don't recommend it: https://github.com/intuit/karate#script-structure But

Maven + Cucumber-jvm - How to run different subset of the features depending on environment

偶尔善良 提交于 2019-12-13 12:29:00
问题 I am strugging to achieve this: I want to configure a maven project so that it runs different subsets of the cucumber features depending on the selected profile (dev | pro) For instance, I have a couple of feature files to test web navigation, using tags to specify the environment: PRO @pro Feature: Nav Pro Scenario: navigate to home Given access / Then it should be at the home page DEV @dev Feature: Nav Dev Scenario: navigate to login and log user correctly Given access /login When the user

How to use a supported language by gherkin in Specflow?

时光总嘲笑我的痴心妄想 提交于 2019-12-13 07:09:04
问题 I want to use persian language for authoring BDD scenarios using Specflow in Visual Studio 2013. I added following config to specflow config section: <language feature="fa-IR" tool="en" /> But when Specflow tries to generate test out of the scenarios, it emits following error: #error The specified feature file language ('fa-IR') is not supported. 来源: https://stackoverflow.com/questions/37942289/how-to-use-a-supported-language-by-gherkin-in-specflow

How to prepare json file from feature file?

若如初见. 提交于 2019-12-13 03:23:13
问题 Is there any way to prepare json file from .feature file in BDD? I am trying to create json file where input source of data is .feature file Feature: Testing a REST API Scenario: Create student account using post method Given api is up and running for post method When i create json with below valuesand hit rest api | Student_id |Name | CityName | State |PostCode |Tel | | 0101 |Andrew | Leeds | | SO143FT | 345345345345 | | 0102 |Smith | NewCastle | | SO143LN | 345345345345 | Then Status is 201

How to execute same cucumber feature or scenario n times?

天大地大妈咪最大 提交于 2019-12-13 01:28:57
问题 I need to execute one scenario which is part of one feature 100 times. There is no scenario outline as there is no data parameterization. I just need to perform gorilla testing on this particular scenario so as to make sure it passes every single time without any fail. Some of my team members observed failure a couple of times, so need to validate the stability. Runner class code: public class Baserunner extends AbstractTestNGCucumberTests{ private TestNGCucumberRunner testNGCucumberRunner;

How to Structure CRUD Tests using BDD

折月煮酒 提交于 2019-12-12 14:15:55
问题 I'm stuck at a bit of a quandary trying to figure out the best way of structuring my CRUD tests. Within my application users have the ability to create several types of 'tasks'. My currently implementation looks something like the following: Scenario: Create Task-Type A Given I am on a user's profile page And Have access to create tasks When I create a new task with a unique title and description Then The confirmation prompt should display Scenario: Read the Task-Type A Given A new task was

RSpec vs. Cookies - The test fails even if the applications works (simulating logged user)

我们两清 提交于 2019-12-12 12:26:01
问题 I'm reading the Michael Hartl's "Ruby on Rails "Turorial" but I'm stuck here. I wrote the tests to check user authorization on user edit/update, I've also wrote the controller code and it works : If user is not logged and try to access users#edit or users#update it's redirected to the login page If the user is logged and he try to edit another user is redirected to the root The problem is in the spec that tests the point 2, I check that sending a PUT request to the user_path I'm redirected to

How do I enforce test isolation in MSpec when static members/methods are required?

回眸只為那壹抹淺笑 提交于 2019-12-12 12:10:25
问题 Ok. I'm trying to wrap my head around why MSpec uses static methods / variables. (Well not exactly static methods, but with member variable delegates, it's practically the same). This makes it impossible to reuse contexts. That or go through and make sure all static variables are reset manually. This has no enforcement on test isolation. If one test sets up some variables and the next one checks for it, it'd pass when it shouldn't. This is starting to get very annoying. What I do in one