Project / testcases /test_add_person.py
RajaThor's picture
Rename test_add_person.py to testcases/test_add_person.py
16b1474 verified
raw
history blame contribute delete
851 Bytes
import streamlit.testing as stt
# Define a test case for adding a person
def test_add_person():
# Simulate user input
with stt.install_test_input():
stt.test_runner.start("app.py") # Path to your Streamlit script
# Select the "Add Person" option
stt.test_input("Select Option", "Add Person")
# Enter name, image path, and Instagram handle
stt.test_input("Enter Name", "John Doe")
stt.test_input("Upload Image", "random.jpg") # Path to your test image
stt.test_input("Enter Instagram Handle", "johndoe123")
# Click the "Add Person" button
stt.test_input("Add Person")
# Verify the success message
stt.test_output("Success: John Doe added to the database!")
# Clean up
stt.test_runner.cleanup()
# Run the test case
test_add_person()