ArvindSelvaraj commited on
Commit
00eb694
·
verified ·
1 Parent(s): d9415f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -22,25 +22,18 @@ if st.button("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
  )
@@ -49,4 +42,4 @@ if st.sidebar.button("Export Test Cases", key="export_button"):
49
 
50
  # Footer with a clean divider
51
  st.markdown("---")
52
- st.write("Built by the QA Automation Team")
 
22
 
23
  # Export test cases
24
  st.sidebar.title("Export Test Cases")
 
25
  if st.sidebar.button("Export Test Cases", key="export_button"):
26
  if 'test_cases' in st.session_state:
27
  test_cases = st.session_state.test_cases
28
+ export_content = backend.export_test_cases(test_cases, 'csv')
29
 
30
+ mime_type = "text/csv"
 
 
 
 
 
 
31
 
32
  if export_content:
33
  st.sidebar.download_button(
34
+ label="Download Test Cases as CSV",
35
  data=export_content,
36
+ file_name="test_cases.csv",
37
  mime=mime_type,
38
  key="download_button"
39
  )
 
42
 
43
  # Footer with a clean divider
44
  st.markdown("---")
45
+ st.write("Built by the QA Automation Team")