bespoken / virtual-alexa

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

Missing support for new built-in intent AMAZON.SelectIntent #115

Open omenocal opened 5 years ago

omenocal commented 5 years ago

Description:

The framework throws an error when trying to use the AMAZON.SelectIntent built-in intent

Environment:

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a test with this intent: reply = await platform.intend('AMAZON.SelectIntent', { ListPosition: '3' });

Expected behavior

virtual-alexa should return an intent request for AMAZON.SelectIntent with the slot value I defined in the slots. It could be one of the 4 intents allowed

Actual behavior

It returns the following error: Error: Trying to add slot to intent that does not have any slots defined

Code example

reply = await platform.intend('AMAZON.SelectIntent', { ListPosition: '3' });
jkelvie commented 5 years ago

Hi Octavio, we are looking to add support for this in our upcoming development. In the meantime, you can work around this by using our request object. It works like this:

const request = alexa.request()
    .intent("MyIntentName")
    // Directly set any property on the JSON easily with the new set method
    .set("request.intent.slots.ListPosition", {
          "name": "ListPosition",
          "value": "5",
          "confirmationStatus": "NONE"
      });
const response = await request.send();

Additional info on the skill request object is here: https://bespoken.github.io/virtual-alexa/api/classes/skillrequest.html

Using the set method you can essentially manipulate the JSON as needed. Not an ideal solution, but should get you past this error message.

We are keeping this issue open for scheduling in an upcoming sprint.

omenocal commented 5 years ago

Thanks @jkelvie I was able to use it that way exactly. Sorry for not posting it before!

btburton42 commented 3 years ago

Hi @jkelvie @dmarvp any updates on a timeline for this enhancement? We are automating a testing solution and having the simpler .intend command would be nice (and much less work).

jkelvie commented 3 years ago

Hi Tyler, we do not have a current timeline for this - I would recommend the workaround as mentioned above, imperfect though it may be.

btburton42 commented 3 years ago

@jkelvie thanks for the reply! I really appreciate it.