GithubHelp home page GithubHelp logo

mridulkabra / virtual-device-example Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 30 KB

This project aims to serve as an example and provides a template to start creating YAML test scripts for end-to-end testing Alexa skills.

Home Page: https://bespoken.io

virtual-device-example's Introduction

Bespoken Virtual Device: YAML Test Scripts Demo

The Virtual Device Test Scripts are meant to make it easy for anyone to write automated tests for Alexa (and Google Assistant, soon).

They use a simple YAML syntax for allowing anyone to write complex (but still readable) end-to-end tests.

Setup

Install Bespoken Virtual Device

Make sure you have npm installed, get it here.

Install Bespoken CLI to run the scripts. Open a command-line and run this command:

npm install bespoken-tools@beta -g

Get your Virtual Device Token

First, you need to get a token. See here for instructions.

Configure your test scripts:

Each test script contains the token for each locale and other important parameters. We have included our tokens on each test script file in this repo so you can run them and see them in action. You should add your tokens when creating your own test scripts.

FYI - the included tokens are so that new users can get started quickly. However, they are common tokens and will NOT work as reliably as creating your own. Please follow the steps above to create your own Virtual Device Tokens.

  • Within your test script add a configuration section like the example shown below.
  • Add the locale for the test script, the Amazon Polly voiceId you wish to use and the Virtual Device token.
---
configuration:
  locale: en-US
  voiceId: Joey
  virtualDeviceToken: f7e91d64-0477-427c-95b6-15cade37a323

Additional parameters

You will notice there is a file named skill-testing.json in the sample project. This file contains extra configuration parameters like these:

{
  "invoker": "VirtualDeviceInvoker",
  "homophones": {
    "lettuce": ["let us"],
    "figs": ["six","6","vicks"]
  },
  "trace": false,
  "jest": {
    "silent": true
  }
}
  • Homophones: Use this to specify words with similar sound, for example if you receive "let us" instead of "lettuce" or "six" instead of "figs".
  • Trace and silent: Both parameters allows you to get extra information from the response payload, to enable set trace to true and silent to false.

Running tests

Once you have created your tests, you can run a particular file by entering:

bst test test-directory\my-test-file.yml

To run a directory containing many tests, provide the directory path instead:

bst test test-directory

That command will run all yml files that are contained within that directory.

That's it! Now just wait, and your tests will run.

More Info and Docs

See the full docs for the test scripts here.

Questions/Feedback?

Help is only a few clicks away. Have questions or feedback? Email us at [email protected] or [email protected]

virtual-device-example's People

Contributors

ig-perez avatar jkelvie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.