This project contains automated tests for a food order application. Tests are applied on Yemek Sepeti website."
Tests are only applied on restaurant pages and shopping cart. A basic database created to create test data and automation test interactions.
The tests are written using pytest
and selenium
, and involve retrieving data from a database to be used as expected outputs of the test cases.
This project aims to automate the testing of a food order application. The tests ensure that the website functionality works as expected, including menu displays, shopping cart operations, and user interactions.
Follow these steps to set up the project on your local machine:
-
Clone the repository:
git clone [https://github.com/username/food-order-app-tests.git](https://github.com/KubraIsik/Food-Order-App-Test-Project.git) cd Food-OrderAapp-Test-Project
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
Here's an overview of the project structure:
food-order-app-tests
│
├── README.md
├── .gitignore
├── db_utils.py
├── helpers.py
├── requirements.txt
├── data
│ ├── data.xlsx
│ ├── get_data.py
│ └── globalConstants.py
│── db_setup
│ ├── ERDdiagramofDB.pgerd.png
│ ├── sqlFileToCreateDBTables.sql
│ └── sqlQueriesToCopyDataFromCsvFiles.sql
│── pages
│ ├── orderCheckout_page.py
│ └── restaurant_page.py
│── tests
│ ├── test_cartOperations.py
│ └── test_restaurantMenu.py
└── .env
To quick overview of the database, here is the Entity Relationship Diagram of the db:
To retrieve data and work with this database:
- Ensure your PostgreSQL server is running.
- Create a new database called "food_order_db":
createdb food_order_db
- Run the SQL script to create the necessary tables:
psql -d food_order_db -f db_setup/sqlFileToCreateDBTables.sql
- (Optional) Read descriptions on the sql file and Run the data SQL script to insert initial data:
psql -d food_order_db -f db_setup/sqlQueriesToCopyDataFromCsvFiles.sql
To be able connect db while running pytest project:
Make sure to update the database connection settings in your .env
file
Included .env file to your project should include this lines with your information.
DB_USER = 'your_db_user_name' DB_PASSWORD = 'your_password'
or
the configuration file of your project accordingly
Change code lines inside db_utils.py
file with your information(db user name and password).
To run the tests, use the following commands:
- Ensure the database is set up and the web application is running.
- Execute the tests using pytest:
pytest
I would like to here from you: do not hesitate to reach out for any questions, comments or contributions to the project!
Kübra Nazlıhan IŞIK - kuisik@gmail.com
Project Link: https://github.com/KubraIsik/Food-Order-App-Test-Project.git