codeforequity-at / botium-bindings

The Selenium for Chatbots
http://www.botium.at
MIT License
108 stars 33 forks source link

botframework : the date time is taken into account while running test #90

Open tchikl-h opened 6 years ago

tchikl-h commented 6 years ago

Hello,

I have used the sample from botframwork of testmybot and pluged it with my personnal bot. But my bot is sending images wich are stored as json in the .txt file for the test.

When I am running the npm run test command, I got the following fail : `Failures: 1) TestMyBot Test Suite for testmybot-sample-botframework basic_test Message: Failed: basic_test/Line 129: Expected bot response "2018-06-21T08:05:39.126Z" to match one of "2018-06-20T16:24:29.022Z" Stack: Error: basic_test/Line 129: Expected bot response "2018-06-21T08:05:39.126Z" to match one of "2018-06-20T16:24:29.022Z" at Object.assertBotResponse (/home/herve/testmybot/samples/botframework/node_modules/botium-core/src/scripting/ScriptingProvider.js:39:17) at Convo._compareObject (/home/herve/testmybot/samples/botframework/nodemodules/botium-core/src/scripting/Convo.js:145:37) at .forOwn (/home/herve/testmybot/samples/botframework/node_modules/botium-core/src/scripting/Convo.js:137:16) at /home/herve/testmybot/samples/botframework/node_modules/lodash/lodash.js:4925:15 at baseForOwn (/home/herve/testmybot/samples/botframework/node_modules/lodash/lodash.js:3010:24) at Function.forOwn (/home/herve/testmybot/samples/botframework/node_modules/lodash/lodash.js:13013:24) at Convo._compareObject (/home/herve/testmybot/samples/botframework/node_modules/botium-core/src/scripting/Convo.js:135:9) at container.WaitBotSays.then (/home/herve/testmybot/samples/botframework/node_modules/botium-core/src/scripting/Convo.js:88:24) at at process._tickCallback (internal/process/next_tick.js:188:7)

1 spec, 1 failure Finished in 163.33 seconds`

In the json, testmybot saved the timestamp for the image. When I am executing the test command, I am obviously getting an error.

Do you have any way to get around this problem ?

Thank you kindly,

Hervé Tchikladzé

codeforequity-at commented 5 years ago

I didn't get your description how you deal with the picture. But in the convo files you should replace the timestamp with a regular expression to make the test pass.