From ae270e1eaf5e47341199967472af3fc31d3af458 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 11 May 2018 11:57:50 -0500 Subject: [PATCH 01/11] First script for skill-tester 0.2.0 --- .gitignore | 5 ++++- lambda/custom/package-lock.json | 18 +++++++++++++++++ skill-testing.json | 10 ++++++++++ test/en-US.yml | 34 +++++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 lambda/custom/package-lock.json create mode 100644 skill-testing.json create mode 100644 test/en-US.yml diff --git a/.gitignore b/.gitignore index 7a5f6c5..cf0b893 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# No Webstorm files +/.idea + # Logs logs *.log @@ -58,4 +61,4 @@ typings/ .env -.DS_Store \ No newline at end of file +.DS_Store diff --git a/lambda/custom/package-lock.json b/lambda/custom/package-lock.json new file mode 100644 index 0000000..bc33ff5 --- /dev/null +++ b/lambda/custom/package-lock.json @@ -0,0 +1,18 @@ +{ + "name": "Pet-Match", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ask-sdk-core": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/ask-sdk-core/-/ask-sdk-core-2.0.3.tgz", + "integrity": "sha512-V4FJeKFlDtJnAMz7p2CrAr/Qefz4fV0bifZ7biHJOThPLMApkv0igfQIOtEyTZL7wzq91FT7lNMJZuwi+C8Cvg==" + }, + "ask-sdk-model": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ask-sdk-model/-/ask-sdk-model-1.2.0.tgz", + "integrity": "sha512-GD9WwIq8c5fparwZOQm2IxboDu5cs6JMsgFISQIVUNmCdnprxr5PgaQMA55JOGs94bwIEJ6gc8i1mVyfFX75Vw==" + } + } +} diff --git a/skill-testing.json b/skill-testing.json new file mode 100644 index 0000000..ae6079e --- /dev/null +++ b/skill-testing.json @@ -0,0 +1,10 @@ +{ + "handler": "lambda/custom/index.js", + "locale": "en-US", + "jest": { + "silent": true, + "coveragePathIgnorePatterns": [ + "/analytics" + ] + } +} \ No newline at end of file diff --git a/test/en-US.yml b/test/en-US.yml new file mode 100644 index 0000000..1a1da8c --- /dev/null +++ b/test/en-US.yml @@ -0,0 +1,34 @@ +#===================================================================================================================== +# ██████╗ ███████╗███████╗██████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ +# ██╔══██╗██╔════╝██╔════╝██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ +# ██████╔╝█████╗ ███████╗██████╔╝██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ +# ██╔══██╗██╔══╝ ╚════██║██╔═══╝ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ +# ██████╔╝███████╗███████║██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ +# ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ +# +# Test type: Functional/End-to-End/Regression +# Skill name: "Pet Match" by Amazon +# Test scope: LaunchRequest, PetMatchIntent, AMAZON.HelpIntent, AMAZON.StopIntent, AMAZON.CancelIntent +#===================================================================================================================== + +--- +configuration: + locale:en-US + +--- +- test: "Sequence 01. Test scenario: launch request, no further interaction." +- LaunchRequest: + - response.outputSpeech.ssml: "/welcome to pet match.*/i" + - response.reprompt.outputSpeech.ssml: "/what size and temperament are you looking for in a dog.*/i" + - response.shouldEndSession: "false" + - response.card: "undefined" + +--- +- test: "Sequence 02. Test scenario: Invoke PetMatchIntent with different utterances." +- "ask pet match to find a pet": + - response.directives.updatedIntent.name: "PetMatchIntent" + - response.directives.updatedIntent.confirmationStatus: "NONE" + - response.outputSpeech.ssml: "/there are dogs that are tiny, small, medium, and large.*/i" + - response.outputSpeech.ssml: "/what size of a dog would you like.*/i" +- "stop": + - response.outputSpeech.ssml: "/bye.*/i" \ No newline at end of file From a181f6dd4f01ecc8a9c7590fa5633de881978668 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 16 May 2018 16:45:30 -0500 Subject: [PATCH 02/11] First complete draft for skill-tester 0.3.0-2 --- lambda/custom/package-lock.json | 18 ---- test/en-US.yml | 147 +++++++++++++++++++++++++++++--- 2 files changed, 136 insertions(+), 29 deletions(-) delete mode 100644 lambda/custom/package-lock.json diff --git a/lambda/custom/package-lock.json b/lambda/custom/package-lock.json deleted file mode 100644 index bc33ff5..0000000 --- a/lambda/custom/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "Pet-Match", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ask-sdk-core": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/ask-sdk-core/-/ask-sdk-core-2.0.3.tgz", - "integrity": "sha512-V4FJeKFlDtJnAMz7p2CrAr/Qefz4fV0bifZ7biHJOThPLMApkv0igfQIOtEyTZL7wzq91FT7lNMJZuwi+C8Cvg==" - }, - "ask-sdk-model": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ask-sdk-model/-/ask-sdk-model-1.2.0.tgz", - "integrity": "sha512-GD9WwIq8c5fparwZOQm2IxboDu5cs6JMsgFISQIVUNmCdnprxr5PgaQMA55JOGs94bwIEJ6gc8i1mVyfFX75Vw==" - } - } -} diff --git a/test/en-US.yml b/test/en-US.yml index 1a1da8c..376c194 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -11,24 +11,149 @@ # Test scope: LaunchRequest, PetMatchIntent, AMAZON.HelpIntent, AMAZON.StopIntent, AMAZON.CancelIntent #===================================================================================================================== +# TO BE COMPLETED: +# =============== +# I'm using interaction model starting with languageModel (WIP for interactionModel) +# Multiple valid responses for prompt +# Stop intent not working, it matches the PetMatchIntent, perhaps same when saying exit in fact skill + --- configuration: - locale:en-US + locale: en-US --- - test: "Sequence 01. Test scenario: launch request, no further interaction." - LaunchRequest: - - response.outputSpeech.ssml: "/welcome to pet match.*/i" - - response.reprompt.outputSpeech.ssml: "/what size and temperament are you looking for in a dog.*/i" - - response.shouldEndSession: "false" - - response.card: "undefined" + - response.outputSpeech.ssml: /welcome to pet match.*/i + - response.reprompt.outputSpeech.ssml: /what size and temperament are you looking for in a dog.*/i + - response.shouldEndSession: false + - response.card: undefined --- -- test: "Sequence 02. Test scenario: Invoke PetMatchIntent with different utterances." +- test: "Sequence 02. Test scenario: Invoke PetMatchIntent with different utterances. Focus on dialog management." - "ask pet match to find a pet": - - response.directives.updatedIntent.name: "PetMatchIntent" - - response.directives.updatedIntent.confirmationStatus: "NONE" - - response.outputSpeech.ssml: "/there are dogs that are tiny, small, medium, and large.*/i" - - response.outputSpeech.ssml: "/what size of a dog would you like.*/i" + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i - "stop": - - response.outputSpeech.ssml: "/bye.*/i" \ No newline at end of file + - prompt: "Bye" + +- "ask pet match to match me": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- stop: "Bye" + +- "ask pet match small dog": + - prompt: + - /would you prefer a dog to hang out with kids or to protect you.*/i + - /are you looking for more of a family dog or a guard dog.*/i + - slots.size.value: "small" # like this? + - slots: # or like this? + - pet: "dog" +- stop: "Bye" + +- "ask pet match for a dog": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i + - slots.pet.value: "dog" # Need verification +- stop: "Bye" + +# It seems there are problems with the entity resolution for I_Want slot +# should ask for size. It works repeating the utterance with "i want" or "i prefer" +- "tell pet match i like a dog that is protective and that i can run with": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i + - response.directives.updatedIntent.slots.I_Want.value: /i like.*/i + - response.directives.updatedIntent.slots.article.value: "a" + - response.directives.updatedIntent.slots.pet.value: "dog" + - response.directives.updatedIntent.slots.temperament.value: "protective" + - response.directives.updatedIntent.slots.energy.value: "that I can run with" +- stop: "Bye" + +# not sure about the correct behaviour of the skill here, need review +- "tell pet match i like a dog that is more than 20 kilograms": "*" +- "ask pet match for a long hair large puppy": "*" +- "ask pet match for a small hypoallergenic doggie": "*" +- "tell pet match i want a canis that's over 70 inches tall": "*" + +# starting deeper interactions. Might want to add slot values for dialog manager? +- "tell pet match i want to go hiking at the mountains": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- small: + - prompt: + - "are you looking for more of a family dog or a guard dog" + - "would you prefer a dog to hang out with kids or to protect you" +- "guard dog": "so a small guard high energy dog sounds good for you consider a toy fox terrier" + +- "ask pet match for a lazy puppy": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- medium: + - prompt: + - "are you looking for more of a family dog or a guard dog" + - "would you prefer a dog to hang out with kids or to protect you" +- "family dog": "so a medium family low energy dog sounds good for you consider a greyhound" + +- "tell pet match i want a hike canine": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i + - large: + - prompt: + - "are you looking for more of a family dog or a guard dog" + - "would you prefer a dog to hang out with kids or to protect you" +- "to protect me": "so a large guard high energy dog sounds good for you consider a doverman pinscher" + +- "tell pet match i want a good with kids dog that is lazy": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- small: /so a small family low energy dog sounds good for you consider a bolognese.*/i + +--- +- test: "Sequence 03. Test scenario: Focus on synonyms" +- "tell pet match i prefer a doggie that is protective and energetic": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- yippi: "so a tiny guard high energy dog sounds good for you consider a chihuahua" + +- "tell pet match let's find a puppy that barks at people and fun to play with": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- little: "*" # not sure the skill is working properly here + +- "tell pet match my favorite is a canis that is adult and plays frisbee": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- "up to my knees": "i am sorry i could not find a match for a medium watch high dog" + +- "tell pet match i want a canine that is gentle with kids and to watch netflix with": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- gigantic: "so a large family low energy dog sounds good for you consider a great dane" + +--- +- test: "Sequence 04. Test scenario: Focus on entity resolution" +- "tell pet match i want a good with kids dog that is lazy": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- mini: "which would you like small or tiny" +- "small": "so a small family low energy dog sounds good for you consider a bolognese" + +- "tell pet match i want a good with kids dog that is lazy": + - prompt: + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i +- mini: "which would you like small or tiny" +- "tiny": "i am sorry i could not find a match for a tiny family low dog" \ No newline at end of file From 1f38e9d31a49cd62286b34a40b035916f15322df Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Thu, 17 May 2018 11:34:46 -0500 Subject: [PATCH 03/11] Adding help and cancel intents. Corrections for skill-tester v0.3.2 --- test/en-US.yml | 49 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/test/en-US.yml b/test/en-US.yml index 376c194..0fdae4e 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -14,8 +14,7 @@ # TO BE COMPLETED: # =============== # I'm using interaction model starting with languageModel (WIP for interactionModel) -# Multiple valid responses for prompt -# Stop intent not working, it matches the PetMatchIntent, perhaps same when saying exit in fact skill +# Stop, help, cancel intents not working, it matches the PetMatchIntent, perhaps same when saying exit in fact skill --- configuration: @@ -46,18 +45,19 @@ configuration: - "ask pet match small dog": - prompt: - - /would you prefer a dog to hang out with kids or to protect you.*/i - - /are you looking for more of a family dog or a guard dog.*/i - - slots.size.value: "small" # like this? - - slots: # or like this? + - /there are dogs that are tiny, small, medium, and large.*/i + - /what size of a dog would you like.*/i + - slots: - pet: "dog" + - size: "small" - stop: "Bye" - "ask pet match for a dog": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - - slots.pet.value: "dog" # Need verification + - slots: + - pet: "dog" - stop: "Bye" # It seems there are problems with the entity resolution for I_Want slot @@ -66,11 +66,12 @@ configuration: - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - - response.directives.updatedIntent.slots.I_Want.value: /i like.*/i - - response.directives.updatedIntent.slots.article.value: "a" - - response.directives.updatedIntent.slots.pet.value: "dog" - - response.directives.updatedIntent.slots.temperament.value: "protective" - - response.directives.updatedIntent.slots.energy.value: "that I can run with" + - slots: + - pet: "dog" + - article: "a" + - I_Want: /i like.*/i + - temperament: "protective" + - energy: "that I can run with" - stop: "Bye" # not sure about the correct behaviour of the skill here, need review @@ -104,7 +105,7 @@ configuration: - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - - large: +- large: - prompt: - "are you looking for more of a family dog or a guard dog" - "would you prefer a dog to hang out with kids or to protect you" @@ -156,4 +157,24 @@ configuration: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - mini: "which would you like small or tiny" -- "tiny": "i am sorry i could not find a match for a tiny family low dog" \ No newline at end of file +- "tiny": "i am sorry i could not find a match for a tiny family low dog" + +--- +- test: "Sequence 05. Test scenario: AMAZON.HelpIntent. Ask for help and exit" +- LaunchRequest: +- help: + - response.outputSpeech.ssml: /.*i can help you find the perfect pet for you you can say i want a dog.*/i + - response.reprompt.outputSpeech.ssml: /would you like a career or do you want to be a couch potato.*/i + - response.shouldEndSession: false + - response.card: undefined +- stop: "Bye" + +--- +- test: "Sequence 06. Test scenario: AMAZON.StopIntent and AMAZON.CancelIntent" +- LaunchRequest: +- stop: + - response.outputSpeech.ssml: "Bye" + +- LaunchRequest: +- cancel: + - response.outputSpeech.ssml: "Bye" \ No newline at end of file From 22b78ac74e1037d8c4e2bbb3b87f55f75169b4f5 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 23 May 2018 13:15:31 -0500 Subject: [PATCH 04/11] Updating sequence 2 tests, trying intent and slot properties for Seq2-12 (not yet working). Corrections for skill-tester v0.3.2 --- test/en-US.yml | 73 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-) diff --git a/test/en-US.yml b/test/en-US.yml index 0fdae4e..cc8ba04 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -28,8 +28,10 @@ configuration: - response.shouldEndSession: false - response.card: undefined + +# Sequence group 02. Test scenario: Invoke PetMatchIntent with different utterances. Focus on dialog management. --- -- test: "Sequence 02. Test scenario: Invoke PetMatchIntent with different utterances. Focus on dialog management." +- test: "Sequence 02-01. Test scenario: simple utterance, no slot value provided." - "ask pet match to find a pet": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -37,12 +39,16 @@ configuration: - "stop": - prompt: "Bye" +--- +- test: "Sequence 02-02. Test scenario: simple utterance, no slot value provided." - "ask pet match to match me": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - stop: "Bye" +--- +- test: "Sequence 02-03. Test scenario: {size} and {pet} slot values provided on the utterance." - "ask pet match small dog": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -52,6 +58,8 @@ configuration: - size: "small" - stop: "Bye" +--- +- test: "Sequence 02-04. Test scenario: {pet} slot value provided on the utterance. " - "ask pet match for a dog": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -62,6 +70,8 @@ configuration: # It seems there are problems with the entity resolution for I_Want slot # should ask for size. It works repeating the utterance with "i want" or "i prefer" +--- +- test: "Sequence 02-05. Test scenario: {I_Want}, {article}, {pet}, {temperament} and {energy} slot values provided." - "tell pet match i like a dog that is protective and that i can run with": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -75,13 +85,26 @@ configuration: - stop: "Bye" # not sure about the correct behaviour of the skill here, need review +--- +- test: "Sequence 02-06. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." - "tell pet match i like a dog that is more than 20 kilograms": "*" + +--- +- test: "Sequence 02-07. Test scenario: {article}, {shedding}, {size} and {pet} slot values provided." - "ask pet match for a long hair large puppy": "*" + +--- +- test: "Sequence 02-08. Test scenario: {article}, {size}, {shedding} and {pet} slot values provided." - "ask pet match for a small hypoallergenic doggie": "*" + +--- +- test: "Sequence 02-09. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." - "tell pet match i want a canis that's over 70 inches tall": "*" # starting deeper interactions. Might want to add slot values for dialog manager? -- "tell pet match i want to go hiking at the mountains": +--- +- test: "Sequence 02-10. Test scenario: {I_Want}, {energy}, {at_the} and {location} slot values provided." +- "tell pet match i prefer to go hiking at the mountains": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i @@ -89,8 +112,19 @@ configuration: - prompt: - "are you looking for more of a family dog or a guard dog" - "would you prefer a dog to hang out with kids or to protect you" -- "guard dog": "so a small guard high energy dog sounds good for you consider a toy fox terrier" +- "guard dog": + - prompt: "so a small guard high energy dog sounds good for you consider a toy fox terrier" + - slots: + - at_the: "at the" + - pet: "dog" + - size: "small" + - I_Want: /i prefer.*/i + - temperament: "guard" + - energy: "go hiking" + - location: "mountains" +--- +- test: "Sequence 02-11. Test scenario: {energy} and {pet} slot values provided." - "ask pet match for a lazy puppy": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -101,7 +135,15 @@ configuration: - "would you prefer a dog to hang out with kids or to protect you" - "family dog": "so a medium family low energy dog sounds good for you consider a greyhound" +--- +- test: "Sequence 02-12. Test scenario: {I_Want}, {article}, {energy} and {pet} slot values provided." - "tell pet match i want a hike canine": + - intent: "PetMatchIntent" + - slots: + - I_Want: "i want" + - article: "a" + - energy: "hike" + - pet: "canine" - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i @@ -111,40 +153,52 @@ configuration: - "would you prefer a dog to hang out with kids or to protect you" - "to protect me": "so a large guard high energy dog sounds good for you consider a doverman pinscher" +--- +- test: "Sequence 02-13. Test scenario: {I_Want}, {article}, {temperament} and {energy} slot values provided." - "tell pet match i want a good with kids dog that is lazy": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - small: /so a small family low energy dog sounds good for you consider a bolognese.*/i + +# Sequence 03. Test scenario: Focus on synonyms --- -- test: "Sequence 03. Test scenario: Focus on synonyms" +- test: "Sequence 03-01. Test scenario: Doggie and yippi." - "tell pet match i prefer a doggie that is protective and energetic": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - yippi: "so a tiny guard high energy dog sounds good for you consider a chihuahua" +--- +- test: "Sequence 03-02. Test scenario: Puppy and little." - "tell pet match let's find a puppy that barks at people and fun to play with": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - little: "*" # not sure the skill is working properly here +--- +- test: "Sequence 03-03. Test scenario: Canis and 'up to my knees'." - "tell pet match my favorite is a canis that is adult and plays frisbee": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - "up to my knees": "i am sorry i could not find a match for a medium watch high dog" +--- +- test: "Sequence 03-04. Test scenario: Canine and gigantic." - "tell pet match i want a canine that is gentle with kids and to watch netflix with": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i - gigantic: "so a large family low energy dog sounds good for you consider a great dane" + +# Sequence 04. Test scenario: Focus on entity resolution --- -- test: "Sequence 04. Test scenario: Focus on entity resolution" +- test: "Sequence 04-01. Test scenario: Mini for small." - "tell pet match i want a good with kids dog that is lazy": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -152,6 +206,8 @@ configuration: - mini: "which would you like small or tiny" - "small": "so a small family low energy dog sounds good for you consider a bolognese" +--- +- test: "Sequence 04-02. Test scenario: Mini for tiny." - "tell pet match i want a good with kids dog that is lazy": - prompt: - /there are dogs that are tiny, small, medium, and large.*/i @@ -159,6 +215,7 @@ configuration: - mini: "which would you like small or tiny" - "tiny": "i am sorry i could not find a match for a tiny family low dog" + --- - test: "Sequence 05. Test scenario: AMAZON.HelpIntent. Ask for help and exit" - LaunchRequest: @@ -169,12 +226,16 @@ configuration: - response.card: undefined - stop: "Bye" + +# Sequence 06. Test scenario: AMAZON.StopIntent and AMAZON.CancelIntent --- -- test: "Sequence 06. Test scenario: AMAZON.StopIntent and AMAZON.CancelIntent" +- test: "Sequence 06-01: AMAZON.StopIntent" - LaunchRequest: - stop: - response.outputSpeech.ssml: "Bye" +--- +- test: "Sequence 06-02: AMAZON.CancelIntent" - LaunchRequest: - cancel: - response.outputSpeech.ssml: "Bye" \ No newline at end of file From bcf4cf415ae70cecfde176e73b13bd69e3a1bfe9 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 25 May 2018 11:19:19 -0500 Subject: [PATCH 05/11] Second version of tests up to Seq 5. Errors found, waiting for corrections to continue. --- skill-testing.json | 3 +- test/en-US.yml | 318 ++++++++++++++++++++++----------------------- 2 files changed, 161 insertions(+), 160 deletions(-) diff --git a/skill-testing.json b/skill-testing.json index ae6079e..6a9f152 100644 --- a/skill-testing.json +++ b/skill-testing.json @@ -1,8 +1,9 @@ { "handler": "lambda/custom/index.js", "locale": "en-US", + "trace": "true", "jest": { - "silent": true, + "silent": false, "coveragePathIgnorePatterns": [ "/analytics" ] diff --git a/test/en-US.yml b/test/en-US.yml index cc8ba04..27541bf 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -36,7 +36,7 @@ configuration: - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i -- "stop": +- stop: - prompt: "Bye" --- @@ -45,14 +45,14 @@ configuration: - prompt: - /there are dogs that are tiny, small, medium, and large.*/i - /what size of a dog would you like.*/i -- stop: "Bye" +- stop: "Bye" # same behavior as previous sequence stop --- - test: "Sequence 02-03. Test scenario: {size} and {pet} slot values provided on the utterance." - "ask pet match small dog": - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i + - /would you prefer a dog to hang out with kids or to protect you.*/i + - /are you looking for more of a family dog or a guard dog?.*/i - slots: - pet: "dog" - size: "small" @@ -84,158 +84,158 @@ configuration: - energy: "that I can run with" - stop: "Bye" -# not sure about the correct behaviour of the skill here, need review ---- -- test: "Sequence 02-06. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." -- "tell pet match i like a dog that is more than 20 kilograms": "*" - ---- -- test: "Sequence 02-07. Test scenario: {article}, {shedding}, {size} and {pet} slot values provided." -- "ask pet match for a long hair large puppy": "*" - ---- -- test: "Sequence 02-08. Test scenario: {article}, {size}, {shedding} and {pet} slot values provided." -- "ask pet match for a small hypoallergenic doggie": "*" - ---- -- test: "Sequence 02-09. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." -- "tell pet match i want a canis that's over 70 inches tall": "*" - -# starting deeper interactions. Might want to add slot values for dialog manager? ---- -- test: "Sequence 02-10. Test scenario: {I_Want}, {energy}, {at_the} and {location} slot values provided." -- "tell pet match i prefer to go hiking at the mountains": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- small: - - prompt: - - "are you looking for more of a family dog or a guard dog" - - "would you prefer a dog to hang out with kids or to protect you" -- "guard dog": - - prompt: "so a small guard high energy dog sounds good for you consider a toy fox terrier" - - slots: - - at_the: "at the" - - pet: "dog" - - size: "small" - - I_Want: /i prefer.*/i - - temperament: "guard" - - energy: "go hiking" - - location: "mountains" - ---- -- test: "Sequence 02-11. Test scenario: {energy} and {pet} slot values provided." -- "ask pet match for a lazy puppy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- medium: - - prompt: - - "are you looking for more of a family dog or a guard dog" - - "would you prefer a dog to hang out with kids or to protect you" -- "family dog": "so a medium family low energy dog sounds good for you consider a greyhound" - ---- -- test: "Sequence 02-12. Test scenario: {I_Want}, {article}, {energy} and {pet} slot values provided." -- "tell pet match i want a hike canine": - - intent: "PetMatchIntent" - - slots: - - I_Want: "i want" - - article: "a" - - energy: "hike" - - pet: "canine" - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- large: - - prompt: - - "are you looking for more of a family dog or a guard dog" - - "would you prefer a dog to hang out with kids or to protect you" -- "to protect me": "so a large guard high energy dog sounds good for you consider a doverman pinscher" - ---- -- test: "Sequence 02-13. Test scenario: {I_Want}, {article}, {temperament} and {energy} slot values provided." -- "tell pet match i want a good with kids dog that is lazy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- small: /so a small family low energy dog sounds good for you consider a bolognese.*/i - - -# Sequence 03. Test scenario: Focus on synonyms ---- -- test: "Sequence 03-01. Test scenario: Doggie and yippi." -- "tell pet match i prefer a doggie that is protective and energetic": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- yippi: "so a tiny guard high energy dog sounds good for you consider a chihuahua" - ---- -- test: "Sequence 03-02. Test scenario: Puppy and little." -- "tell pet match let's find a puppy that barks at people and fun to play with": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- little: "*" # not sure the skill is working properly here - ---- -- test: "Sequence 03-03. Test scenario: Canis and 'up to my knees'." -- "tell pet match my favorite is a canis that is adult and plays frisbee": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- "up to my knees": "i am sorry i could not find a match for a medium watch high dog" - ---- -- test: "Sequence 03-04. Test scenario: Canine and gigantic." -- "tell pet match i want a canine that is gentle with kids and to watch netflix with": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- gigantic: "so a large family low energy dog sounds good for you consider a great dane" - - -# Sequence 04. Test scenario: Focus on entity resolution ---- -- test: "Sequence 04-01. Test scenario: Mini for small." -- "tell pet match i want a good with kids dog that is lazy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- mini: "which would you like small or tiny" -- "small": "so a small family low energy dog sounds good for you consider a bolognese" - ---- -- test: "Sequence 04-02. Test scenario: Mini for tiny." -- "tell pet match i want a good with kids dog that is lazy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- mini: "which would you like small or tiny" -- "tiny": "i am sorry i could not find a match for a tiny family low dog" - - ---- -- test: "Sequence 05. Test scenario: AMAZON.HelpIntent. Ask for help and exit" -- LaunchRequest: -- help: - - response.outputSpeech.ssml: /.*i can help you find the perfect pet for you you can say i want a dog.*/i - - response.reprompt.outputSpeech.ssml: /would you like a career or do you want to be a couch potato.*/i - - response.shouldEndSession: false - - response.card: undefined -- stop: "Bye" - - -# Sequence 06. Test scenario: AMAZON.StopIntent and AMAZON.CancelIntent ---- -- test: "Sequence 06-01: AMAZON.StopIntent" -- LaunchRequest: -- stop: - - response.outputSpeech.ssml: "Bye" - ---- -- test: "Sequence 06-02: AMAZON.CancelIntent" -- LaunchRequest: -- cancel: - - response.outputSpeech.ssml: "Bye" \ No newline at end of file +## not sure about the correct behaviour of the skill here, need review +#--- +#- test: "Sequence 02-06. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." +#- "tell pet match i like a dog that is more than 20 kilograms": "*" +# +#--- +#- test: "Sequence 02-07. Test scenario: {article}, {shedding}, {size} and {pet} slot values provided." +#- "ask pet match for a long hair large puppy": "*" +# +#--- +#- test: "Sequence 02-08. Test scenario: {article}, {size}, {shedding} and {pet} slot values provided." +#- "ask pet match for a small hypoallergenic doggie": "*" +# +#--- +#- test: "Sequence 02-09. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." +#- "tell pet match i want a canis that's over 70 inches tall": "*" +# +## starting deeper interactions. Might want to add slot values for dialog manager? +#--- +#- test: "Sequence 02-10. Test scenario: {I_Want}, {energy}, {at_the} and {location} slot values provided." +#- "tell pet match i prefer to go hiking at the mountains": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- small: +# - prompt: +# - "are you looking for more of a family dog or a guard dog" +# - "would you prefer a dog to hang out with kids or to protect you" +#- "guard dog": +# - prompt: "so a small guard high energy dog sounds good for you consider a toy fox terrier" +# - slots: +# - at_the: "at the" +# - pet: "dog" +# - size: "small" +# - I_Want: /i prefer.*/i +# - temperament: "guard" +# - energy: "go hiking" +# - location: "mountains" +# +#--- +#- test: "Sequence 02-11. Test scenario: {energy} and {pet} slot values provided." +#- "ask pet match for a lazy puppy": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- medium: +# - prompt: +# - "are you looking for more of a family dog or a guard dog" +# - "would you prefer a dog to hang out with kids or to protect you" +#- "family dog": "so a medium family low energy dog sounds good for you consider a greyhound" +# +##--- +##- test: "Sequence 02-12. Test scenario: {I_Want}, {article}, {energy} and {pet} slot values provided." +##- "tell pet match i want a hike canine": +## - intent: "PetMatchIntent" +## - slots: +## - I_Want: "i want" +## - article: "a" +## - energy: "hike" +## - pet: "canine" +## - prompt: +## - /there are dogs that are tiny, small, medium, and large.*/i +## - /what size of a dog would you like.*/i +##- large: +## - prompt: +## - "are you looking for more of a family dog or a guard dog" +## - "would you prefer a dog to hang out with kids or to protect you" +##- "to protect me": "so a large guard high energy dog sounds good for you consider a doverman pinscher" +# +#--- +#- test: "Sequence 02-13. Test scenario: {I_Want}, {article}, {temperament} and {energy} slot values provided." +#- "tell pet match i want a good with kids dog that is lazy": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- small: /so a small family low energy dog sounds good for you consider a bolognese.*/i +# +# +## Sequence 03. Test scenario: Focus on synonyms +#--- +#- test: "Sequence 03-01. Test scenario: Doggie and yippi." +#- "tell pet match i prefer a doggie that is protective and energetic": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- yippi: "so a tiny guard high energy dog sounds good for you consider a chihuahua" +# +#--- +#- test: "Sequence 03-02. Test scenario: Puppy and little." +#- "tell pet match let's find a puppy that barks at people and fun to play with": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- little: "*" # not sure the skill is working properly here +# +#--- +#- test: "Sequence 03-03. Test scenario: Canis and 'up to my knees'." +#- "tell pet match my favorite is a canis that is adult and plays frisbee": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- "up to my knees": "i am sorry i could not find a match for a medium watch high dog" +# +#--- +#- test: "Sequence 03-04. Test scenario: Canine and gigantic." +#- "tell pet match i want a canine that is gentle with kids and to watch netflix with": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- gigantic: "so a large family low energy dog sounds good for you consider a great dane" +# +# +## Sequence 04. Test scenario: Focus on entity resolution +#--- +#- test: "Sequence 04-01. Test scenario: Mini for small." +#- "tell pet match i want a good with kids dog that is lazy": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- mini: "which would you like small or tiny" +#- small: "so a small family low energy dog sounds good for you consider a bolognese" +# +#--- +#- test: "Sequence 04-02. Test scenario: Mini for tiny." +#- "tell pet match i want a good with kids dog that is lazy": +# - prompt: +# - /there are dogs that are tiny, small, medium, and large.*/i +# - /what size of a dog would you like.*/i +#- mini: "which would you like small or tiny" +#- tiny: "i am sorry i could not find a match for a tiny family low dog" +# +# +#--- +#- test: "Sequence 05. Test scenario: AMAZON.HelpIntent. Ask for help and exit" +#- LaunchRequest: +#- help: +# - response.outputSpeech.ssml: /.*i can help you find the perfect pet for you you can say i want a dog.*/i +# - response.reprompt.outputSpeech.ssml: /would you like a career or do you want to be a couch potato.*/i +# - response.shouldEndSession: false +# - response.card: undefined +#- stop: "Bye" +# +# +## Sequence 06. Test scenario: AMAZON.StopIntent and AMAZON.CancelIntent +#--- +#- test: "Sequence 06-01: AMAZON.StopIntent" +#- LaunchRequest: +#- stop: +# - response.outputSpeech.ssml: "Bye" +# +#--- +#- test: "Sequence 06-02: AMAZON.CancelIntent" +#- LaunchRequest: +#- cancel: +# - response.outputSpeech.ssml: "Bye" \ No newline at end of file From 4cec47bc730fd0efd06a416652cee75a92ba4739 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 1 Jun 2018 16:59:52 -0500 Subject: [PATCH 06/11] Updating header --- test/en-US.yml | 305 ++++++++++++++++++++++++------------------------- 1 file changed, 152 insertions(+), 153 deletions(-) diff --git a/test/en-US.yml b/test/en-US.yml index 27541bf..74fa0f4 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -1,10 +1,9 @@ #===================================================================================================================== -# ██████╗ ███████╗███████╗██████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ -# ██╔══██╗██╔════╝██╔════╝██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ -# ██████╔╝█████╗ ███████╗██████╔╝██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ -# ██╔══██╗██╔══╝ ╚════██║██╔═══╝ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ -# ██████╔╝███████╗███████║██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ -# ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ +# ______ _ ____ ______ __ _ +# / __/ /__ (_) / / /_ __/__ ___ / /_(_)__ ___ _ +# _\ \/ '_// / / / / / / -_|_- Date: Thu, 21 Jun 2018 18:06:07 -0500 Subject: [PATCH 07/11] First version of Petmatch running --- skill-testing.json | 2 +- test/en-US.yml | 275 ++++++++++++--------------------------------- 2 files changed, 70 insertions(+), 207 deletions(-) diff --git a/skill-testing.json b/skill-testing.json index 6a9f152..7bb8499 100644 --- a/skill-testing.json +++ b/skill-testing.json @@ -1,7 +1,7 @@ { "handler": "lambda/custom/index.js", "locale": "en-US", - "trace": "true", + "trace": true, "jest": { "silent": false, "coveragePathIgnorePatterns": [ diff --git a/test/en-US.yml b/test/en-US.yml index 74fa0f4..4068981 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -17,224 +17,87 @@ --- configuration: + accessToken: 123456 locale: en-US --- -- test: "Sequence 01. Test scenario: launch request, no further interaction." -- LaunchRequest: - - response.outputSpeech.ssml: /welcome to pet match.*/i - - response.reprompt.outputSpeech.ssml: /what size and temperament are you looking for in a dog.*/i - - response.shouldEndSession: false - - response.card: undefined - - -# Sequence group 02. Test scenario: Invoke PetMatchIntent with different utterances. Focus on dialog management. ---- -- test: "Sequence 02-01. Test scenario: simple utterance, no slot value provided." -- "ask pet match to find a pet": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- stop: - - prompt: "Bye" - ---- -- test: "Sequence 02-02. Test scenario: simple utterance, no slot value provided." -- "ask pet match to match me": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- stop: "Bye" # same behavior as previous sequence stop +- test: Launch request, no further interaction +- open pet match: + - prompt: Welcome to pet match + - reprompt: What size and temperament are you looking for in a dog + - sessionEnded: false --- -- test: "Sequence 02-03. Test scenario: {size} and {pet} slot values provided on the utterance." -- "ask pet match small dog": +- test: Simple utterance, no slot value provided +- find a pet: - prompt: - - /would you prefer a dog to hang out with kids or to protect you.*/i - - /are you looking for more of a family dog or a guard dog?.*/i - - slots: - - pet: "dog" - - size: "small" -- stop: "Bye" + - There are dogs that are tiny, small, medium, and large + - What size of a dog would you like? +- stop: Bye --- -- test: "Sequence 02-04. Test scenario: {pet} slot value provided on the utterance. " -- "ask pet match for a dog": +- test: The size and pet slot values are provided on open +- small dog: + - intent: PetMatchIntent + size: small + pet: dog - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i - - slots: - - pet: "dog" -- stop: "Bye" + - Would you prefer a dog to hang out with kids or to protect you? + - Are you looking for more of a family dog or a guard dog? +- stop: Bye -# It seems there are problems with the entity resolution for I_Want slot -# should ask for size. It works repeating the utterance with "i want" or "i prefer" --- -- test: "Sequence 02-05. Test scenario: {I_Want}, {article}, {pet}, {temperament} and {energy} slot values provided." -- "tell pet match i like a dog that is protective and that i can run with": +- test: Complete dialog sequence, starting with energy +- high energy: + - intent: PetMatchIntent + energy: high - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i - - slots: - - pet: "dog" - - article: "a" - - I_Want: /i like.*/i - - temperament: "protective" - - energy: "that I can run with" -- stop: "Bye" + - There are dogs that are tiny, small, medium, and large + - What size of a dog would you like? +- small: Are you looking for more of a family dog or a guard dog? +- guard: So a small guard high energy dog sounds good for you. Consider a toy fox terrier +- exit -# not sure about the correct behaviour of the skill here, need review --- -- test: "Sequence 02-06. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." -- "tell pet match i like a dog that is more than 20 kilograms": "*" - ---- -- test: "Sequence 02-07. Test scenario: {article}, {shedding}, {size} and {pet} slot values provided." -- "ask pet match for a long hair large puppy": "*" - ---- -- test: "Sequence 02-08. Test scenario: {article}, {size}, {shedding} and {pet} slot values provided." -- "ask pet match for a small hypoallergenic doggie": "*" - ---- -- test: "Sequence 02-09. Test scenario: {I_Want}, {article}, {pet}, {comparison}, {amount} and {units} provided." -- "tell pet match i want a canis that's over 70 inches tall": "*" - -# starting deeper interactions. Might want to add slot values for dialog manager? ---- -- test: "Sequence 02-10. Test scenario: {I_Want}, {energy}, {at_the} and {location} slot values provided." -- "tell pet match i prefer to go hiking at the mountains": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i +- test: Disambiguation of slots +- open pet match +- mini: + - intent: PetMatchIntent + size: mini + - prompt: Which would you like small or tiny? - small: - - prompt: - - "are you looking for more of a family dog or a guard dog" - - "would you prefer a dog to hang out with kids or to protect you" -- "guard dog": - - prompt: "so a small guard high energy dog sounds good for you consider a toy fox terrier" - - slots: - - at_the: "at the" - - pet: "dog" - - size: "small" - - I_Want: /i prefer.*/i - - temperament: "guard" - - energy: "go hiking" - - location: "mountains" - ---- -- test: "Sequence 02-11. Test scenario: {energy} and {pet} slot values provided." -- "ask pet match for a lazy puppy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- medium: - - prompt: - - "are you looking for more of a family dog or a guard dog" - - "would you prefer a dog to hang out with kids or to protect you" -- "family dog": "so a medium family low energy dog sounds good for you consider a greyhound" - -#--- -#- test: "Sequence 02-12. Test scenario: {I_Want}, {article}, {energy} and {pet} slot values provided." -#- "tell pet match i want a hike canine": -# - intent: "PetMatchIntent" -# - slots: -# - I_Want: "i want" -# - article: "a" -# - energy: "hike" -# - pet: "canine" -# - prompt: -# - /there are dogs that are tiny, small, medium, and large.*/i -# - /what size of a dog would you like.*/i -#- large: -# - prompt: -# - "are you looking for more of a family dog or a guard dog" -# - "would you prefer a dog to hang out with kids or to protect you" -#- "to protect me": "so a large guard high energy dog sounds good for you consider a doverman pinscher" - ---- -- test: "Sequence 02-13. Test scenario: {I_Want}, {article}, {temperament} and {energy} slot values provided." -- "tell pet match i want a good with kids dog that is lazy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- small: /so a small family low energy dog sounds good for you consider a bolognese.*/i - - -# Sequence 03. Test scenario: Focus on synonyms ---- -- test: "Sequence 03-01. Test scenario: Doggie and yippi." -- "tell pet match i prefer a doggie that is protective and energetic": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- yippi: "so a tiny guard high energy dog sounds good for you consider a chihuahua" - ---- -- test: "Sequence 03-02. Test scenario: Puppy and little." -- "tell pet match let's find a puppy that barks at people and fun to play with": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- little: "*" # not sure the skill is working properly here - ---- -- test: "Sequence 03-03. Test scenario: Canis and 'up to my knees'." -- "tell pet match my favorite is a canis that is adult and plays frisbee": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- "up to my knees": "i am sorry i could not find a match for a medium watch high dog" - ---- -- test: "Sequence 03-04. Test scenario: Canine and gigantic." -- "tell pet match i want a canine that is gentle with kids and to watch netflix with": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- gigantic: "so a large family low energy dog sounds good for you consider a great dane" - - -# Sequence 04. Test scenario: Focus on entity resolution ---- -- test: "Sequence 04-01. Test scenario: Mini for small." -- "tell pet match i want a good with kids dog that is lazy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- mini: "which would you like small or tiny" -- small: "so a small family low energy dog sounds good for you consider a bolognese" - ---- -- test: "Sequence 04-02. Test scenario: Mini for tiny." -- "tell pet match i want a good with kids dog that is lazy": - - prompt: - - /there are dogs that are tiny, small, medium, and large.*/i - - /what size of a dog would you like.*/i -- mini: "which would you like small or tiny" -- tiny: "i am sorry i could not find a match for a tiny family low dog" - - ---- -- test: "Sequence 05. Test scenario: AMAZON.HelpIntent. Ask for help and exit" -- LaunchRequest: -- help: - - response.outputSpeech.ssml: /.*i can help you find the perfect pet for you you can say i want a dog.*/i - - response.reprompt.outputSpeech.ssml: /would you like a career or do you want to be a couch potato.*/i - - response.shouldEndSession: false - - response.card: undefined -- stop: "Bye" - - -# Sequence 06. Test scenario: AMAZON.StopIntent and AMAZON.CancelIntent ---- -- test: "Sequence 06-01: AMAZON.StopIntent" -- LaunchRequest: -- stop: - - response.outputSpeech.ssml: "Bye" - ---- -- test: "Sequence 06-02: AMAZON.CancelIntent" -- LaunchRequest: -- cancel: - - response.outputSpeech.ssml: "Bye" \ No newline at end of file + - intent: PetMatchIntent + size: small + - prompt: Are you looking for more of a family dog or a guard dog? +- guard: + - intent: PetMatchIntent + temperament: guard + - prompt: Do you prefer high energy or low energy dogs? +- low: + - intent: PetMatchIntent + energy: low + - prompt: So a small guard low energy dog sounds good for you. Consider a miniature snouser + +--- +- test: Disambiguation of slots - different order +- open pet match +- guard: + - intent: PetMatchIntent + temperament: guard + - prompt: There are dogs that are tiny, small, medium, and large. Which would you like? +- mini: + - intent: PetMatchIntent + size: mini + - prompt: Do you prefer high energy or low energy dogs? +- low: + - intent: PetMatchIntent + energy: low + - prompt: So a small guard low energy dog sounds good for you. Consider a miniature snouser + +--- +- test: No matching slots +- open pet match +- dummy: + - intent: PetMatchIntent + size: dummy + - prompt: What size are you looking for \ No newline at end of file From 731c4aa4595085340a9fb8aebe853ed1a5201f7c Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 22 Jun 2018 18:07:21 -0500 Subject: [PATCH 08/11] Updating script header, turning off debug --- lambda/custom/package-lock.json | 18 ++++++++++++++++++ skill-testing.json | 4 ++-- test/en-US.yml | 11 ++++------- 3 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 lambda/custom/package-lock.json diff --git a/lambda/custom/package-lock.json b/lambda/custom/package-lock.json new file mode 100644 index 0000000..23db438 --- /dev/null +++ b/lambda/custom/package-lock.json @@ -0,0 +1,18 @@ +{ + "name": "Pet-Match", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ask-sdk-core": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ask-sdk-core/-/ask-sdk-core-2.0.5.tgz", + "integrity": "sha512-XW95Wh+eMgOGBJKv15NvNip5QabOYu4nVw2qpZvb1PYZiw5ERVESiX26As+S/Iy63ZC7YbiI+o667z93xlUHKw==" + }, + "ask-sdk-model": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ask-sdk-model/-/ask-sdk-model-1.3.1.tgz", + "integrity": "sha512-ZDcmJ8sDRAzfIPz5WhRpy8HJ8SheBOyjoeHtYIcoVO6ZQEgxXtZ11GJGg8FhRDfwwIWj5Ma8G6m7OCgo4nuJDA==" + } + } +} diff --git a/skill-testing.json b/skill-testing.json index 7bb8499..0dbf1ac 100644 --- a/skill-testing.json +++ b/skill-testing.json @@ -1,9 +1,9 @@ { "handler": "lambda/custom/index.js", "locale": "en-US", - "trace": true, + "trace": false, "jest": { - "silent": false, + "silent": true, "coveragePathIgnorePatterns": [ "/analytics" ] diff --git a/test/en-US.yml b/test/en-US.yml index 4068981..5e917ab 100644 --- a/test/en-US.yml +++ b/test/en-US.yml @@ -5,19 +5,16 @@ # /___/_/\_\/_/_/_/ /_/ \__/___/\__/_/_//_/\_, / # /___/ # -# Test type: Functional/End-to-End/Regression +# Created by Bespoken +# Learn more at https://read.bespoken.io/unit-testing/getting-started/ +# # Skill name: "Pet Match" by Amazon # Test scope: LaunchRequest, PetMatchIntent, AMAZON.HelpIntent, AMAZON.StopIntent, AMAZON.CancelIntent +# Description: General test suite for all intents #===================================================================================================================== -# TO BE COMPLETED: -# =============== -# I'm using interaction model starting with languageModel (WIP for interactionModel) -# Stop, help, cancel intents not working, it matches the PetMatchIntent, perhaps same when saying exit in fact skill - --- configuration: - accessToken: 123456 locale: en-US --- From caa3b77cbab932fbb6fd80b7ff162ac2ce8c296a Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 22 Jun 2018 18:11:27 -0500 Subject: [PATCH 09/11] Adding .idea to .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cf0b893..9cb7166 100644 --- a/.gitignore +++ b/.gitignore @@ -60,5 +60,7 @@ typings/ # dotenv environment variables file .env +# IDEs +.idea -.DS_Store +.DS_Store \ No newline at end of file From 58d1aed7141c235e9b5c04c4aa790ae80909120b Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 20 Jul 2018 11:39:14 -0500 Subject: [PATCH 10/11] Updating testing project with latest suggestions from Amazon --- test/{en-US.yml => unit/index.test.yml} | 70 ++++++-------------- test/unit/readme.md | 46 +++++++++++++ skill-testing.json => test/unit/testing.json | 5 +- 3 files changed, 69 insertions(+), 52 deletions(-) rename test/{en-US.yml => unit/index.test.yml} (54%) create mode 100644 test/unit/readme.md rename skill-testing.json => test/unit/testing.json (57%) diff --git a/test/en-US.yml b/test/unit/index.test.yml similarity index 54% rename from test/en-US.yml rename to test/unit/index.test.yml index 5e917ab..fb8eab2 100644 --- a/test/en-US.yml +++ b/test/unit/index.test.yml @@ -19,82 +19,54 @@ configuration: --- - test: Launch request, no further interaction -- open pet match: +- LaunchRequest: - prompt: Welcome to pet match - reprompt: What size and temperament are you looking for in a dog - sessionEnded: false --- - test: Simple utterance, no slot value provided -- find a pet: +- PetMatchIntent: - prompt: - There are dogs that are tiny, small, medium, and large - What size of a dog would you like? -- stop: Bye +- AMAZON.StopIntent: Bye --- - test: The size and pet slot values are provided on open -- small dog: - - intent: PetMatchIntent - size: small - pet: dog +- PetMatchIntent size=small pet=dog: - prompt: - Would you prefer a dog to hang out with kids or to protect you? - Are you looking for more of a family dog or a guard dog? -- stop: Bye +- AMAZON.StopIntent: Bye --- - test: Complete dialog sequence, starting with energy -- high energy: - - intent: PetMatchIntent - energy: high +- PetMatchIntent pet=dog energy=high: - prompt: - There are dogs that are tiny, small, medium, and large - What size of a dog would you like? -- small: Are you looking for more of a family dog or a guard dog? -- guard: So a small guard high energy dog sounds good for you. Consider a toy fox terrier -- exit +- PetMatchIntent size=small: Are you looking for more of a family dog or a guard dog? +- PetMatchIntent temperament=guard: So a small guard high energy dog sounds good for you. Consider a toy fox terrier +- SessionEndedRequest: + - response.outputSpeech: undefined --- - test: Disambiguation of slots -- open pet match -- mini: - - intent: PetMatchIntent - size: mini - - prompt: Which would you like small or tiny? -- small: - - intent: PetMatchIntent - size: small - - prompt: Are you looking for more of a family dog or a guard dog? -- guard: - - intent: PetMatchIntent - temperament: guard - - prompt: Do you prefer high energy or low energy dogs? -- low: - - intent: PetMatchIntent - energy: low - - prompt: So a small guard low energy dog sounds good for you. Consider a miniature snouser +- LaunchRequest +- PetMatchIntent size=mini: Which would you like small or tiny? +- PetMatchIntent size=small: Are you looking for more of a family dog or a guard dog? +- PetMatchIntent temperament=guard: Do you prefer high energy or low energy dogs? +- PetMatchIntent energy=low: So a small guard low energy dog sounds good for you. Consider a miniature snouser --- - test: Disambiguation of slots - different order -- open pet match -- guard: - - intent: PetMatchIntent - temperament: guard - - prompt: There are dogs that are tiny, small, medium, and large. Which would you like? -- mini: - - intent: PetMatchIntent - size: mini - - prompt: Do you prefer high energy or low energy dogs? -- low: - - intent: PetMatchIntent - energy: low - - prompt: So a small guard low energy dog sounds good for you. Consider a miniature snouser +- LaunchRequest +- PetMatchIntent temperament=guard: There are dogs that are tiny, small, medium, and large. Which would you like? +- PetMatchIntent size=mini: Do you prefer high energy or low energy dogs? +- PetMatchIntent energy=low: So a small guard low energy dog sounds good for you. Consider a miniature snouser --- - test: No matching slots -- open pet match -- dummy: - - intent: PetMatchIntent - size: dummy - - prompt: What size are you looking for \ No newline at end of file +- LaunchRequest +- PetMatchIntent size=dummy: What size are you looking for \ No newline at end of file diff --git a/test/unit/readme.md b/test/unit/readme.md new file mode 100644 index 0000000..9d72434 --- /dev/null +++ b/test/unit/readme.md @@ -0,0 +1,46 @@ +## **How to setup and run Unit Test scripts** +To get started, you need to install Bespoken Tools, please follow the next steps: +1. Install Bespoken Tools by running `npm install -g bespoken-tools` on your command line. +2. Create the main testing folder. We recommend to name it `test`; it should be under the root of your skill's directory. +3. Create a folder named `unit` under `test\`, this folder will store your unit test script files. +4. Add the test configuration file `testing.json`. This file should be located under your `test\unit` directory. It might look like this: + ```JSON + { + "handler": "../../src/index.js", + "locale": "de-DE", + "trace": true, + "jest": { + "silent": false + } + } + ``` + The most important parameter is the handler where you indicate Bespoken's Skill Tester where the source code of your skill is. These parameters can be overwritten on each test script file under their configuration section. +5. Add your test scripts. We recommend to use next convention when naming your test script files: + * If you have only one test script: `index.test.yml` + * If you want to create more than one test script: `functionalityName.test.yml`. + + The yml extension indicates this is a YAML file, which is the syntax we use to create test scripts; `test` means that is a unit test script file. A test script looks like this: + ```YAML + --- + configuration: # Here you define your locales and mocks + locale: en-US + + --- # Three dashes start a new YAML document + - test: Launch request, no further interaction. # Some metadata about this test sequence + - LaunchRequest: # LaunchRequest is not an utterance but a request type and reserved word + - response.outputSpeech.ssml: Here's your fact + - response.card.type: Simple + - response.card.title: Space Facts + - response.card.content: "*" # Any text will match + ``` + A typical YAML sentence is composed of 2 parts separated by a colon; in the left part we have the intent name we want to test; in the right part we have the expected result. You can also access any element on the JSON response object like the session attributes. +6. To execute the scripts go to the root of your project and run `bst test`. That will find and run all the unit test scripts files. + +For more information about skill unit testing please read [here](https://read.bespoken.io/unit-testing/getting-started/). + +If you need assistance, reach us on any of these channels: +* [Chat with us](https://apps.bespoken.io/dashboard) (lower right-hand corner of the page) +* [Email](mailto:contact@bespoken.io) +* [Slack](http://www.alexaslack.com/) +* [Twitter](https://twitter.com/bespokenio) +* [Gitter](https://gitter.im/bespoken) \ No newline at end of file diff --git a/skill-testing.json b/test/unit/testing.json similarity index 57% rename from skill-testing.json rename to test/unit/testing.json index 0dbf1ac..8d0c472 100644 --- a/skill-testing.json +++ b/test/unit/testing.json @@ -1,9 +1,8 @@ { - "handler": "lambda/custom/index.js", - "locale": "en-US", + "handler": "../../lambda/custom/index.js", "trace": false, "jest": { - "silent": true, + "silent": false, "coveragePathIgnorePatterns": [ "/analytics" ] From 20fb805711733e8185663b9acebdef4bab931e16 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 17 Sep 2018 17:56:05 -0500 Subject: [PATCH 11/11] Updating test project with latest readme.md --- test/unit/index.test.yml | 13 +++---------- test/unit/readme.md | 39 +++++++++++++++++++++++---------------- test/unit/testing.json | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/test/unit/index.test.yml b/test/unit/index.test.yml index fb8eab2..e647c13 100644 --- a/test/unit/index.test.yml +++ b/test/unit/index.test.yml @@ -47,24 +47,17 @@ configuration: - There are dogs that are tiny, small, medium, and large - What size of a dog would you like? - PetMatchIntent size=small: Are you looking for more of a family dog or a guard dog? -- PetMatchIntent temperament=guard: So a small guard high energy dog sounds good for you. Consider a toy fox terrier +- PetMatchIntent temperament=guard: So a small \n guard \n high \n energy dog sounds good for you. Consider a \n toy fox terrier - SessionEndedRequest: - response.outputSpeech: undefined --- - test: Disambiguation of slots - LaunchRequest -- PetMatchIntent size=mini: Which would you like small or tiny? +- PetMatchIntent size=mini: What size are you looking for - PetMatchIntent size=small: Are you looking for more of a family dog or a guard dog? - PetMatchIntent temperament=guard: Do you prefer high energy or low energy dogs? -- PetMatchIntent energy=low: So a small guard low energy dog sounds good for you. Consider a miniature snouser - ---- -- test: Disambiguation of slots - different order -- LaunchRequest -- PetMatchIntent temperament=guard: There are dogs that are tiny, small, medium, and large. Which would you like? -- PetMatchIntent size=mini: Do you prefer high energy or low energy dogs? -- PetMatchIntent energy=low: So a small guard low energy dog sounds good for you. Consider a miniature snouser +- PetMatchIntent energy=low: So a small \n guard \n low \n energy dog sounds good for you. Consider a \n miniature snouser --- - test: No matching slots diff --git a/test/unit/readme.md b/test/unit/readme.md index 9d72434..5eef00c 100644 --- a/test/unit/readme.md +++ b/test/unit/readme.md @@ -1,13 +1,21 @@ -## **How to setup and run Unit Test scripts** -To get started, you need to install Bespoken Tools, please follow the next steps: -1. Install Bespoken Tools by running `npm install -g bespoken-tools` on your command line. +## **How to setup and run Unit Tests** + +There are several methods commonly used to test and simulate Alexa skills during the development process. +See the Alexa Cookbook [testing guide](https://github.com/alexa/alexa-cookbook/tree/master/guides/testing) for more details. + +For running formal QA tests, developers can leverage third-party tools that run on standard unit test frameworks like [Jest](https://jestjs.io/) or [Mocha](https://mochajs.org/). + +Here we will focus on running a test suite against your local code project using the Bespoken CLI (`bst`) from [Bespoken](https://bespoken.io). + +To get started, you need to install the Bespoken CLI, please follow the next steps: +1. Install the Bespoken CLI by running `npm install -g bespoken-tools` on your command line. 2. Create the main testing folder. We recommend to name it `test`; it should be under the root of your skill's directory. -3. Create a folder named `unit` under `test\`, this folder will store your unit test script files. +3. Create a folder named `unit` under `test\`, this folder will store your unit test script files. 4. Add the test configuration file `testing.json`. This file should be located under your `test\unit` directory. It might look like this: ```JSON { "handler": "../../src/index.js", - "locale": "de-DE", + "locale": "en-US", "trace": true, "jest": { "silent": false @@ -17,8 +25,8 @@ To get started, you need to install Bespoken Tools, please follow the next steps The most important parameter is the handler where you indicate Bespoken's Skill Tester where the source code of your skill is. These parameters can be overwritten on each test script file under their configuration section. 5. Add your test scripts. We recommend to use next convention when naming your test script files: * If you have only one test script: `index.test.yml` - * If you want to create more than one test script: `functionalityName.test.yml`. - + * If you want to create more than one test script: `functionalityName.test.yml`. + The yml extension indicates this is a YAML file, which is the syntax we use to create test scripts; `test` means that is a unit test script file. A test script looks like this: ```YAML --- @@ -26,21 +34,20 @@ To get started, you need to install Bespoken Tools, please follow the next steps locale: en-US --- # Three dashes start a new YAML document - - test: Launch request, no further interaction. # Some metadata about this test sequence - - LaunchRequest: # LaunchRequest is not an utterance but a request type and reserved word + - test: Launch request, no further interaction. # A description of this test sequence + - LaunchRequest: # LaunchRequest is not an utterance but a request type - response.outputSpeech.ssml: Here's your fact - response.card.type: Simple - response.card.title: Space Facts - - response.card.content: "*" # Any text will match + - response.card.content: "*" # A wildcard means any text will match ``` A typical YAML sentence is composed of 2 parts separated by a colon; in the left part we have the intent name we want to test; in the right part we have the expected result. You can also access any element on the JSON response object like the session attributes. 6. To execute the scripts go to the root of your project and run `bst test`. That will find and run all the unit test scripts files. -For more information about skill unit testing please read [here](https://read.bespoken.io/unit-testing/getting-started/). +For more information about skill unit testing with Bespoken, please read [here](https://read.bespoken.io/unit-testing/getting-started/). -If you need assistance, reach us on any of these channels: -* [Chat with us](https://apps.bespoken.io/dashboard) (lower right-hand corner of the page) -* [Email](mailto:contact@bespoken.io) -* [Slack](http://www.alexaslack.com/) +If you need assistance, reach Bespoken on any of these channels: +* [Chat with us](https://bespoken.io/testing) (chat is in lower right-hand corner of the page) +* [Email](mailto:support@bespoken.io) * [Twitter](https://twitter.com/bespokenio) -* [Gitter](https://gitter.im/bespoken) \ No newline at end of file +* [Gitter](https://gitter.im/bespoken) diff --git a/test/unit/testing.json b/test/unit/testing.json index 8d0c472..07db8b9 100644 --- a/test/unit/testing.json +++ b/test/unit/testing.json @@ -2,7 +2,7 @@ "handler": "../../lambda/custom/index.js", "trace": false, "jest": { - "silent": false, + "silent": true, "coveragePathIgnorePatterns": [ "/analytics" ]