codeforequity-at / botium-core

The Selenium for Chatbots - Bots Testing Bots
https://www.botium.ai
MIT License
229 stars 64 forks source link

Context Variable in a Convo file using Watson. #62

Closed rafaelBergamin closed 5 years ago

rafaelBergamin commented 6 years ago

Hi!

I have a conversation tree that can go to multiple subjects, in Watson we have a context variable that can have the following values:

$product == 'Password Reset' $product == 'Account'

In my convo files, how can I set this variable to initiate each of this products trees in my tests?

Ex: .... ....

me

Hi

bot

How can i help you to reset your password ?

Thanks in advance.

codeforequity-at commented 6 years ago

Currently, this is not possible with Botium itself, as it handles text input only (context is not modified by Botium).

The recommended way of doing this is (and you will probably be in need for such behaviour in other cases as well): the Watson workspace should accept some wort of "control" commands to prepare the current user session for a test case (in your case: to manipulate the context for the password reset test case) - this is how we do it ourselves when we are composing test cases for personlized chatbot conversations. Please follow up here if you need more input on this, this might be interesting to other users as well.

rafaelBergamin commented 6 years ago

Hi, thanks for the reply!

So, how I can control the Watson Workspace to prepare my initial context ? And other problem, we have context variables beeing set during the user conversation, to determine which path the dialogflow will go.

Is there any way to do this using botium ?

Thanks in advance.

codeforequity-at commented 6 years ago

We keep this very simple: create an entity (for example testcases_prepare) with one instance (for example "testcaseprepare_passwordreset"). In conversation flow insert a branch activated when this entity found and set your context there.

While it is currently not possible to manipulate context with botium itself, existing context values are safely handled by botium - your conversation flow is safe

Am 22.05.2018 20:42 schrieb "rafaelBergamin" notifications@github.com:

Hi, thanks for the reply!

So, how I can control the Watson Workspace to prepare my initial context ? And other problem, we have context variables beeing set during the user conversation, to determine which path the dialogflow will go.

Is there any way to do this using botium ?

Thanks in advance.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codeforequity-at/botium-core/issues/62#issuecomment-391098266, or mute the thread https://github.com/notifications/unsubscribe-auth/AZEdT_gP8vTiFd0Frx_u2c7spshqv6ygks5t1FwFgaJpZM4UHY6h .