codeforequity-at / botium-core

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

How to validate using regex? #86

Closed Endeavour-BRM closed 6 years ago

Endeavour-BRM commented 6 years ago

When the bot response is

"Your hotel is booked for 2nd July for 2 persons"

In the above response the date changes based on user input. So want to make sure that the above reponse is validated using regex such as "Your hotel is booked for * ** for 2 persons".

Is there any feature in botium which helps to accomplish this. Please help.

codeforequity-at commented 6 years ago

Pls set the capability "SCRIPTING_MATCHING_MODE" to "regexp" and the validation will use regular expressions. So this regexp should work in your case:

...
#bot
Your hotel is booked for .* for [0-9] persons
...
Endeavour-BRM commented 6 years ago

@codeforequity-at That worked. Thanks a lot for the quick response. Closing it.