PyZombis icon indicating copy to clipboard operation
PyZombis copied to clipboard

added e2e tests for CORS reddit api

Open abadoni5 opened this issue 1 year ago • 12 comments

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

Screenshot 2024-03-15 at 12 59 58 AM

abadoni5 avatar Mar 12 '24 20:03 abadoni5

@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.

abadoni5 avatar Mar 12 '24 20:03 abadoni5

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] avatar Mar 12 '24 21:03 github-actions[bot]

image @abadoni5 The test you wrote for this gives this error, due to which test run is failing

sujith-rek avatar Mar 14 '24 18:03 sujith-rek

once check and do necessary changes

sujith-rek avatar Mar 14 '24 18:03 sujith-rek

@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.

abadoni5 avatar Mar 14 '24 19:03 abadoni5

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] avatar Mar 14 '24 19:03 github-actions[bot]

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] avatar Mar 14 '24 20:03 github-actions[bot]

@abadoni5 Can you try with another "User-Agent". Try this instead: "Chrome/122.0.0.0"

NicolasSandoval avatar Mar 15 '24 00:03 NicolasSandoval

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] avatar Mar 15 '24 05:03 github-actions[bot]

@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.

abadoni5 avatar Mar 15 '24 05:03 abadoni5

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] avatar Mar 16 '24 18:03 github-actions[bot]

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] avatar Mar 16 '24 19:03 github-actions[bot]