6

Currently I have a small suite of integration tests running against my web-server which makes a request and asserts some assumptions on what the responses should be. These are written in Ruby generating http requests.

I've been looking at Gatling as a stress testing tool but I'm wondering if it could also be used for an integration tests as well. This way all the endpoint requests could be reused across the the stress tests and the integration tests.

I'm probably losing something here from not having the BDD of RSpec but gaining not having to create the same tests twice.

Does anyone have any experience of using gatling in this way?

Neil
  • 5,179
  • 8
  • 48
  • 87

1 Answers1

7

You can use the Assertion API and set up acceptance criteria.

However, Gatling isn't a browser and won't run/test your Javascript, so this approach is only realistic when dealing with server side content, such as testing REST APIs. Here's an example.

Stephane Landelle
  • 6,990
  • 2
  • 23
  • 29
  • 1
    This would be major overkill. Using a load testing tool as an integration test tool is like using a steak knife to cut warm butter. Load testing tools create massive concurrent load and track response time of those requests. You'd be ignoring 99% of what Gatling does and just using it as an HTTP requester. You may as well use `curl`. – Brandon Jul 22 '17 at 21:48