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

  • Home
  • SEARCH
  • 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 8540593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:38:03+00:00 2026-06-11T11:38:03+00:00

I’m trying to do an end-to-end smoke test for a one page app, and

  • 0

I’m trying to do an end-to-end smoke test for a one page app, and stuck with the following:

  • The app just runs as a bunch of HTML pages, and has no server side code (I’m running Apache locally to serve the pages).

  • The API calls are to /api/blah and I currently have an alias in my httpd.conf that redirects the /api/blah call to the proper server API (www.example.com/api/blah).

  • The API has an SSO requirement, so I want to avoid calling the actual API during functional testing.

I’ve got cucumber setup locally, with watir-webdriver handling the browser control. I’ve got a few tests running with the intial state, but would love to mock out the calls to the API with some dummy JSON I have stored with the project.

The tests will be eventually run on a TeamCity CI server.

I tried using WebMock and FakeWeb, but they’re looking for serverside calls – so the ajax calls from the app are never hitting something they can intercept.

I’ve also looked into maybe firing up the server with jsTestDriver, then mocking it out there, but can’t get the two to connect.

Are there any solutions for this out there, or has anyone had this problem and solved it reliably?

  • 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-06-11T11:38:04+00:00Added an answer on June 11, 2026 at 11:38 am

    There are several ways you could solve this.

    1. You could start a little HTTP server process serving your JSON fixtures alongside Cucumber and shut it down when the feature suite has finished loading. This could be written in Ruby/Node.js/whatever you like.

      You’ll probably want to make the API base URI configurable so that it interacts with this little test server when automated by Cucumber but calls the real thing in production.

    2. Stub XMLHttpRequest (given that’s what you’re using to make API calls) and return the fixtures from there.

    I would go for #1: make the base URI configurable instead of that forged "/api/blah" path and serve whatever you want in your specs through some basic HTTP server.

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm parsing an XML file, the creators of it stuck in a bunch social
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.