Welcome to the Chatbot Testing Repository! This repository contains tools and scripts to test chatbots written in Python. Below are instructions on how to test a simple terminal-based chatbot, a chatbot with a UI.
Macbook:
To get started, ensure you have Python 3 installed on your machine. You can check your Python version by running:
python3 --version
To test a simple chatbot that operates in the terminal, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/Tesena-smart-testing/chatbots.git
-
Run the test script using Python 3 from simmple/tests repository:
python3 test_chat_bot.py
This will execute the tests for the terminal-based chatbot.
To run the tests, ensure you are in the simple
directory and execute the following command:
PYTHONPATH=. python3 tests/test_chat_bot.py
This command sets the PYTHONPATH
to the current directory, allowing Python to locate the necessary modules and run the tests successfully.
To test a chatbot with a graphical user interface (UI), follow these steps:
-
Ensure you have Flask installed. If not, install it using pip:
pip install flask
-
Start the Flask app:
python3 app.py (MAC) python app.py (Windows)
-
Open your web browser and navigate to
http://localhost:5000
to interact with the chatbot UI.
To measure how much of your code is covered by the unit tests:
-
Install the Coverage Tool: If you haven’t installed it yet, run:
coverage run -m pytest
Run Tests with Coverage : Execute the tests and measure coverage with the following command from simple repo:
'coverage run -m pytest'
View the Coverage Report : After running the tests, generate a report with:
coverage report -m
Generate an HTML Coverage Report (Optional) : For a detailed line-by-line coverage report:
coverage html