added e2e tests for CORS reddit api
Summary
closes #213, the original lessons used CORS, which failed the tests, since in pr #320 we are using new api (api.reddit.com) I have fixed it.
Checklist
- [x] Variables, functions and comments are translated to Spanish
- [x] Functions follow underscore notation
- [x] Spell check done & typos fixed
- [x] All python code is PEP8 compliant
- [x] Test coverage with Playwright implemented; locators are Pyhton code
- [x] Reviewers assigned (all peers & at least 1 mentor)
Screenshots
@reingart @NicolasSandoval, the previous attempt at adding e2e tests did not explicitly check for errors, I check the status code to check if the api is working properly handling this error earlier.
Published to http://pyar.github.io/PyZombis/330/index.html
@abadoni5 The test you wrote for this gives this error, due to which test run is failing
once check and do necessary changes
@NicolasSandoval, the CORS error now is fixed with required tests keeping in mind the suggestions by @sujith-rek. Due the way GitHub handles running the tests the api is returning a 403 error but the code is running fine locally and the test is working as expected.
The test is working as expected and only fails due to how github handles their testing workflow.
Published to http://pyar.github.io/PyZombis/330/index.html
Published to http://pyar.github.io/PyZombis/330/index.html
@abadoni5 Can you try with another "User-Agent". Try this instead: "Chrome/122.0.0.0"
Published to http://pyar.github.io/PyZombis/330/index.html
@NicolasSandoval added the new header, tests on github still fail. The test still works as expected locally. Let me know if you want any changes.
Published to http://pyar.github.io/PyZombis/330/index.html
Published to http://pyar.github.io/PyZombis/330/index.html