codeforequity-at / botium-bindings

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

Unable to read utterances.txt file with botium-bindings #118

Closed jpiduru closed 4 years ago

jpiduru commented 4 years ago

Using alexa-smapi-connector with simulation

In the folder spec convo & utterances files are there but utterances file is not being read.

spec/convo/balance.convo.txt spec/convo/balance.en.utterances.txt

Not sure what is going on here.

Call simulate-skill error. Error code: 400 { "message": "Invalid request payload. Please ensure that the request payload has all required fields present." }

==========set "expandUtterancesToConvos": true in package.json================ package.json

"botium": { "convodirs": [ "spec/convo" ], "expandConvos": true, "expandUtterancesToConvos": true, "expandScriptingMemoryToConvos": false

==============balance.convo.txt====

test case for checking balance

me

launch workshop

bot

xxxxxxxxxxxxx

me

one two

PAUSE 5000

bot

Great! You have been identified.

PAUSE 3000

me

balance.check PAUSE 3000

==========balance.en.utterances.tx

balance.check

show my balance tell my balance

Thanks!

codeforequity-at commented 4 years ago

I guess that the empty line in balance.en.utterances.txt causes the troubles. An empty line is considered as empty utterance, which can make the SMAPI fail (no tested by myself).

jpiduru commented 4 years ago

just to confirm , removed the empty line and retried but no luck!

Here is the log

botium-BaseContainer _RunCustomHook onUserSays finished +8s botium-connector-alexa-smapi UserSays called +8s botium-connector-alexa-smapi Simulation created for simulation id f7dfafa8-25e1-4820-a410-9d877373d879, polling for response ... +528ms botium-connector-alexa-smapi Simulation got response: {"id":"f7dfafa8-25e1-4820-a410-9d877373d879","status":"IN_PROGRESS"} +0ms botium-connector-alexa-smapi Simulation got response: {"id":"f7dfafa8-25e1-4820-a410-9d877373d879","status":"FAILED","result":{"error":{"message":"This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again."}}} +2s botium-Convo BotiumError: test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again. botium-Convo at botiumErrorFromErr (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/BotiumError.js:61:12) botium-Convo at scriptingEvents.setUserInput.then.then.then.then.catch (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:323:31) botium-Convo at process._tickCallback (internal/process/next_tick.js:68:7) +3s botium-bindings-main Test Case "test case for checking balance" failed: { TranscriptError: test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again. botium-bindings-main at async.waterfall (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:227:25) botium-bindings-main at wrapper (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:272:20) botium-bindings-main at next (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:4584:24) botium-bindings-main at /Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:325:20 botium-bindings-main at runConversation (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:205:15) botium-bindings-main at async.mapSeries (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:449:9) botium-bindings-main at err (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:252:13) botium-bindings-main at wrapper (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:272:20) botium-bindings-main at iterateeCallback (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:417:21) botium-bindings-main at /Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:325:20 botium-bindings-main at _iteratee (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/async/dist/async.js:249:17) botium-bindings-main at convoStepDone (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:279:11) botium-bindings-main at scriptingEvents.setUserInput.then.then.then.then.catch (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:329:15) botium-bindings-main at process._tickCallback (internal/process/next_tick.js:68:7) botium-bindings-main name: 'TranscriptError', botium-bindings-main transcript: botium-bindings-main Transcript { botium-bindings-main steps: botium-bindings-main [ [TranscriptStep], botium-bindings-main [TranscriptStep], botium-bindings-main [TranscriptStep], botium-bindings-main [TranscriptStep], botium-bindings-main [TranscriptStep] ], botium-bindings-main scriptingMemory: {}, botium-bindings-main convoBegin: 2019-12-28T17:53:49.110Z, botium-bindings-main convoEnd: 2019-12-28T17:54:20.416Z, botium-bindings-main err: botium-bindings-main { BotiumError: test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again. botium-bindings-main at botiumErrorFromErr (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/BotiumError.js:61:12) botium-bindings-main at scriptingEvents.setUserInput.then.then.then.then.catch (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:323:31) botium-bindings-main at process._tickCallback (internal/process/next_tick.js:68:7) name: 'BotiumError', context: [Object] } }, botium-bindings-main cause: botium-bindings-main { BotiumError: test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again. botium-bindings-main at botiumErrorFromErr (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/BotiumError.js:61:12) botium-bindings-main at scriptingEvents.setUserInput.then.then.then.then.catch (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-bindings/node_modules/botium-core/src/scripting/Convo.js:323:31) botium-bindings-main at process._tickCallback (internal/process/next_tick.js:68:7) botium-bindings-main name: 'BotiumError', botium-bindings-main context: botium-bindings-main { err: botium-bindings-main Error: Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again. botium-bindings-main at pollSimulationResult (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-connector-alexa-smapi/dist/botium-connector-alexa-smapi-cjs.js:532:28) botium-bindings-main at apiWrapper.callGetSimulation.data (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/botium-connector-alexa-smapi/dist/botium-connector-alexa-smapi-cjs.js:476:23) botium-bindings-main at Request.request [as _callback] (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/ask-cli/lib/api/request-wrapper.js:72:17) botium-bindings-main at Request.self.callback (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/request/request.js:185:22) botium-bindings-main at Request.emit (events.js:198:13) botium-bindings-main at Request. (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/request/request.js:1161:10) botium-bindings-main at Request.emit (events.js:198:13) botium-bindings-main at IncomingMessage. (/Users/xxxxxxxx/myprojectWS/myproject/node_modules/request/request.js:1083:12) botium-bindings-main at Object.onceWrapper (events.js:286:20) botium-bindings-main at IncomingMessage.emit (events.js:203:15) botium-bindings-main at endReadableNT (_stream_readable.js:1145:12) botium-bindings-main at process._tickCallback (internal/process/next_tick.js:63:19), botium-bindings-main message: botium-bindings-main 'test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again.', botium-bindings-main input: [ConvoStep] } } } +31s 1) test case for checking balance botium-BaseContainer _RunCustomHook onStop finished +3s botium-connector-alexa-smapi Stop called +19ms botium-connector-alexa-smapi Clean called +2ms botium-BaseContainer _RunCustomHook onClean finished +2ms botium-BaseContainer Cleanup rimrafing temp dir /Users/xxxxxxxx/myprojectWS/myproject/botiumwork/myproject-20191228-115348-u0on3 +1ms

0 passing (32s) 1 failing

1) myproject test case for checking balance: Error: test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again. ######################################## test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again.

{"err":{},"message":"test case for checking balance/Line 21: error sending to bot - Skill simulation for simulation id f7dfafa8-25e1-4820-a410-9d877373d879 failed with message: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again.","input":{"sender":"me","channel":null,"messageText":"balance.check","stepTag":"Line 21","not":false,"asserters":[],"logicHooks":[],"userInputs":[]}} at BotiumBindings.wrapBotiumError (node_modules/botium-bindings/src/BotiumBindings.js:98:12) at convo.Run.then.catch (node_modules/botium-bindings/src/BotiumBindings.js:139:33) at process._tickCallback (internal/process/next_tick.js:68:7)

codeforequity-at commented 4 years ago

can you pls share the project folder

jpiduru commented 4 years ago

odd, by setting "expandUtterancesToConvos": false , it is working now this way.

both my utterances and convo file is in the same folder. I am yet to try separating utterances file into a separate folder. Does that work?

====Here is my utterance file

USER_CBAL_UTT show my balance tell my balance check my balance

=============balance.convo.txt====

test case for checking balance

me

launch workshop

bot

xxxxxxxxxxxxx

me

one two

PAUSE 5000

bot

Great! You have been identified.

PAUSE 3000

me

USER_CBAL_UTT PAUSE 3000

=========### =set "expandUtterancesToConvos": false in package.json================ package.json

"botium": { "convodirs": [ "spec/convo" ], "expandConvos": true, "expandUtterancesToConvos": false, "expandScriptingMemoryToConvos": false

======

jpiduru commented 4 years ago

Is this issue fixed?

codeforequity-at commented 4 years ago

yes