Welcome to our Pytest Automation Framework! This guide is designed for anyone, regardless of their technical background, to set up and run automated tests. We've made the process as simple as possible, guiding you step by step.
Before you start, you'll need the following:
- Python: If you haven't installed Python yet, head over to the Python official website and follow the instructions for your operating system.
- Docker: Docker allows us to run our applications in containers, making sure the environment is the same no matter where it runs. Download it from Docker's official website.
First, we need to install some Python libraries that our tests depend on:
- Open your terminal or command prompt.
- Navigate to the folder where you've saved our project.
- Run
pip install -r requirements.txtto install the necessary Python packages.
Docker Compose is a tool that allows us to define and run multi-container Docker applications. For our project:
- WordPress and a Database: We've set up a WordPress site with a connected database, ready for testing.
- Report Portal: This is where you'll see the results of the tests. It's already configured with projects, users, API keys, and everything else needed.
To prepare our test environment:
- In the same terminal window, make sure you're in the project folder.
- Type
docker-compose upand press Enter. This command sets up the WordPress site and Report Portal by starting the necessary containers.
Next, we need to populate Report Portal with user data:
- There's a script that does this automatically. Based on whether you're on Windows, macOS, or Linux, you'll run a specific command. (We'll ensure this command is clear in the final README.md)
Now, everything is ready for you to run the tests:
- In your terminal, staying in the project folder, type
pytest --reportportal. - Press Enter. The tests will execute, and the results will be sent to Report Portal.
After the tests are complete, you can view the results in Report Portal:
- URL: (You'll provide the specific URL here)
- Username: python.pytest
- Password: Pass1234!
That's all! You've successfully set up and run your tests. If you face any issues or have questions, we're here to help.