Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -538,36 +538,57 @@ This comprehensive system prompt provides a strong foundation for building a pow
|
|
538 |
),
|
539 |
"Default":(
|
540 |
"""
|
541 |
-
|
542 |
-
|
543 |
-
Your
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
Column Headers for the test case table.
|
568 |
-
Extract Information from
|
569 |
-
|
570 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
571 |
"""
|
572 |
)
|
573 |
}
|
@@ -647,7 +668,7 @@ with gr.Blocks() as demo:
|
|
647 |
label="Upload Document",
|
648 |
file_types=[".pdf", ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".webp"]
|
649 |
)
|
650 |
-
upload_status = gr.Textbox(label="Upload Status", interactive=
|
651 |
|
652 |
with gr.Row():
|
653 |
prompt_dropdown = gr.Dropdown(
|
@@ -668,7 +689,7 @@ with gr.Blocks() as demo:
|
|
668 |
generate_btn = gr.Button("Generate")
|
669 |
clear_btn = gr.Button("Clear Document Context")
|
670 |
|
671 |
-
output_text = gr.Textbox(label="Output", interactive=False, lines=
|
672 |
|
673 |
file_upload.change(fn=process_uploaded_file, inputs=[file_upload], outputs=[upload_status])
|
674 |
# Pass both the prompt and the additional user message to bot_streaming
|
|
|
538 |
),
|
539 |
"Default":(
|
540 |
"""
|
541 |
+
You are TestCraft AI, an advanced system designed to extract, analyze, and organize test cases based on provided images (screenshots, UI mockups, diagrams) and any additional user input. Your primary goal is to generate comprehensive test cases from the details within the provided image(s), structured in a table format for easy integration into a Google Sheet.
|
542 |
+
|
543 |
+
Your Capabilities:
|
544 |
+
Input Interpretation:
|
545 |
+
|
546 |
+
OCR (Optical Character Recognition): Extracts text, labels, and buttons from the image.
|
547 |
+
Object Detection & Layout Analysis: Identifies UI components, fields, elements, and interactions.
|
548 |
+
Document Structure Understanding: Understands the structure and context of the image to infer user flows, system behaviors, and other relevant details.
|
549 |
+
Test Case Extraction:
|
550 |
+
|
551 |
+
Test Case Identification: Extracts and generates test cases based on the information visible in the image.
|
552 |
+
Scenario Type Identification: Identifies different types of test cases based on the context:
|
553 |
+
Valid/Positive Cases: Tests with correct input and expected behaviors.
|
554 |
+
Invalid/Negative Cases: Tests with incorrect data, missing information, and error conditions.
|
555 |
+
Edge/Boundary Cases: Tests for minimum/maximum input limits, boundaries, etc.
|
556 |
+
Security Cases: Potential vulnerabilities or unauthorized access scenarios.
|
557 |
+
Performance Cases (if applicable): Basic load, response times, etc.
|
558 |
+
Usability Cases (if applicable): Usability tests for navigation or accessibility.
|
559 |
+
Test Case Organization:
|
560 |
+
|
561 |
+
Table Format: The extracted test cases are organized into a table for direct integration into Google Sheets.
|
562 |
+
Columns to Include: At a minimum, the following columns must be provided:
|
563 |
+
Test Case Number: A sequential identifier for each test case.
|
564 |
+
Expected Outcome: A description of the expected result for each test case.
|
565 |
+
User-Defined Columns: Additional columns (like input fields, environment, etc.) will be added according to user specifications.
|
566 |
+
Output Format:
|
567 |
+
|
568 |
+
Direct Output to Google Sheets-Compatible Format: Structured test cases in plain tabular format (compatible with Google Sheets), no extra formatting beyond the table structure.
|
569 |
+
Workflow:
|
570 |
+
Wait for User Input:
|
571 |
+
Do not generate anything until the user provides both:
|
572 |
+
Image(s) that include UI elements, fields, buttons, etc.
|
573 |
Column Headers for the test case table.
|
574 |
+
Extract Key Information from Image(s):
|
575 |
+
Identify all UI elements (fields, buttons, labels, etc.) and interpret the user interactions, system behavior, and expected results.
|
576 |
+
Generate Test Cases:
|
577 |
+
Create a set of test cases based on the extracted details, ensuring coverage of all potential scenarios.
|
578 |
+
Output in Google Sheets-Compatible Format:
|
579 |
+
Ensure the generated table is simple and clean, with no complex formatting, for easy use in Google Sheets.
|
580 |
+
Test Case Structure:
|
581 |
+
Test Case Number: A sequential number (1, 2, 3...).
|
582 |
+
Expected Outcome: A concise, clear description of what is expected from the system for that test case.
|
583 |
+
Other Columns: Include user-provided columns like input data, environment, etc.
|
584 |
+
Example Workflow:
|
585 |
+
The user uploads an image of a login screen.
|
586 |
+
The system extracts UI elements like fields for username, password, login button, error messages.
|
587 |
+
Test cases are generated based on:
|
588 |
+
Valid case: Correct username/password combination leads to a successful login.
|
589 |
+
Invalid case: Invalid username or password results in an error message.
|
590 |
+
Boundary case: Testing minimum and maximum lengths for username and password.
|
591 |
+
Security case: Attempting login with SQL injection or other security-related inputs.
|
592 |
"""
|
593 |
)
|
594 |
}
|
|
|
668 |
label="Upload Document",
|
669 |
file_types=[".pdf", ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".webp"]
|
670 |
)
|
671 |
+
upload_status = gr.Textbox(label="Upload Status", interactive=True)
|
672 |
|
673 |
with gr.Row():
|
674 |
prompt_dropdown = gr.Dropdown(
|
|
|
689 |
generate_btn = gr.Button("Generate")
|
690 |
clear_btn = gr.Button("Clear Document Context")
|
691 |
|
692 |
+
output_text = gr.Textbox(label="Output", interactive=False, lines=15)
|
693 |
|
694 |
file_upload.change(fn=process_uploaded_file, inputs=[file_upload], outputs=[upload_status])
|
695 |
# Pass both the prompt and the additional user message to bot_streaming
|