Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

TomerFi/alexa-skills-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Skills Tester is Archived

OLD README

Testing tools for Java Alexa skills

Want to test your Alexa skills with real requests?
No deploying, hosting, or configuring the skill interface is required!
All you need is your Java skill and this tool.

  graph
    givenSkill -- load the skill code --> whenRequestIs
    whenRequestIs -- load a json request --> thenResponseShould
    thenResponseShould -- use assertion methods to verify the response --> thenResponseShould
    thenResponseShould -. use for multi-step interactions .-> followingUpWith
    followingUpWith -- load a followup json request --> thenResponseShould
Loading

Wiki Javadoc Blog Alexa Ref.
Example
integration test
Example
shabbat times skill






Dependency Declaration

<dependency>
  <groupId>info.tomfi.alexa</groupId>
  <artifactId>alexa-skills-tester</artifactId>
  <version>0.2.15</version>
  <scope>test</scope>
</dependency>

Usage Example

givenSkill(myCustomSkill) // load your custom skill
    .whenRequestIs(launchRequestJson) // load a request, takes json or envelopes
    .thenResponseShould() // send the request to the skill and verify the response
        .waitForFollowup() // verify the session is open, the skill is waiting for a followup
        .haveOutputSpeechOf("What is your name?") // verify the response speech output
        .haveRepromptSpeechOf("Please tell me your name.") // verify the response reprompt speech
    .followingUpWith(myNameIntentJson) // load a followup request
    .thenResponseShould() // send the request to the skill and verify the response
        .haveOutputSpeechOf("Nice to meet you omer!") // verify the response speech output
        .and() // just a sugar method for readability
        .notWaitForFollowup(); // verify the session is closed, the skill not waiting for a followup

You can add as many followingUpWith(x).thenResponseShould() as you need.

Disclaimer

This repository and/or the tool deployed with its sources has no direct relation with Amazon.
This an open-source tool based on the documentation for Alexa developers.