How to test Alexa Skills Color Example end-to-end with Lambda Test button?
I can build the colors test and run it on my Echo device. It also tests ok from within the Lambda function using the sample event template: "Alexa Intent - MyColorIs" to invoke a new session welcoming me to color test with help. I can alter that template to send a "WhatsMyColorIntent" to return: "SessionSpeechlet - I'm not sure what your favorite color is, you can say, my favorite color is red" How would I combine a test call to declare my favorite color and then return said favorite color? Thanks, Jim
You can't do that as a single request because it's not a single request. The Intent to declaring your favorite color should return some sessionAttributes to the Echo. Then when you ask for your favorite color, those same attributes will be send in the request. So if you want to test that second intent, the one where it uses what you delcared and tells you what it is, you'll need to include said attributes in your request. But long term, you should be doing all of your testing before you ever get it up on Lambda, using some sort of testing framework like Mocha. It will save you a ton of grief.
Thank you for your reply. Makes sense and not a surprise. I see that I need to send attributes but now having trouble forming them. I know this is a newbie question but any help with example attribute clause for, say, color=purple? I've tried quite a few guesses and cannot find any actual examples of how to do this. Which leads me to another question... Any simple supported way to view actual JSON text of what Alexa sends to Lambda? Thanks again.