bdd

want to test assertion of integer value should be >3 in Karate API

馋奶兔 提交于 2019-12-02 03:49:51
json response is "Value": 0.23 i want to put assertion here value should be less than 3 so how to do this ? tried some examples in documentation but they are for array format of jsonenter code here Scenario: Shows the minimum time any DB request to CS will take This value is an important indicator for the performance of the database access. Given path 'admin/rest/status/db/' When method get Then status 200 And match response contains { Value: ">3"} * match Value == { '#? _ > 3' } * match $.Value == '##[_ > 3]' * def H = response * print H tried with above assertion not found any solution You

How to order feature files in Cucumber test suite?

我的梦境 提交于 2019-12-01 20:59:06
Currently, I have found that cucumber test suite runs the feature files alphabetically. Please let me know if there is any option/configuration that I might be missing. Thanks. LudmilaN In cucumber 4.2.0 added cli option --order , see changelog and this example . Cucumber features/scenarios are run in Alphabetical order by feature file name. However, if you specifically specify features, they should be run in the order as declared. For example: @Cucumber.Options(features={"automatedTestingServices.feature", "smoketest.feature"}) You can force cucumber to run the feature files in the order that

How to transform Spec-flow table data into different values

北城以北 提交于 2019-12-01 20:44:31
I need to transform Spec-flow table data that we get via table.CreateInstance() or table.CreateSet() . I am using Spec flow for DB testing and in some cases, Table field values needs to be mapped to different values as DB tables are storing codes instead of the the values we have entered in tables of feature files. I do not want to include the codes in feature files as it reduces the readability. For example, If I have entered Single for status as mentioned below, I want it to be mapped or transform to S in the data transfer object / POCO. What is the best approach ? Thanks in advance. Given I

JBehave maintain data across steps Given/When/Then during a Scenario

瘦欲@ 提交于 2019-12-01 17:37:00
I have been trying JBehave for sometime and I need to figure out if there exists a way to maintain data across steps during the run of one particular scenario ? I mean is it possible to maintain the state/data during a scenario across the Given/When/Then with out using any state variable under the Step Class. Augusto Yes, you can pass an object that maintains the shared state to the different steps. The Noughts And Crosses example in jbehave core demonstrates this. There's some share state between stories that is maintained in the class WindowControl . See that the class NoughtsAndCrossesStory

How to test file download in Behat

泪湿孤枕 提交于 2019-12-01 17:30:35
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? Ian Bytchek Assuming you are using the Selenium driver you could "click" on the link and $this->getSession()->wait(30) until the download is finished and then check the Downloads folder for the file. That

Expect method call and proxy to original method with RSpec

雨燕双飞 提交于 2019-12-01 16:36:13
I want to discover with BDD missing :include params for ActiveRecord::Base.find method. So my idea is to have in spec something like this: ActiveRecord::Base.should_receive(:find).once.and_proxy_to_original_method parent = SomeClass.find 34 parent.child.should be_loaded parent.other_children.should be_loaded If #child or #other_children associations are not eager loaded, expectation should fail with something like: "Expected ActiveRecord::Base.find to be invoked once but it was invoked 2 more times with following args: 1. ...; 2. ..." Does anyone know if there's some matcher that works like

JBehave maintain data across steps Given/When/Then during a Scenario

余生长醉 提交于 2019-12-01 16:25:17
问题 I have been trying JBehave for sometime and I need to figure out if there exists a way to maintain data across steps during the run of one particular scenario ? I mean is it possible to maintain the state/data during a scenario across the Given/When/Then with out using any state variable under the Step Class. 回答1: Yes, you can pass an object that maintains the shared state to the different steps. The Noughts And Crosses example in jbehave core demonstrates this. There's some share state

Requiring external js file for mocha testing

人盡茶涼 提交于 2019-12-01 16:10:14
So I'm playing around with BDD and mocha with my express.js project. I'm just getting started so here is what I have as my first test case: should = require "should" require "../lib/models/skill.js" describe 'Skill', -> describe '#constructor()', -> it 'should return an instance of class skill', -> testSkill = new Skill "iOS", "4 years", 100 testSkill.constructor.name.should.equal 'Skill' (also this coffeescript generates some odd looking js since it inserts returns to last statement.. is this the correct way to setup a test with coffeescript?) Now when I run mocha I get this error: 1) Skill

Expect method call and proxy to original method with RSpec

人盡茶涼 提交于 2019-12-01 15:56:01
问题 I want to discover with BDD missing :include params for ActiveRecord::Base.find method. So my idea is to have in spec something like this: ActiveRecord::Base.should_receive(:find).once.and_proxy_to_original_method parent = SomeClass.find 34 parent.child.should be_loaded parent.other_children.should be_loaded If #child or #other_children associations are not eager loaded, expectation should fail with something like: "Expected ActiveRecord::Base.find to be invoked once but it was invoked 2 more

how to use capybara has_text

孤者浪人 提交于 2019-12-01 12:57:42
So now I've got cucumber/capybara/selenium hitting a google app script, which is great, but for some reason I can't seem to check for text in the body of the page in the way I expect. In the debugger I can grab the page object, which I can in the browser has the expected text. Scanning the html directly shows the text appearing twice, and yet page.has_text? appears false: (rdb:1) p page.html.scan(/Introduction Video/) ["Introduction Video", "Introduction Video"] (rdb:1) p page.has_text? 'Introduction Video' false an alternate scan gives more information on the text surrounding: (rdb:1) p page