ArvindSelvaraj
commited on
Delete app.py
Browse files
app.py
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import backend # Importing backend functions
|
3 |
-
import os
|
4 |
-
|
5 |
-
# Title
|
6 |
-
st.title("Test Case Generator - QA User Story")
|
7 |
-
|
8 |
-
# Input field for the user story
|
9 |
-
user_story = st.text_area("Enter the QA User Story", "")
|
10 |
-
|
11 |
-
# Button to generate test cases
|
12 |
-
if st.button("Generate Test Cases"):
|
13 |
-
if user_story:
|
14 |
-
# Show a spinner while the test cases are being generated
|
15 |
-
with st.spinner("Generating test cases..."):
|
16 |
-
test_cases = backend.generate_testcases(user_story)
|
17 |
-
st.subheader("Generated Test Cases")
|
18 |
-
st.write(test_cases)
|
19 |
-
st.session_state.test_cases = test_cases # Store test cases in session state for further use
|
20 |
-
else:
|
21 |
-
st.error("Please enter a user story to generate test cases.")
|
22 |
-
|
23 |
-
# Export test cases
|
24 |
-
st.sidebar.title("Export Test Cases")
|
25 |
-
format = st.sidebar.selectbox("Select Format", ["json", "csv"], key="export_format")
|
26 |
-
if st.sidebar.button("Export Test Cases", key="export_button"):
|
27 |
-
if 'test_cases' in st.session_state:
|
28 |
-
test_cases = st.session_state.test_cases
|
29 |
-
export_content = backend.export_test_cases(test_cases, format)
|
30 |
-
|
31 |
-
if format == 'json':
|
32 |
-
mime_type = "application/json"
|
33 |
-
elif format == 'csv':
|
34 |
-
mime_type = "text/csv"
|
35 |
-
else:
|
36 |
-
st.sidebar.error(f"Unsupported format: {format}")
|
37 |
-
export_content = None
|
38 |
-
|
39 |
-
if export_content:
|
40 |
-
st.sidebar.download_button(
|
41 |
-
label=f"Download Test Cases as {format.upper()}",
|
42 |
-
data=export_content,
|
43 |
-
file_name=f"test_cases.{format}",
|
44 |
-
mime=mime_type,
|
45 |
-
key="download_button"
|
46 |
-
)
|
47 |
-
else:
|
48 |
-
st.sidebar.error("No test cases available to export.")
|
49 |
-
|
50 |
-
# Footer with a clean divider
|
51 |
-
st.markdown("---")
|
52 |
-
st.write("Built by the QA Automation Team")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|