Git Product home page Git Product logo

Comments (7)

marcelogo avatar marcelogo commented on August 29, 2024 1

@lettertwo

We released feature to use JSON Schema to match the request body against the specification. It should relax the comparison given that you won't need a body example on the request to ensure the equality.

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

@lettertwo this is something @marcelogo and I have discussed a lot during the course of Drakov's evolution, as well as with others who have used it.

Perhaps we need to look at properly documenting the goals of Drakov as a tool and where it fits in terms of testing and how to best use it - one of these goals being to maintain it's stateless nature.

In the context of reading and using the Blueprint API specs, we want to 100% respect those as well.

In terms of providing proper API test coverage, you should use a tool such as Dredd to exercise the Blueprint API contract against the real API. Dredd as an API tool provides other means to assert the response via JSON schemas, as well the better known static example response bodies.

Getting back to the usage of Drakov, our intention is that tests using Drakov as a backend should not test state, but simply behaviours in the interface.

We have had ideas and discussions with people who use Drakov about adding some sort of a "state" machine in a middleware that can isolate state to a specific test, but we haven't had the time yet to explore this.

We are always happy to hear the thoughts of Drakov's users, so feel free to give any feedback. I may even think about in the near future starting another project for a middleware module that can be implemented as a state machine of some sort.

Until we have better documentation @lettertwo I'll keep this as an open issue so this discussion can continue with anyone who has thoughts about this. πŸ‘

from drakov.

lettertwo avatar lettertwo commented on August 29, 2024

@yakovkhalinsky thanks for the quick, thoughtful response. I think I was a little unclear about my use case, so let me try to clarify. I don't want drakov to know about any state. I have an API consumer that makes POST requests. Currently, drakov rejects those requests unless the payload exactly matches what's in the API doc. This makes it impossible to use drakov when testing user-entered data. So for example, if the user enters a different name in a form than what is in the API spec, the request will fail. I'd like this validation to be relaxed.

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

OK, perhaps we could look at implementing JSON schema as a way of matching the request body.

Response body will still be the same though, would that still work in your usecase @lettertwo ?

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

Just an update. I've had a brief discussion with @marcelogo and we'll see if we can work this into next week's release.

from drakov.

lettertwo avatar lettertwo commented on August 29, 2024

@yakovkhalinsky @marcelogo πŸ‘ yeah, that sounds good to me–I want to be able to test that the request is formed correctly, so the only thing that matters from the response is that it succeeds or fails.

from drakov.

marcelogo avatar marcelogo commented on August 29, 2024

@lettertwo
Check it out and let us know how it goes.

from drakov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.