Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use liquid templates #2

Merged
merged 1 commit into from
Nov 29, 2024
Merged

use liquid templates #2

merged 1 commit into from
Nov 29, 2024

Conversation

aleksei-okatiev
Copy link
Contributor

@aleksei-okatiev aleksei-okatiev commented Nov 29, 2024

This PR allows to store prompts as a liquid template.
Liquid has iterators and allows to store if else logic inside the prompt.

An example of usage for refine test case prompt:

"Goal of the test:
'''
{{goal}}
'''

Out of scope:
'''
{{out_of_scope}}
'''

Additional requirements:
'''
{{additional_requirements}}
'''

Feature Description:
'''
{{test_features}}
'''

Original Gherkin Test Case to refine:
'''
{{test_case_content}}
'''

{% if compared_screenshots_message %}
Difference between the last two screenshots:
'''
{{compared_screenshots_message}}
'''
{% endif %}

{% if html_diff_message %}
Changes in HTML after the last test case step:

{{html_diff_message}}
{% endif %}

{% if passed_parents %}
Chain of previous versions of the test case:
{% for test_case in passed_parents %}
'''
{{ test_case }}
'''
{% endfor %}
{% endif %}

{% if passed_relatives %}
Other test cases already executed, please avoid generation of the same test cases:
{% for test_case in passed_relatives %}
'''
{{ test_case }}
'''
{% endfor %}
{% endif %}

@aleksei-okatiev aleksei-okatiev self-assigned this Nov 29, 2024
@aleksei-okatiev aleksei-okatiev merged commit f8def0d into main Nov 29, 2024
1 check passed
@aleksei-okatiev aleksei-okatiev deleted the use_liquid branch November 29, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant