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

doc: add testing story example for button with payload #11766

Merged
merged 4 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/11766.doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clearify in the documentation how to write testing stories if a user press a button with payload
22 changes: 21 additions & 1 deletion docs/docs/testing-your-assistant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ the stories in your training data, but include the user message as well.

Here are some examples:

<Tabs values={[{"label": "Basics", "value": "basics"}, {"label": "Custom Actions", "value": "customactions"}, {"label": "Forms Happy Path", "value": "formshappypath"}, {"label": "Forms Unhappy Path", "value": "formsunhappypath"}]} defaultValue="basics">
<Tabs values={[{"label": "Basics", "value": "basics"}, {"label": "Button Payload", "value": "buttons"}, {"label": "Custom Actions", "value": "customactions"}, {"label": "Forms Happy Path", "value": "formshappypath"}, {"label": "Forms Unhappy Path", "value": "formsunhappypath"}]} defaultValue="basics">
<TabItem value="basics">

```yaml-rasa title="tests/test_stories.yml" {5,9,13}
Expand All @@ -72,6 +72,26 @@ Here are some examples:
- action: utter_ask_price
```

</TabItem>
<TabItem value="buttons">

```yaml-rasa title="tests/test_stories.yml" {5,12}
stories:
- story: A test where a user clicks on a button with payload
steps:
- user: |
hello
intent: greet
- action: utter_ask_howcanhelp
- user: /inform{{"cuisine":"chinese"}}
intent: inform
- action: utter_ask_location
- user: /inform{{"location":"Paris"}}
intent: inform
- action: utter_ask_price
```


</TabItem>
<TabItem value="customactions">

Expand Down