alexa-js / alexa-app-server

An Alexa app server for alexa-app.
MIT License
402 stars 116 forks source link

How to test Alexa Skills with Mocha or other Framework and alexa-app/-server #91

Open natterstefan opened 7 years ago

natterstefan commented 7 years ago

Hello,

I really like the alexa-app and alexa-app-server environment and tools. They enable me to create Alexa-Skills easily. But what I am not sure of (didn't find something on the Internet so far or must have missed it) how I can test the Skill-Intents with eg. Mocha and Chai? It easy to open the Skill in the Browser, see the response and everything there, but it is not scalable. Is it?

Or how can I test multiple slot-values (eg wrong, valid or empty) against multiple Intents?

I am thinking about something like this example: Alexa Skill Test Framework from BrianMacIntosh. Or how do you test your skills within this setup? Am I looking in the wrong direction?

Thank you for your help guys.

ericblade commented 7 years ago

that test framework that you've located looks like it was built to use the official SDK, which this is not directly compatible with. Might be possible to shim it to fit by creating a handler() function that digs into the alexa app object and calls the right intent. Otherwise, I'm not aware of any particular methods for testing the actual skills like that. Other people here might have some good ideas, though.

natterstefan commented 7 years ago

Thanks for your feedback @ericblade. That is what I thought too, but I am not capable of doing this right now.

How do you test your skills?

dblock commented 7 years ago

Check out https://github.com/artsy/elderfield/tree/master/test for an example. I'll leave this open, maybe someone can contribute a README section on testing?

tejashah88 commented 5 years ago

@natterstefan You might want to check out the node-alexa-smapi module if you want to test your Alexa skills with simulated requests.