Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Recording Mocks #96

Closed
betovelandia opened this issue Apr 22, 2019 · 4 comments
Closed

Recording Mocks #96

betovelandia opened this issue Apr 22, 2019 · 4 comments

Comments

@betovelandia
Copy link

We are currently using Dyson for multiple flows in the UI that require different responses on the same endpoints as well as a lot of manual work to create templates and tweak logic, as a way to minimize the amount of work for testers to create this templates we want to support automation for recording mocks, imagine starting a command that records everything that goes through the Dyson server and outputs the files and templates so that they can be reused.

  • is there already work/effort towards this?
  • would that be useful for Dyson?
  • ideas / opinions

Thanks!

@webpro
Copy link
Owner

webpro commented Apr 22, 2019

is there already work/effort towards this?

To be honest, dyson is not under very active development. I'm happy to look into any bug reports and/or PRs, but dyson usually fits my needs for simple and fast API mocking.

would that be useful for Dyson?

It would be a great feature to have for sure, but e.g. nock already has this. Happy to recommend it.

ideas / opinions

Feel free to hack away with dyson itself. If it's nice and clean we can pull it into this project. You can also fork it and make your own adaptation.

@betovelandia
Copy link
Author

I thought about Nock but it currently does not work in the browser, so I feel like maybe some sort of Middleware on Dyson might be a good solution for the ones who are using it to mock endpoints in automation.

@webpro
Copy link
Owner

webpro commented Apr 23, 2019

dyson also doesn't work "in the browser", but I see what you mean. Crazy thought: maybe you can use nock from that dyson middleware? Would maybe save some time and you get extra nock features with it.

On the other hand, might indeed not be too much of an effort to make the actual request when recording, and log the response (+ headers) to the console cq save to a file. And use that as a basis for the template cq as a cache for play back (not sure about requirements on your end).

@webpro
Copy link
Owner

webpro commented Oct 1, 2019

Closing due to inactivity

@webpro webpro closed this as completed Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants