Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

promptfooconfig.yaml 1.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: 'Testing browser automation with local Gradio app'
  3. prompts:
  4. - 'Tell me about {{topic}}'
  5. providers:
  6. - id: browser
  7. config:
  8. headless: false # set to false to see the browser in action
  9. steps:
  10. # Always start with a respectful delay
  11. - action: wait
  12. args:
  13. ms: 2000
  14. # Navigate to local Gradio app
  15. - action: navigate
  16. args:
  17. url: 'http://localhost:7860'
  18. # Wait for the page to load
  19. - action: wait
  20. args:
  21. ms: 2000
  22. # Type the message in the Gradio textbox
  23. - action: type
  24. args:
  25. selector: 'textarea[data-testid="textbox"]'
  26. text: '{{prompt}}'
  27. # Submit the message
  28. - action: click
  29. args:
  30. selector: 'button#submit-button'
  31. # Wait for the response with reasonable timeout
  32. - action: wait
  33. args:
  34. ms: 3000
  35. # Extract the bot's response from the chatbot - get the last message
  36. - action: extract
  37. args:
  38. selector: 'div[data-testid="bot"]:last-of-type .prose'
  39. name: response
  40. transformResponse: 'extracted.response'
  41. tests:
  42. - vars:
  43. topic: testing browser automation
  44. assert:
  45. - type: contains
  46. value: 'Test successful'
  47. - vars:
  48. topic: how the system works
  49. assert:
  50. - type: contains
  51. value: 'simple demo response'
  52. - vars:
  53. topic: a simple greeting
  54. assert:
  55. - type: javascript
  56. value: output.length > 0
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...