This project is a web automation framework using Selenium and Python, integrated with GitHub Actions for Continuous Integration and Continuous Deployment (CI/CD). The framework is designed for automating web application testing, with the tests executed automatically on each code push to the repository.
- Web Automation: Use Selenium and Python to automate web application testing.
- CI/CD Integration: Automatically run tests with GitHub Actions on each push to the repository.
- Test Reporting: Generate test reports in HTML format, making it easy to view test results.
- Easy Setup: Minimal configuration required to get started.
Follow the steps below to set up and run the automation framework locally and on GitHub.
- Python 3.8+ installed on your local machine.
- Google Chrome and ChromeDriver (or any browser and corresponding driver of your choice).
- GitHub Account for pushing code and utilizing GitHub Actions CI/CD.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/web_automation.git cd web_automation
-
Install the required dependencies:
pip install -r requirements.txt
You can run the tests locally by using the following command:
pytest --maxfail=1 --disable-warnings -q --html=report.html
This will execute the tests and generate a report.html
file that contains the test results.
This project is configured with GitHub Actions to automatically run the tests on each push to the main
branch. The CI/CD workflow is defined in .github/workflows/ci-cd.yml
.
When you push to the main
branch, GitHub Actions will:
- Set up the Python environment.
- Install dependencies listed in
requirements.txt
. - Run the tests using
pytest
. - Upload the test results as an HTML report.
Check the Actions tab in your GitHub repository to view the workflow results.
Test results will be available in the Actions tab of the repository under the latest run. You can download the pytest-report
artifact which contains the report.html
for detailed test results.
We welcome contributions to this project! Here’s how you can help:
-
Fork this repository to your GitHub account.
-
Clone your fork to your local machine:
git clone https://github.com/your-username/web_automation.git
-
Create a new branch for your changes:
git checkout -b feature-branch
-
Make your changes and commit them:
git commit -m "Describe your changes"
-
Push your changes to your fork:
git push origin feature-branch
-
Open a pull request from your feature branch to the
main
branch of the original repository.
Please adhere to the following guidelines when contributing:
- Follow PEP 8 standards for Python code.
- Write clear and concise commit messages.
- Include comments and documentation where necessary.
This project is licensed under the MIT License - see the LICENSE file for details.
- Selenium and Python for providing the tools to automate web testing.
- GitHub Actions for enabling automated CI/CD workflows.
- Thanks to all contributors for helping improve this project.
### Explanation:
- **Introduction:** The first section explains the purpose of the project and lists key features.
- **Getting Started:** This section gives the setup instructions, such as prerequisites, cloning the repo, and installing dependencies.
- **Running Tests Locally:** Instructions for running the tests locally.
- **CI/CD Integration:** A section explaining how the GitHub Actions workflow is set up and how it automates testing on every push.
- **Contributing:** Provides a guide on how to contribute to the project, including forking, creating branches, committing changes, and submitting pull requests.
- **License:** The project uses the MIT License, so contributors can freely use and distribute it. A link to the full license text is included (assuming it’s in a separate `LICENSE` file).