Create test_delete_person.py
Browse files- test_delete_person.py +22 -0
test_delete_person.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit.testing as stt
|
| 2 |
+
|
| 3 |
+
def test_delete_person():
|
| 4 |
+
with stt.install_test_input():
|
| 5 |
+
stt.test_runner.start("path_to_your_script.py")
|
| 6 |
+
|
| 7 |
+
# Select the "Delete Person" option
|
| 8 |
+
stt.test_input("Select Option", "Delete Person")
|
| 9 |
+
|
| 10 |
+
# Enter the name of the person to delete
|
| 11 |
+
stt.test_input("Enter Name", "John Doe")
|
| 12 |
+
|
| 13 |
+
# Click the "Delete Person" button
|
| 14 |
+
stt.test_input("Delete Person")
|
| 15 |
+
|
| 16 |
+
# Verify the deletion message
|
| 17 |
+
stt.test_output("John Doe deleted from the database!")
|
| 18 |
+
|
| 19 |
+
# Clean up
|
| 20 |
+
stt.test_runner.cleanup()
|
| 21 |
+
|
| 22 |
+
test_delete_person()
|