假設這位客戶customer:name是"Test User"、account為"100-1100",一開始帳戶會先存100元,要測試下面項目:
https://github.com/LeBronWilly/Cathay_SQA_Python/tree/main/tests/Problem%201
- Test Case1:之後存款 1000 元, 確認帳戶總金額為 1100 元
- Test Case2:下一步提款 500 元, 確認帳戶總金額為 600 元
- Test Case3:假設銀行年利率是10%, 經過一年之後確認帳戶餘額為660元
- Test Case4:之後提款 700 元, pytest 預期會接到 RuntimeError
https://github.com/LeBronWilly/Cathay_SQA_Python/tree/main/tests/Problem%202
- Test Case1:使用 Python 抓取 https://cathay-ds-test.s3-ap-northeast-1.amazonaws.com/user_info?userid=A123456789 ,並利用 assert 確認 http response status code 為 200
- Test Case2:使用 Python 抓取 https://cathay-ds-test.s3-ap-northeast-1.amazonaws.com/company_info?companyid=1 ,並利用 assert 確認 http response status code 為 403
https://github.com/LeBronWilly/Cathay_SQA_Python/tree/main/.github/workflows
請運用GitHub Actions或其他CI Services自動執行測試
cls
cd /d D:
cd D:\GitHub\Cathay_SQA_Python
pytest -W ignore::DeprecationWarning -v
https://github.com/LeBronWilly/Cathay_SQA_Python/tree/main/docs
- 題目的PPT檔(Take-home-exam.pptx)
- 結果截圖的Word檔(Solutions.docx)
- GitHub Actions執行完的Logs
- https://myapollo.com.tw/zh-tw/pytest/
- https://blog.cti.app/archives/20220
- https://zwindr.blogspot.com/2019/01/python-pytest.html
- https://www.796t.com/article.php?id=164187
- https://iter01.com/504335.html
- https://docs.pytest.org/en/latest/how-to/fixtures.html
- https://stackoverflow.com/questions/39395731/testing-class-methods-with-pytest/39395889
- https://kirin.idv.tw/python-decimal-module-tutorial/
- https://www.maxlist.xyz/2019/12/12/python-oop/
- https://www.learncodewithmike.com/2020/01/python-inheritance.html
- https://stackoverflow.com/questions/40710094/how-to-suppress-py-test-internal-deprecation-warnings
- https://github.com/LeBronWilly/Basic_Web_Crawler/blob/master/Web%20Scraper.ipynb
- https://stackoverflow.com/questions/55944961/python-403-access-denied-when-post-request
- https://ithelp.ithome.com.tw/articles/10191165
- https://www.learncodewithmike.com/2020/09/7-tips-to-avoid-getting-blocked-while-scraping.html
- https://stackoverflow.com/questions/60298449/github-action-with-pytest
- https://www.linkedin.com/pulse/test-automation-how-build-cicd-pipeline-using-pytest-nir-tal/
- https://kknews.cc/zh-tw/code/zr5km6a.html
- https://blog.dennisokeeffe.com/blog/2021-08-08-pytest-with-github-actions
- https://iter01.com/608520.html