This project contains automation scripts for testing the Fanfix website using Selenium WebDriver with Python. The tests follow the Page Object Model (POM) design pattern and are organized using the pytest framework.
- Python 3.x
- Selenium WebDriver
- Firefox Browser and GeckoDriver
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Ensure GeckoDriver is in your PATH or in the project directory.
-
Run the tests using pytest:
pytest
Test cases are defined in Fanfix_Test_Cases.xlsx. The Excel file contains detailed descriptions, steps to execute, expected results, severity, and priority for each test case.
Test Case ID: TC_001 Description: Verify login functionality with valid credentials Steps to Execute:
- Navigate to the login page
- Enter valid email and password
- Click on login button Expected Result: User should be logged in and redirected to the home page Severity: Critical Priority: High
- Create a new Python file in the
testsdirectory or add a new function to the existingtest_fanfix.pyfile. - Follow the pytest conventions for writing test cases.
- Use the POM classes to interact with the web elements.
from pages.login_page import LoginPage
from pages.new_post_page import NewPostPage
from utils.driver_setup import get_driver
def test_create_new_post():
driver = get_driver()
login_page = LoginPage(driver)
new_post_page = NewPostPage(driver)
login_page.login('testqa@mailinator.com', '123456789')
new_post_page.create_post('This post is done by automation assignment', '/path/to/image.jpg', 5)
assert new_post_page.is_post_created('This post is done by automation assignment')
driver.quit()