-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index.json empty object, not being recorded #6
Comments
That's a good suggestion and I'll be updating this repo with an example app with the setup. From what you wrote, it sounds like the setup was down correctly. What does your tests look like? |
I tried it with window.spec.js from the cypress examples
I guess technically all the requests are non-xhr requests. Does auto record only work with xhr requests? Even if that's the case, my actual app has many xhr requests but is still writing nothing but an empty object to the index.json file Also what is the __filename supposed to be? Logged mine and it is set to /index.js. Is this expected? |
Yes, auto record only works for xhr requests because it uses Cypress' built in stubbing mechanism As for the |
There are definitely XHR requests being sent out, but still nothing being saved to the mock file unfortunately. |
Could you confirm if you are seeing them being logged when you run your test? How are you making those requests? |
On my actual app the requests are not being logged at all, even though there are XHR requests going out in the chrome network tab (you can filter by XHR, and even with the filter there are plenty of requests, none of them are logged). |
Tested again today with your updated version, mock file is still empty :'( |
I'm going to take some time to look into it this weekend! Will keep you updated. |
@Benyamin-Rafaeli Could you provide a bit more detail on the http you are making? |
Followed the steps to set up auto-record, but even with the cypress example tests, the index.json file remains empty. I see the task to read and write file, but all that gets written to index.json is:
{}
I included
const autoRecord = require('cypress-autorecord');
at the top of my test file, and autoRecord(__filename); just inside the context/describe function, and made sure the describe/context and it functions were NOT arrow functions.Then in index.js I added fs, autorecord and set
autoRecord(on, config, fs)
in module exports.Maybe it would help if you included a demo of changes to a cypress example file that would make it auto-record/stub in the readme?
The text was updated successfully, but these errors were encountered: