Skip to main content

Testing your app

You can test your Narratory apps in a few different ways, through command-line, using the Google Assistant simulator or on any Google connected device.

Testing in your terminal#

For your convenience, it is possible to test your Narratory app directly in your terminal with the command narratory chat (or narratory start if you also want to build the agent).

testing terminal

Testing with pre-written prompts#

To speed up the testing, you can supply the chat-command with phrases in-line, for example narratory chat "I wanna fly to paris" two "from berlin". These phrases will be pre-filled in the dialog, allowing you to start manually testing from a later point in the dialog. Use quotes to denotate multi word phrases.

testing terminal

Recording and replaying test-scripts#

To further automate testing, you can record scripts while testing and replay them at a later point to verify that your app behaves the same. To do this, you use the --record (or -r) flag and supply a filename where your recorded script will be saved. To then play-back a recorded script in a chat-session, you use the --play (or -p) tag with the same filename.

# To record to the file myFirstTest.txtnarratory chat -r myFirstTest.txt
# To replay the script from file myFirstTest.txtnarratory chat -p --script=myFirstTest.txt

The below screen-capture shows how to use these two commands and also how to edit the recorded script manually.

testing terminal

All flags available#

Short flagLong flagDescriptionExample
-r fileName--record fileNameRecords a chat to a file for replay laternarratory chat -r myFirstScript
-p fileName--play fileNameReplays a chat from a filenarratory start -p myOtherScript
-d debug--debugShows debug information (latency, intent classified, confidence)narratory chat --debug

Testing in Google Assistant simulator#

You can also test it right away in the Google Assistant (Google Actions) test console. In your browser, follow the link "See how it works in Google Assistant" in the right column in the Dialogflow console to open it up, or go to Integrations in the left menu and enter it from there.

testing in google assistanttesting in google assistant2

Testing on your Google Assistant devices#

You can also test your Narratory app on any Google device that is logged in with the same Google account as the one you used when creating your Dialogflow project. This could for example be your smartphone with the Google assistant / Google home app or a Google Home speaker.

Testing deployed versions#

Testing deployed versions in terminal#

Currently you can't test your deployed app from terminal. In the future, you will! When testing from terminal, you will always use the latest draft of your agent.

Testing deployed versions on Google Assistant devices#

Once you have deployed a version of your app (see Deployment docs) you can test it through any device that is set up with a Google account that you have invited as an Alpha or Beta tester. The latest available version will always be used.

Testing deployed versions in Google Assistant simulator#

To test your deployed version in the Google Assistant simulator, you select the version from the dropdown list "Versions".

Validation#

Narratory can with the help of Dialogflow's NLU engine validate your bot's language model (i.e your intents and entities), this you could either review through the Dialogflow console or with the command narratory validate.

validation in terminal