codeforequity-at / botium-core

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

Error: Cannot find module 'google-assistant' #218

Closed mahmeds7777 closed 5 years ago

mahmeds7777 commented 5 years ago

Hi @codeforequity-at

I hope you've been well! I noticed the recently added support for Google Actions and therefore wasted no time in folllowing the instructions outlined here in an attempt to set it up.

Unfortunately, while at the "Run Botium Connector Google Actions Initialization Tool" step, I encountered the following issue:

Capabilities are written to botium.json

Validating Capabilities... /Users/mahmeds/Documents/Botium/node_modules/botium-connector-google-assistant/src/actions-on-google.js:301 : debugInfo.finalResponse.richResponse ^

TypeError: Cannot read property 'richResponse' of undefined at ClientDuplexStream.conversation.on (/Users/mahmeds/Documents/Botium/node_modules/botium-connector-google-assistant/src/actions-on-google.js:301:39) at ClientDuplexStream.emit (events.js:182:13) at addChunk (_stream_readable.js:283:12) at readableAddChunk (_stream_readable.js:264:11) at ClientDuplexStream.Readable.push (_stream_readable.js:219:10) at Object.onReceiveMessage (/Users/mahmeds/Documents/Botium/node_modules/grpc/src/client_interceptors.js:1292:19) at InterceptingListener.recvMessageWithContext (/Users/mahmeds/Documents/Botium/node_modules/grpc/src/client_interceptors.js:607:19) at /Users/mahmeds/Documents/Botium/node_modules/grpc/src/client_interceptors.js:706:14

Running > Botium-cli Emulator -v yielded:

cagtam1079296:botium mahmeds$ botium-cli emulator --v botium-cli Using Botium configuration file ./botium.json +0ms botium-cli-emulator command options: { _: [ 'emulator' ], botium-cli-emulator help: false, botium-cli-emulator h: false, botium-cli-emulator version: false, botium-cli-emulator V: false, botium-cli-emulator v: true, botium-cli-emulator verbose: true, botium-cli-emulator convos: [ '.' ], botium-cli-emulator C: [ '.' ], botium-cli-emulator config: './botium.json', botium-cli-emulator c: './botium.json', botium-cli-emulator ui: 'console', botium-cli-emulator emulatorport: 3000, botium-cli-emulator '$0': '/usr/local/bin/botium-cli' } +0ms botium-BotDriver Loaded Botium configuration file ./botium.json +0ms botium-BotDriver Loaded Botium configuration file ./botium.json +1ms botium-BotDriver Changed capability CONFIG to "./botium.json" using environment variables. +0ms botium-BotDriver BuildCompiler: Capabilites: { PROJECTNAME: 'Botium Project Google Assistant', botium-BotDriver TEMPDIR: 'botiumwork', botium-BotDriver CLEANUPTEMPDIR: true, botium-BotDriver WAITFORBOTTIMEOUT: 10000, botium-BotDriver SIMULATE_WRITING_SPEED: false, botium-BotDriver DOCKERCOMPOSEPATH: 'docker-compose', botium-BotDriver DOCKERMACHINEPATH: 'docker-machine', botium-BotDriver DOCKERMACHINE: false, botium-BotDriver DOCKERIMAGE: 'node:boron', botium-BotDriver DOCKERUNIQUECONTAINERNAMES: false, botium-BotDriver DOCKERSYSLOGPORT_RANGE: '47100-47299', botium-BotDriver BOT_HEALTH_STATUS: 200, botium-BotDriver SLACK_PUBLISHPORT_RANGE: '46100-46299', botium-BotDriver FACEBOOK_PUBLISHPORT_RANGE: '46300-46499', botium-BotDriver FACEBOOK_SEND_DELIVERY_CONFIRMATION: true, botium-BotDriver BOTFRAMEWORK_PUBLISHPORT_RANGE: '46500-46699', botium-BotDriver BOTFRAMEWORK_WEBHOOK_PORT: 3978, botium-BotDriver BOTFRAMEWORK_WEBHOOK_PATH: 'api/messages', botium-BotDriver BOTFRAMEWORK_CHANNEL_ID: 'facebook', botium-BotDriver SIMPLEREST_PING_RETRIES: 6, botium-BotDriver SIMPLEREST_PING_TIMEOUT: 10000, botium-BotDriver SIMPLEREST_PING_VERB: 'GET', botium-BotDriver SIMPLEREST_METHOD: 'GET', botium-BotDriver WEBSPEECH_SERVER_PORT: 46050, botium-BotDriver WEBSPEECH_LANGUAGE: 'en-US', botium-BotDriver WEBSPEECH_CLOSEBROWSER: true, botium-BotDriver SCRIPTING_TXT_EOL: '\n', botium-BotDriver SCRIPTING_XLSX_EOL_SPLIT: '\r', botium-BotDriver SCRIPTING_XLSX_EOL_WRITE: '\r\n', botium-BotDriver SCRIPTING_XLSX_STARTROW: 1, botium-BotDriver SCRIPTING_XLSX_STARTCOL: 'A', botium-BotDriver SCRIPTING_NORMALIZE_TEXT: true, botium-BotDriver SCRIPTING_ENABLE_MEMORY: false, botium-BotDriver SCRIPTING_MATCHING_MODE: 'includeLowerCase', botium-BotDriver SCRIPTING_UTTEXPANSION_MODE: 'all', botium-BotDriver SCRIPTING_UTTEXPANSION_RANDOM_COUNT: 1, botium-BotDriver SCRIPTING_UTTEXPANSION_INCOMPREHENSION: 'INCOMPREHENSION', botium-BotDriver ASSERTERS: [], botium-BotDriver LOGIC_HOOKS: [], botium-BotDriver CONTAINERMODE: 'google-actions', botium-BotDriver GOOGLE_ASSISTANT_CLIENT_ID: botium-BotDriver 'redacted', botium-BotDriver GOOGLE_ASSISTANT_CLIENT_SECRET: 'redacted', botium-BotDriver GOOGLE_ASSISTANT_REFRESH_TOKEN: 'redacted', botium-BotDriver GOOGLE_ASSISTANT_TYPE: 'authorized_user', botium-BotDriver GOOGLE_ASSISTANT_START_UTTERANCE: 'Talk to my test app', botium-BotDriver GOOGLE_ASSISTANT_END_UTTERANCE: 'Cancel', botium-BotDriver CONFIG: './botium.json' } +0ms botium-ScriptingProvider Using matching mode: includeLowerCase +0ms botium-asserterUtils Loaded Default asserter - [ 'BUTTONS', botium-asserterUtils 'MEDIA', botium-asserterUtils 'PAUSE_ASSERTER', botium-asserterUtils 'ENTITIES', botium-asserterUtils 'ENTITY_VALUES', botium-asserterUtils 'INTENT', botium-asserterUtils 'INTENT_CONFIDENCE' ] +0ms botium-asserterUtils Loaded Default logic hook - [ 'PAUSE', 'WAITFORBOT' ] +0ms botium-BotDriver Build - Capabilites: { PROJECTNAME: 'Botium Project Google Assistant', botium-BotDriver TEMPDIR: 'botiumwork', botium-BotDriver CLEANUPTEMPDIR: true, botium-BotDriver WAITFORBOTTIMEOUT: 10000, botium-BotDriver SIMULATE_WRITING_SPEED: false, botium-BotDriver DOCKERCOMPOSEPATH: 'docker-compose', botium-BotDriver DOCKERMACHINEPATH: 'docker-machine', botium-BotDriver DOCKERMACHINE: false, botium-BotDriver DOCKERIMAGE: 'node:boron', botium-BotDriver DOCKERUNIQUECONTAINERNAMES: false, botium-BotDriver DOCKERSYSLOGPORT_RANGE: '47100-47299', botium-BotDriver BOT_HEALTH_STATUS: 200, botium-BotDriver SLACK_PUBLISHPORT_RANGE: '46100-46299', botium-BotDriver FACEBOOK_PUBLISHPORT_RANGE: '46300-46499', botium-BotDriver FACEBOOK_SEND_DELIVERY_CONFIRMATION: true, botium-BotDriver BOTFRAMEWORK_PUBLISHPORT_RANGE: '46500-46699', botium-BotDriver BOTFRAMEWORK_WEBHOOK_PORT: 3978, botium-BotDriver BOTFRAMEWORK_WEBHOOK_PATH: 'api/messages', botium-BotDriver BOTFRAMEWORK_CHANNEL_ID: 'facebook', botium-BotDriver SIMPLEREST_PING_RETRIES: 6, botium-BotDriver SIMPLEREST_PING_TIMEOUT: 10000, botium-BotDriver SIMPLEREST_PING_VERB: 'GET', botium-BotDriver SIMPLEREST_METHOD: 'GET', botium-BotDriver WEBSPEECH_SERVER_PORT: 46050, botium-BotDriver WEBSPEECH_LANGUAGE: 'en-US', botium-BotDriver WEBSPEECH_CLOSEBROWSER: true, botium-BotDriver SCRIPTING_TXT_EOL: '\n', botium-BotDriver SCRIPTING_XLSX_EOL_SPLIT: '\r', botium-BotDriver SCRIPTING_XLSX_EOL_WRITE: '\r\n', botium-BotDriver SCRIPTING_XLSX_STARTROW: 1, botium-BotDriver SCRIPTING_XLSX_STARTCOL: 'A', botium-BotDriver SCRIPTING_NORMALIZE_TEXT: true, botium-BotDriver SCRIPTING_ENABLE_MEMORY: false, botium-BotDriver SCRIPTING_MATCHING_MODE: 'includeLowerCase', botium-BotDriver SCRIPTING_UTTEXPANSION_MODE: 'all', botium-BotDriver SCRIPTING_UTTEXPANSION_RANDOM_COUNT: 1, botium-BotDriver SCRIPTING_UTTEXPANSION_INCOMPREHENSION: 'INCOMPREHENSION', botium-BotDriver ASSERTERS: [], botium-BotDriver LOGIC_HOOKS: [], botium-BotDriver CONTAINERMODE: 'google-actions', botium-BotDriver GOOGLE_ASSISTANT_CLIENT_ID: botium-BotDriver 'redacted', botium-BotDriver GOOGLE_ASSISTANT_CLIENT_SECRET: 'redacted', botium-BotDriver GOOGLE_ASSISTANT_REFRESH_TOKEN: 'redacted', botium-BotDriver GOOGLE_ASSISTANT_TYPE: 'authorized_user', botium-BotDriver GOOGLE_ASSISTANT_START_UTTERANCE: 'Talk to my test app', botium-BotDriver GOOGLE_ASSISTANT_END_UTTERANCE: 'Cancel', botium-BotDriver CONFIG: './botium.json' } +207ms botium-BotDriver Build - Sources : { LOCALPATH: '.', botium-BotDriver GITPATH: 'git', botium-BotDriver GITBRANCH: 'master', botium-BotDriver GITDIR: '.' } +1ms botium-BotDriver Build - Envs : { IS_BOTIUM_CONTAINER: true } +0ms botium-PluginConnectorContainer Loading Botium plugin from google-actions failed - { Error: Cannot find module 'google-actions' botium-PluginConnectorContainer at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) botium-PluginConnectorContainer at Function.Module._load (internal/modules/cjs/loader.js:507:25) botium-PluginConnectorContainer at Module.require (internal/modules/cjs/loader.js:637:17) botium-PluginConnectorContainer at require (internal/modules/cjs/helpers.js:22:18) botium-PluginConnectorContainer at tryLoadPlugin (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/containers/PluginConnectorContainer.js:16:20) botium-PluginConnectorContainer at Validate.Validate.then (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/containers/PluginConnectorContainer.js:45:29) code: 'MODULE_NOT_FOUND' } +0ms botium-PluginConnectorContainer Loading Botium plugin botium-connector-google-actions failed, try "npm install botium-connector-google-actions" - { Error: Cannot find module 'botium-connector-google-actions' botium-PluginConnectorContainer at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) botium-PluginConnectorContainer at Function.Module._load (internal/modules/cjs/loader.js:507:25) botium-PluginConnectorContainer at Module.require (internal/modules/cjs/loader.js:637:17) botium-PluginConnectorContainer at require (internal/modules/cjs/helpers.js:22:18) botium-PluginConnectorContainer at tryLoadPlugin (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/containers/PluginConnectorContainer.js:29:20) botium-PluginConnectorContainer at Validate.Validate.then (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/containers/PluginConnectorContainer.js:45:29) code: 'MODULE_NOT_FOUND' } +0ms botium-BotDriver BotDriver Build error: Error: Loading Botium plugin failed +10ms Error: Loading Botium plugin failed

Re-running npm install botium-connector-google-actions made no difference.

Other behavior:

Please let me know if I'm doing something wrong, I do appreciate your feedback & assistance! Thank you

codeforequity-at commented 5 years ago

hello, in short the documentation is partly wrong, we will fix this. the correct container mode is google-assistant

codeforequity-at commented 5 years ago

Documentation is updated.