bespoken / virtual-alexa

:robot: Easily test and debug Alexa skills programmatically
https://bespoken.io
Apache License 2.0
112 stars 35 forks source link

Do you interest to support Amazon Presentation Language? #107

Closed ysak-y closed 5 years ago

ysak-y commented 5 years ago

Overview

If I try to implement tests with Amazon Presentation Language, I can't because of this test libraries interface. supportedInterface property is built in Device class, but there are no method to set Alexa.Presentation.APL.RenderDocument directive. And I can't access setter for supportedInterface (I think it's correct design but I'm worried because of this design).

What do you think to support Amazon Presentation Language testing? If you interest, I'll implement about that and send PR.

jkelvie commented 5 years ago

Hi @ysak-y - this is a great question - we would like to improve our support for the APL.

It is possible to write tests for it, though, with the current version of the library. To write a test using our new request builder, you can just say:

const response= await alexa.request()
    .intent("MyIntentName")
    .set("context.Systemdevice.supportedInterfaces", ["Alexa.Presentation.APL"])
    .send();

You can also set the JSON manually using our filters: https://github.com/bespoken/virtual-alexa/blob/master/docs/Filters.md

I hope that helps - for better support, we are thinking to add a flag to our device class, APLSupported. That class is here: https://bespoken.github.io/virtual-alexa/api/classes/device.html

ysak-y commented 5 years ago

Okay, thanks!