Fix the issues in this repo and make this program work. This repository is aimed at folks who have already learnt to write basic Python but are looking for more realistic challenges that involve reading a large enough codebase, exploring file structures and making changes to an existing codebase.
The code you are going to run is a Selenium test for the Weather Shopper application. The automated test itself completes the weather shopper exercise. Your job is to fix the problems in the automated test and make it run successfully.
- This codebase uses Python 3.10.0
- Fork this repository
- Clone your forked repository
- Create a virtualenv and activate it
pip install -r requirements.txt
- Install Chrome driver. If you don't know how to, please try:
- Run the test using the command
pytest -k e2e
The setup instructions are intentionally high-level since this repository is aimed at people with people who have already written Python before. If you are beginner, you will find our other repository a better place to start.
The weather shopper exercise has been partially completed using the code provided to you. Your assignment is to:
- fix the errors in the existing code
- complete the exercise on the payment page
- use the same design patterns and programming style when solving the exercises
- Run the test using the command
pytest -k e2e
- Observe, debug and fix the error
- Test your fix
- Commit your change and push
- Repeat steps 1-4 for the next error
If you fix all the bugs in this code, your test should perform like the gif below:
Remember, you should not stop at just fixing the existing code. You should also complete the instructions on the cart page too!
Here are some useful debugging tips that do not involve the use of debugger:
- Search for strings in all files
- Search for sub-strings in all files if the exact string does not exist
- F12 to follow the definition of a method in Visual Studio Code
- Add debug messages to figure out the flow
- if True: trick (to get exact error messages, in the test, replace
try:
withif True:
and comment out theexcept
portion) - Read the log messages backwards
- Sometimes the error happens in the line before the failure!
- Use Python 3.10.0
- We recommend using Visual Studio code as your IDE
- We recomment using a virtualenv
- You need to have Chrome driver installed
This repository is created and maintained by Qxf2 Services. Qxf2 provides software testing services for startups. If your team is working on an early stage product and needs QA, you can hire Qxf2 Services to help. Contact Arun at [email protected]