Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing Alexa Skill

Testing Alexa Skill

JAWS-UG KOBE Alexa meetup #09

参考資料
- Workshopサンプル・ドキュメント一式
 https://github.com/alexa/skill-sample-nodejs-test-automation
- セッションスライド
 https://www.slideshare.net/AmazonWebServices/alx315test-automation-for-alexa-skills
- Alexa Skills Kit公式ドキュメント
 https://developer.amazon.com/ja/alexa-skills-kit
- 一人Alexa Skills Kit for Node.js Advent Calendar 2017
 https://qiita.com/advent-calendar/2017/alexa-skills-kit-for-nodejs

Hidetaka Okamoto

December 20, 2017
Tweet

More Decks by Hidetaka Okamoto

Other Decks in Technology

Transcript

  1. H i d e t a k a O k

    a m o t o • Digitalcube Co. Ltd. • JAWS-UG Kyoto, Kobe • WordCamp Kyoto 2017
  2. "MFYBEBUBqPX E c h o D e v i c

    e A u t o m a t i c S p e e c h R e c o g n i t i o n R e q u e s t h a n d l e r s AW S L a m b d a N a t u r a l L a n g u a g e U n d e r s t a n d i n g
  3. "MFYBEBUBqPX E c h o D e v i c

    e A u t o m a t i c S p e e c h R e c o g n i t i o n R e q u e s t h a n d l e r s AW S L a m b d a N a t u r a l L a n g u a g e U n d e r s t a n d i n g E c h o S i m . i o AV S A P I
  4. "MFYBEBUBqPX E c h o D e v i c

    e A u t o m a t i c S p e e c h R e c o g n i t i o n R e q u e s t h a n d l e r s AW S L a m b d a N a t u r a l L a n g u a g e U n d e r s t a n d i n g E c h o S i m . i o A S K C L I AV S A P I A S K S M A P I S k i l l S i m u l a t i o n A P I S k i l l I n v o c a t i o n A P I
  5. "MFYBEBUBqPX E c h o D e v i c

    e A u t o m a t i c S p e e c h R e c o g n i t i o n R e q u e s t h a n d l e r s AW S L a m b d a N a t u r a l L a n g u a g e U n d e r s t a n d i n g E c h o S i m . i o A S K C L I S e r v i c e S i m u l a t o r AV S A P I A S K S M A P I S k i l l S i m u l a t i o n A P I S k i l l I n v o c a t i o n A P I
  6. "MFYBEBUBqPX E c h o D e v i c

    e A u t o m a t i c S p e e c h R e c o g n i t i o n R e q u e s t h a n d l e r s AW S L a m b d a N a t u r a l L a n g u a g e U n d e r s t a n d i n g E c h o S i m . i o A S K C L I S e r v i c e S i m u l a t o r U n i t t e s t t o o l s AV S A P I A S K S M A P I S k i l l S i m u l a t i o n A P I S k i l l I n v o c a t i o n A P I U n i t t e s t S D K
  7. "MFYBDPOWFSTBUJPOͷUFTUqPX E c h o D e v i c

    e A u t o m a t i c S p e e c h R e c o g n i t i o n R e q u e s t h a n d l e r s AW S L a m b d a N a t u r a l L a n g u a g e U n d e r s t a n d i n g E c h o S i m . i o A S K C L I S e r v i c e S i m u l a t o r U n i t t e s t t o o l s AV S A P I A S K S M A P I S k i l l S i m u l a t i o n A P I S k i l l I n v o c a t i o n A P I U n i t t e s t S D K
  8. ϓϩδΣΫτͷηοτΞοϓ $ npm init -y $ npm install —save alexa-sdk

    $ npm install --save-dev alexa-conversation mocha
  9. IBOEMFSΛ࣮ߦ͢Δ४උ IUUQTXQLZPUPOFUUFTUCZBMFYBDPOWFSTBUJPO // ϥΠϒϥϦͷಡΈࠐΈ const conversation = require('alexa-conversation') // ςετର৅ͷϑΝΠϧͷಡΈࠐΈ

    const app = require('../index.js') const opts = { name: 'Alexa Sample App', // ςετ໊ʢʣ appId: 'your-app-id', // ΞϓϦIDʢμϛʔͰOK)ʣ app: app, // ςετର৅ handler: app.handler // ࣮ߦ͢ΔϓϩύςΟ }
  10. ςετ͸:".-ϑΝΠϧΛ4ʹઃஔ͢Δܗ IUUQTHJUIVCDPNBMFYBTLJMMTBNQMFOPEFKTUFTUBVUPNBUJPOCMPC NBTUFSTDSJQUTMBCZNM configuration: endpoint: type: InvocationApi region: NA locale:

    en-US GuessFive: &GuessFive - intent: GuessNumber - number: 5 - response.shouldEndSession == false - response.outputSpeech.ssml =~ /.*My number is higher.*/i : <<do something>> Launch: - response.shouldEndSession == false - *GuessFive