Ashar086 commited on
Commit
f0b4b94
·
verified ·
1 Parent(s): 4714ff1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -48
app.py CHANGED
@@ -1,49 +1,37 @@
1
  import streamlit as st
2
- from testing import estimate_testing_efforts, perform_all_tests, generate_test_report
3
-
4
- # Step 1: Exchange API Key for Access Token
5
- apikey = "6NV9V90_cdLLarB6FhcN5lQh2JVYf50mUfQ8C4KHNby3"
6
- auth_url = "https://iam.cloud.ibm.com/identity/token"
7
-
8
- # Fetch Access Token
9
- access_token = generate_text.get_access_token(apikey, auth_url)
10
-
11
- if not access_token:
12
- st.error("Failed to retrieve access token.")
13
- st.stop()
14
-
15
- # Title of the Streamlit app
16
- st.title("IBM Watson Text Generation and Testing Automation")
17
-
18
- # User input for the text generation prompt
19
- user_input = st.text_area("Enter your prompt:", value="You are Granite Chat, an AI language model developed by IBM. You are a cautious assistant.")
20
-
21
- # Text generation
22
- if st.button("Generate Text"):
23
- generated_text = generate_text.generate_text(user_input, access_token)
24
- if generated_text:
25
- st.write("**IBM Watson Output:**")
26
- st.write(generated_text)
27
- else:
28
- st.error("Failed to generate text.")
29
-
30
- # URL input for testing estimation
31
- url_input = st.text_input("Enter the URL of the website or web app for testing:")
32
-
33
- # Testing estimation
34
- if st.button("Estimate Testing Efforts"):
35
- if url_input:
36
- efforts = estimate_testing_efforts(url_input)
37
- st.write("**Testing Efforts Estimation:**")
38
- st.write(efforts)
39
- else:
40
- st.error("Please enter a URL.")
41
-
42
- # Perform tests and generate report
43
- if st.button("Perform Tests and Generate Report"):
44
- if url_input:
45
- test_report = perform_all_tests(url_input)
46
- st.write("**Test Report:**")
47
- st.write(test_report)
48
- else:
49
- st.error("Please enter a URL.")
 
1
  import streamlit as st
2
+ from estimation import estimate_testing_resources
3
+ from automation import generate_automation_scripts
4
+ from critical_functionality import test_critical_functionality
5
+ from regression_testing import run_regression_tests
6
+ from test_report import generate_test_report
7
+ from sanity_check import perform_sanity_check
8
+ from performance_testing import perform_performance_test
9
+
10
+ def main():
11
+ st.title("Automated Testing Tool")
12
+
13
+ url = st.text_input("Enter the URL to be tested")
14
+
15
+ if st.button("Estimate Testing Resources"):
16
+ st.write(estimate_testing_resources(url))
17
+
18
+ if st.button("Generate Automation Test Scripts"):
19
+ st.write(generate_automation_scripts(url))
20
+
21
+ if st.button("Test Critical Functionalities"):
22
+ st.write(test_critical_functionality(url))
23
+
24
+ if st.button("Run Regression Tests"):
25
+ st.write(run_regression_tests(url))
26
+
27
+ if st.button("Generate Test Report"):
28
+ st.write(generate_test_report(url))
29
+
30
+ if st.button("Perform Sanity Check"):
31
+ st.write(perform_sanity_check(url))
32
+
33
+ if st.button("Perform Performance Test"):
34
+ st.write(perform_performance_test(url))
35
+
36
+ if __name__ == "__main__":
37
+ main()