cypressautomocker icon indicating copy to clipboard operation
cypressautomocker copied to clipboard

AlertMedia AutoMock repo

Open JoenyBui opened this issue 4 years ago • 5 comments

Hi,

I'm working for AlertMedia and we are making some improvements on the automocker and such (https://github.com/alertmedia/cypress-auto-mock). We were wondering if you were open to having us merge our changes to your branch so we can help maintain it. Our changeset deviates quite a bit, so we'll likely need to refactor to get it working wit yours.

A couple of bugs fix and changes are:

  • Add responseHeaders to the code (so we can use HEAD request)
  • Added params for GET and HEAD request as a way to match keys
  • Add more verbose logging
  • We added functions at the global level so on our App can add stuff to the apiMockLists and such. (We integrate the ability t mock cy.request)
  • Fix some bugs
  • Update some tests

Let us know what your thoughts are. We are heavily invested in automock so we want to make sure that we can help maintain in any way possible.

Joeny

JoenyBui avatar Mar 31 '21 16:03 JoenyBui

Hi Joeny - I'm glad you're getting good use out of it. I'm not actively maintaining it right now. The last update I made was actually to https://github.com/scottschafer/cypressautomockerV2, which takes a different approach and doesn't require that the target application be modified. It seemed a lot better to me, but for whatever reason people seem to use the original.

If none of your changes are breaking, then I'm happy to merge them in and bump the version. Or I could add you or one of your engineers as a maintainer on the repo. Let me know.

Thanks, Scott

On Wed, Mar 31, 2021 at 9:57 AM Joeny Bui @.***> wrote:

Hi,

I'm working for AlertMedia and we are making some improvements on the automocker and such (https://github.com/alertmedia/cypress-auto-mock). We were wondering if you were open to having us merge our changes to your branch so we can help maintain it. Our changeset deviates quite a bit, so we'll likely need to refactor to get it working wit yours.

A couple of bugs fix and changes are:

  • Add responseHeaders to the code (so we can use HEAD request)
  • Add more verbose logging
  • We added the functions at the global level so on our App side we can add stuff to the apiMockLists and such.
  • Fix some bugs
  • Update some tests

Let us know what your thoughts are. We are heavily invested in automock so we want to make sure that we can help maintain in any way possible.

Joeny

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scottschafer/cypressautomocker/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHFC2NJXOL647VV2EZAXQ3TGNH7VANCNFSM42FCSS3Q .

scottschafer avatar Mar 31 '21 21:03 scottschafer

Scott,

Cool, let me talk with my team and see who we can sucker into volunteering. I just want to clarify, would you still be interested in maintaining this repo.

Also, I will take a look at cypressautomockerV2 and see if will work even better for us. I hadn't said this yet but really appreciate you putting this thing all together.

Joeny

JoenyBui avatar Apr 01 '21 17:04 JoenyBui

Looks like the big change is the xhook package.

JoenyBui avatar Apr 01 '21 17:04 JoenyBui

The main difference in V2 is that you don't have to modify the program being tested. Also, the API responses are stored in separate files (with either a TXT or a JSON extension depending on the response type) rather than in one big JSON file. Eventually we should be able to use cy.fixture() to load the recorded responses - which would be a really good thing. The challenge with that is that the same API call might return a different result (first time you GET /counter the result is 1, then next time it's 2 etc), and so we'd need to change the fixture for an API after it's called. When I last looked at Cypress, this wasn't possible. Maybe it is now.

I'd be happy to share maintaining this repo or turn it over to someone capable and willing. I'm not using this library or Cypress at the moment.

On Thu, Apr 1, 2021 at 10:18 AM Joeny Bui @.***> wrote:

Looks like the big change is the xhook package.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/scottschafer/cypressautomocker/issues/34#issuecomment-812052797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHFC2LTE7A2TUDM7MLK2G3TGSTFVANCNFSM42FCSS3Q .

scottschafer avatar Apr 01 '21 17:04 scottschafer

That's fascinating. I had similar ideas when I was deep-diving into the code about this but your information gives me a bit to ponder about. I guess for now you can put me as a maintainer. I was wondering if we can just put some of the v2 stuff in a different file in this repo so it won't break backward compatibility but have it readily available so people could transition over if it suits them.

JoenyBui avatar Apr 01 '21 18:04 JoenyBui