Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:06:41+00:00 2026-05-26T12:06:41+00:00

I use cucumber for lots of things. I really like it as a BDD

  • 0

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 that work with Cucumber (for example Capybara) seem to be designed around Rack-based applications. I’d like something similar to that but with no dependency on Rack.

What gems, if any, exist that have no rack dependencies. Or is there a way to use Capybara to test an API that’s on a remote server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:06:41+00:00Added an answer on May 26, 2026 at 12:06 pm

    I wouldn’t use Capybara to test a remote API because Capybara is made for testing applications is used for testing applications with a HTML UI (as Aslak points out in the comments).

    Instead, I would use Cucumber* in conjunction with something like HTTParty which would be the tool used to make the HTTP requests and parse them neatly. Here’s an idea:

    When /^I visit the API path '(.*?)'/ do |path|
      @result = HTTParty.get("http://theapi.com/#{path}")
    end
    
    Then /^I should see the following result:$/ do |result|
      @result.should == result
    end
    

    The final step here you would use like this:

    Then I should see the following result:
       """
         { success: true }
       """
    

    * I would actually use RSpec personally, I find the syntax less clumsy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to use my Cucumber/Capybara setup to test endless scroll by driving a
I'm using cucumber for BDD and I used @wip tag for a certain scenario
Is it possible to use Cucumber outside Rails? I'd like to start using it
I am using Cucumber, webrat and selenium to test a web application. I use
I use Cucumber to test my Rails app, and thanks to a running Spork
I'm learning to use cucumber, in order to test email parsing and am running
For integration tests of my Rails web app I use Steak (something like Cucumber).
i am just starting to use cucumber and like it so far however there
My Cucumber scenario is used to test authentication from a third party provider. What
I'm attempting to learn how to use Cucumber and creating steps using the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.