cucumber

How to use Cucumber to test non-Ruby, non-Rack API's

不羁的心 提交于 2020-01-13 19:00:28
问题 I use cucumber for lots of things. I really like it as a BDD environment. So I'd like to use it as an external tool to test an API. I'd like to do things like: Scenario: Hit api /info path and get info back When I visit the API path '/info' Then I should see the following text "Here's info on the API" or something similar. I mainly want to treat the API as a black box and test only inputs and outputs. I don't plan on inspecting anything inside the API. Most of the libraries I've looked at

Test Report Output using Cucumber - Selenium Ruby

无人久伴 提交于 2020-01-13 07:10:09
问题 I'm looking to have reports output from my Cucumber tests. So far I can put the following: cucumber features/feature_name.feature -f json -o C:/Reports This will only produce a json report at the end of the test and you can't see the results as they're happening as you normally would with cucumber. Can I get it to do both so that I will see the green/red steps within cmd and get the json report at the end? Thank you 回答1: You can add as many report formatters as you want. To include the

Test Report Output using Cucumber - Selenium Ruby

空扰寡人 提交于 2020-01-13 07:09:37
问题 I'm looking to have reports output from my Cucumber tests. So far I can put the following: cucumber features/feature_name.feature -f json -o C:/Reports This will only produce a json report at the end of the test and you can't see the results as they're happening as you normally would with cucumber. Can I get it to do both so that I will see the green/red steps within cmd and get the json report at the end? Thank you 回答1: You can add as many report formatters as you want. To include the

maven surefire verify java.lang.ClassNotFoundException

放肆的年华 提交于 2020-01-12 13:49:05
问题 I'm getting an odd error when I try to run verify lifecycle of maven for my java spring project. Note that it compiles fine using mvn spring-boot:run but when I run mvn clean verify it blows up with: $mvn clean verify -Dsurefire.skip=true -X ... Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.209 sec <<< FAILURE! - in com.fitforger.FitForgerBackendApplicationTests initializationError(com.fitforger.FitForgerBackendApplicationTests) Time elapsed: 0.005 sec <<< ERROR! java.lang

What are the differences between JBehave and Cucumber?

白昼怎懂夜的黑 提交于 2020-01-11 15:31:47
问题 I have read somewhere that JBehave is actually the Java equivalent of Cucumber, whereas Cucumber is based on Ruby. Can someone describe the differences between them provide links that do? 回答1: JBehave and Cucumber are completely different frameworks, although meant for the same purpose: acceptance tests. They are based around stories (JBehave) or features (Cucumber). A feature is a collection of stories, expressed from the point of view of a specific project stakeholder. In your tests, you

How to Configure Specflow 3.0.199 with NUnit 3.11?

蓝咒 提交于 2020-01-11 13:57:45
问题 I have done this a couple of times before, but it's not working today. Am I missing something? I want to configure Specflow from the scract, using NUnit and to execute inside Visual Studio. I've seen many tutorials but they are not working to me :P. I'm trying to use the latest versions. These are the steps I'm doing on Visual Studio 2017: Create a test project (.NET Framework) Install Specflow plugin for Visual Studio (Tools > Extensions and Updates) Delete reference of MSTests from the

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

拥有回忆 提交于 2020-01-11 13:28:07
问题 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

Execute only specific examples in a Scenario Outline

旧时模样 提交于 2020-01-11 06:36:05
问题 We're looking to better manage test data using Cucumber in our Java test automation framework. For a Scenario Outline , we're looking to tabulate test parameters categorized by the applicable environment in which they will run. For example, Scenario Outline: Login into application Given I am on the homepage in the <environment> When I enter my <user> And I enter my <pass> Then I am taken to the homepage Examples: |user |pass |environment| |test |test1 |local | |retest |retest1 |sit |

How to use common/shared “blocks” between cucumber features?

﹥>﹥吖頭↗ 提交于 2020-01-10 07:59:46
问题 I'm new to cucumber, but enjoying it. I'm currently writing some Frank tests, and would like to reuse blocks of cucumber script across multiple features - I'd like to do this a the cucumber level if possible (not inside the ruby). For example, I might have 4 scripts that all start by doing the same login steps: given my app has started then enter "guest" in "user-field" and enter "1234" in "password-field" and press "login" then I will see "welcome" then *** here's the work specific to each

cucumber test file download

风流意气都作罢 提交于 2020-01-09 10:17:46
问题 Anybody have idea how to test file download using cucumber? 回答1: This worked for me based when using send_data like so send_data(data, :filename => "inventory_#{Date.today.to_s}.csv", :disposition => 'attachment') Probably not best way to write the step, but it worked! Then /^I should receive a file(?: "([^"]*)")?/ do |file| result = page.response_headers['Content-Type'].should == "application/octet-stream" if result result = page.response_headers['Content-Disposition'].should =~ /#{file}/