{"id":15524355,"url":"https://github.com/codeforequity-at/botium-connector-google-assistant","last_synced_at":"2025-04-23T07:31:37.469Z","repository":{"id":91176425,"uuid":"166011563","full_name":"codeforequity-at/botium-connector-google-assistant","owner":"codeforequity-at","description":"Botium Connector for Google Assistant","archived":false,"fork":false,"pushed_at":"2021-02-13T16:45:02.000Z","size":174,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T02:06:47.170Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.botium.at","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeforequity-at.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-16T09:24:49.000Z","updated_at":"2021-02-13T16:44:19.000Z","dependencies_parsed_at":"2023-06-29T14:50:28.256Z","dependency_job_id":null,"html_url":"https://github.com/codeforequity-at/botium-connector-google-assistant","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-google-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-google-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-google-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-google-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeforequity-at","download_url":"https://codeload.github.com/codeforequity-at/botium-connector-google-assistant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250391298,"owners_count":21422876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T10:51:03.779Z","updated_at":"2025-04-23T07:31:37.457Z","avatar_url":"https://github.com/codeforequity-at.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Botium Connector for Google Assistant\n\n[![NPM](https://nodei.co/npm/botium-connector-google-assistant.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/botium-connector-google-assistant/)\n\n[![Codeship Status for codeforequity-at/botium-connector-google-assistant](https://app.codeship.com/projects/593ff3f0-0215-0137-a1db-3a97ab62e3ba/status?branch=master)](https://app.codeship.com/projects/324985)\n[![npm version](https://badge.fury.io/js/botium-connector-google-assistant.svg)](https://badge.fury.io/js/botium-connector-google-assistant)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\n\nThis is a [Botium](https://github.com/codeforequity-at/botium-core) connector for testing your Action in Google Assistant.\n\n__Did you read the [Botium in a Nutshell](https://medium.com/@floriantreml/botium-in-a-nutshell-part-1-overview-f8d0ceaf8fb4) articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!__\n\n## How it works ?\nBotium registers itself with the [Google Assistant SDK](https://developers.google.com/assistant/sdk/overview) as \"virtual device\" to talk to your Google Action.\n\n**IMPORTANT: The Google Assistant SDK this Botium connector is buildling upon is currently in ALPHA state and not considered to be ready for production use**\n\nIt can be used as any other Botium connector with all Botium Stack components:\n* [Botium CLI](https://github.com/codeforequity-at/botium-cli/)\n* [Botium Bindings](https://github.com/codeforequity-at/botium-bindings/)\n* [Botium Box](https://www.botium.at)\n\n## Requirements\n* **Node.js and NPM**\n* a **Google Action**, and user account with administrative rights\n* a **project directory** on your workstation to hold test cases and Botium configuration\n\n## Features\n### Requests\n* Sending button click event\n```\n#me\nBUTTON yes\n```\n### [Botium Asserters](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/2293815/Botium+Asserters) to check response \n* Text asserting\n* Button asserting (for [Suggestion Chips](https://developers.google.com/assistant/conversational/responses#suggestion_chips), for [Link Out Suggestion](https://developers.google.com/assistant/conversational/reference/rest/Shared.Types/AppResponse#linkoutsuggestion), and for buttons of complex UI elements)\n```\n#bot\nBUTTONS yes|no|cancel\n```\n* Media asserting (for [Media Responses](https://developers.google.com/assistant/conversational/responses#media_responses), and for image/media of complex UI elements)\n ```\n#bot\nMEDIA https://www.botium.at/images/logo.png\n```\n* SSML asserting\n```\n#bot\n\u003cspeak\u003eHello \u003cbreak time='300ms'/\u003e World\u003c/speak\u003e\n```\n* Card asserting. For Basic Card, Carousel, Browse Carousel, List, and Table components. With list you can assert title too\n ```\n#bot\nTitle of List\nCARDS First|Second\n```\n\n* Asserting response containing more UI elements. For example Media Response is not a standalone UI element, works just with Simple Response, and Suggestion Chips.\n They can be asserted together:\n ```\n#bot\nsimple response\nMEDIA https://www.botium.at/images/logo.png\nBUTTONS button1|button2\n```\n\n### Account linking\n* You can test your action with non-linked user without any change\n* If you invoke the account linking process with this non-linked user, nothing happens. You got empty message return, and the account wont be linked\n* If you perm account linking in Actions console simulator, then you will get a linked user\n* Tested just on [Account linking with Google Sign-In](https://developers.google.com/actions/identity/google-sign-in)\n* You can see account linking on https://myaccount.google.com/permissions\n\n## Install Botium and Google Assistant Connector\n\nWhen using __Botium CLI__:\n\n```\n\u003e npm install -g botium-cli\n\u003e npm install -g botium-connector-google-assistant\n\u003e botium-cli init\n\u003e botium-cli run\n```\n\nWhen using __Botium Bindings__:\n\n```\n\u003e npm install -g botium-bindings\n\u003e npm install -g botium-connector-google-assistant\n\u003e botium-bindings init mocha\n\u003e npm install \u0026\u0026 npm run mocha\n```\n\nWhen using __Botium Box__:\n\n_Already integrated into Botium Box, no setup required_\n\n## Connecting Google Assistant SDK to Botium\n\n### 1. Prepare googleConfig.json (Google credentials)\n\n* Configure an Actions Console project (See [here](https://developers.google.com/assistant/sdk/guides/service/python/embed/config-dev-project-and-account)) or open an existing one\n* If your Action is not yet live, [enable device testing in the Actions Console](https://developers.google.com/assistant/smarthome/develop/testing#setup) to test it with Botium\n* Register a Device Model (See [here](https://developers.google.com/assistant/sdk/guides/service/python/embed/register-device)) and download the OAuth 2.0 credentials file\n    * Rename the file to _googleConfig.json_\n    * You can download the credentials [here](https://console.developers.google.com/apis/credentials) as well\n    * If you dont see device registrations while configuring your action, then check [this](https://stackoverflow.com/questions/50313261/actions-on-google-not-showing-device-registration-option) or [this](https://github.com/actions-on-google/actions-on-google-testing-nodejs/issues/4)\n\n### 2. Run the \"Botium Connector Google Actions Initialization Tool\"\n\nThe connector repository includes a tool to compose the Botium capabilities (including private keys, access tokens etc). Create a project directory of your choice, and follow the steps below.\n\nThere are several ways of running this tool, depending on how you installed it:\n\nWhen you are using the Botium CLI, then just run\n```\n\u003e botium-cli init-google-assistant\n```\n\nWhen you installed the NPM package for this repository, then run\n```\n\u003e npx botium-connector-google-assistant-init\n```\n\nWhen you cloned or downloaded this repository, and you are in the _samples/convo_ folder, then run\n```\n\u003e npm run init-google\nor\n\u003e npx botium-connector-google-assistant-init\n```\n\nFollow the suggested steps:\n* you will be asked for location of the downloaded credential file\n* you will be presented a hyperlink you have to open in your browser to connect your Action to your Google account. You have to use the same Google account as for developing the action if action is not published yet.\n* you will be asked for start utterance, which activates(launches) your action. It is the same what you can see on Actions console simulator (_https://console.actions.google.com/project/YOURPROJECTID/simulator_).\n* and stop utterance, which deactivates your action.\n\n### 3. Use the generated botium.json\nA file named botium.json is generated containing the required capabilities to be used with Botium.\n\nTo check the configuration, run the emulator (Botium CLI required) to bring up a chat interface in your terminal window:\n\n```\n\u003e botium-cli emulator\n```\n\nBotium setup is ready, you can begin to write your [BotiumScript](https://github.com/codeforequity-at/botium-core/wiki/Botium-Scripting) files.\n\n## How to start sample\n\nThere is a small tech demo in [samples/convo](./samples/convo) with Botium Bindings. You can see there how to deal with different UI elements.\n\nBefore start create botium.json, and use [this](./samples/convo/connectortesttarget.zip) as Dialogflow project.\n\nStart the test with:\n\n    \u003e npm install\n    \u003e npm test\n\n## Setting Location for Test Cases\n\nEither set global with capabilities _GOOGLE_ASSISTANT_LOCATION_LATITUDE_ and _GOOGLE_ASSISTANT_LOCATION_LONGITUDE_ (see below).\n\nOr with the _UPDATE_CUSTOM_ logic hook in BotiumScript:\n\n\n```\nlocation\n\n#begin\nUPDATE_CUSTOM LOCATION|LATITUDE|48.210033\nUPDATE_CUSTOM LOCATION|LONGITUDE|16.363449\n\n#me\nhi\n\n#bot\n...\n```\n\nOr for individual conversation steps (if this makes sense at all to switch location within a conversation ...):\n\n```\nlocation\n\n#me\nhi\nUPDATE_CUSTOM LOCATION|LATITUDE|48.210033\nUPDATE_CUSTOM LOCATION|LONGITUDE|16.363449\n\n#bot\n...\n```\n\n## Supported Capabilities\n\nSet the capability __CONTAINERMODE__ to __google-assistant__ to activate this connector.\n\n### GOOGLE_ASSISTANT_CLIENT_ID\nSee downloaded credential file\n\n### GOOGLE_ASSISTANT_CLIENT_SECRET\nSee downloaded credential file\n\n### GOOGLE_ASSISTANT_REFRESH_TOKEN\nThe simpliest way to acquire it, is the initialization tool described above\n\n### GOOGLE_ASSISTANT_TYPE\nSet it to \"authorized_user\"\n\n### GOOGLE_ASSISTANT_START_UTTERANCE\nIf you want Botium to launch your own Google Action before starting a test case. It is something like \"Talk to my test app\" if the name of your app is \"my test app\", which is the default value.\n\n### GOOGLE_ASSISTANT_END_UTTERANCE\nUse \"Cancel\"\n\n### GOOGLE_ASSISTANT_LOCATION_LATITUDE\nLocation latitude\n\n### GOOGLE_ASSISTANT_LOCATION_LONGITUDE\nLocation longitude\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforequity-at%2Fbotium-connector-google-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeforequity-at%2Fbotium-connector-google-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforequity-at%2Fbotium-connector-google-assistant/lists"}