codeforequity-at / botium-core

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

Re-using data from bot responses #44

Closed pmioulet closed 6 years ago

pmioulet commented 6 years ago

I would like to create a test case where I reuse data sent back by the bot.

For example, let's say I ask the bot to create an issue on the ticketing system and I then want to close it using the id created I need to access that variable:

create ticket
BOT SAYS : Sure thing! What type of ticket would you like to create?
INCIDENT
BOT SAYS : Sure! Please provide a description.
this chatbot rocks
BOT SAYS : Ticket has been created with the number INC0060245
delete ticket INC0060245
BOT SAYS: Ticket INC0060245 was deleted

Problem is being able to get this INC0060245 variable.

Another chatbot project, rivescript has a nice-ish way to address these problems. They basically store all the regexp groups in the context and allow the users to refer to them using tags to represent any regex group extracted in a user query:

+ i am (really|very|super) tired
- I'm sorry to hear that you are <star> tired.

I was wondering if there is any plan to add such a feature or how feasible it would be to implement it given the current code?

Thanks.

codeforequity-at commented 6 years ago

That's excellent input. I am sure there are lots of use cases for this. I guess it wouldn't be so hard to implement - introducing some kind of "conversation context" and filling it from conversation progress (comparable to a redux store).

codeforequity-at commented 6 years ago

Working on it in Branch ENH_44_Scripting_Memory

codeforequity-at commented 6 years ago

the latest build 1.3.27 adds this feature to botium.

codeforequity-at commented 6 years ago

Documentation is there: https://github.com/codeforequity-at/botium-core/wiki/Botium-Scripting#scripting-memory