Class: TestSuite

TestSuite(fileName, configuration, tests, localizedValues)

Represent a complete test suite

Constructor

new TestSuite(fileName, configuration, tests, localizedValues)

Parameters:
Name Type Description
fileName string The file where this test suite was defined.
configuration object Complete configuration set up for the test suite
tests Array.<Test> Array of tests inside this test suite
localizedValues Array.<object> Array of objects {key, value} where the keys are the file name without extension and the value is a key value object with the localization values
Source:

Members

accessToken

Get the access token for SMAPI e2e testing
Source:

actionURL

Get the URL for the action for Google Assistant unit tests
Source:

address

Get the address object for Alexa unit testing to use as mock in the address API
Source:

applicationId

Get the applicationId for Alexa unit testing to set in the requests
Source:

asyncE2EWaitInterval

Get the time waited before attempting to obtain new results in e2e tests that are running in async mode
Source:

asyncMode

Indicates if the async mode flag is set for e2e tests running in batch mode (only available with batchEnabled set to true)
Source:

batchEnabled

Indicates if the e2e tests run all utterances in batch or sequentially
Source:

bespokenProjectId

Ties off to a unique key for a voice app
Source:

client

Origin of the request, accepted values are "http", "cli", "sdk", "monitoring" and "dashboard", defaults http
Source:

configuration

Get the complete configuration set up for the test suite
Source:

currentLocale

Set the locale for the current run of the test suite
Source:

description

Get the Description for the test suite
Source:

deviceId

Get the device id to set on requests for Alexa unit tests
Source:

deviceLocation

Only for google, location of the request
Source:

dialogFlowDirectory

Get the Dialog Flow imported project directory
Source:

directory

Returns the directory where this filename is located
Source:

dynamo

Indicates if it's using the dynamo mock for Alexa unit tests
Source:

exclude

Get the list of tags that won't be run
Source:

expressModule

Get the express module configured for Google Assistant Unit tests if it exists
Source:

expressPort

Get the express port configured for Google Assistant Unit tests if it exists
Source:

extraParameters

extra parameters for virtual device
Source:

fileName

set the file where this test suite was defined, useful when running Test Suite without an actual file
Source:

filter

Get the filter path
Source:

handler

The handler for the function to use for unit tests, returns "./index.handler" by default
Source:

hasDeprecatedE2EOperators

Returns true if at least one of the tests have operator ">", ">=", "<" and "<="
Source:

hasDeprecatedOperators

Returns true if at least one of the tests have operator "==" or "=~"
Source:

homophones

Get the list of homophones for e2e testing
Source:

ignoreExternalErrors

Indicates if errors unrelated to the assertions (network for example) are ignored during e2e tests
Source:

ignoreProperties

Indicates which properties in the test and request will be ignored when evaluating the assertions, useful when running the same set of test for different platforms
Source:

include

Get the list of tags that will be run, all other tests will be excluded
Source:

intentSchema

Get the intent schema path for Alexa unit tests
Source:

interactionModel

The interaction model for Alexa unit tests, returns "./models/.json" by default
Source:

invocationName

Returns the invocation name to replace in e2e tests
Source:

invoker

Returns the invoker object that will process the utterances in this test suite
Source:

lenientMode

Ignore extra spaces and punctuation for string comparison
Source:

locale

Returns the locale for this test suite
Source:

locales

Returns the list of locales that this test suite includes
Source:

localizedValues

Array of objects {key, value} where the keys are the file name without extension and the value is a key value object with the localization values
Source:

localizedValues

Set the localized values
Source:

maxAsyncE2EResponseWaitTime

Indicates what is the maximum time e2e test can wait for a single utterance response to come back
Source:

phoneNumber

Only for twilio, phone number to call
Source:

platform

Returns the platform (alexa or google) for this test suite, defaults to alexa
Source:

projectId

Only for dialogFlow, project Id of the dialogFlow agent
Source:

rawTestContent

Raw test elements obtained from parsing the yaml file to an object
Source:

retryNumber

number of times of the retry logic on errors
Source:

retryNumberWarning

validation message for retryNumber
Source:

retryOn

When we get an error code from virtual device, retry logic will be executed if the error code match any from the list
Source:

runId

Unique id that identifies this run
Source:

sampleUtterances

Get the sample utterances path for Alexa unit tests
Source:

screenMode

Only for google, OFF for a request on a device without screen, defaults PLAYING
Source:

shortFileName

Returns just the base name of the test suite file
Source:

skillId

The skill id used for Alexa unit tests in the requests
Source:

skillURL

Get the URL for the skill for Alexa unit tests
Source:

stage

The stage used for simulation(development or live) in e2e tests
Source:

stopTestOnFailure

Stops the test if there is an assertion error
Source:

stt

Speech to text service to use, it could be google or witai, defaults to google
Source:

supportedInterfaces

The supported interfaces used for Alexa unit tests in the requests
Source:

tags

test suite's tags
Source:

tests

Returns the list of tests inside this test suite
Source:

trace

Indicates if trace is active to print out the request and responses during the tests
Source:

type

Returns the type of test (unit, e2e, simulation) for this test suite, defaults to unit
Source:

userId

The user id used for Alexa unit tests in the requests
Source:

userProfile

Get the User Profile object for Alexa unit testing to use as mock in the User Profile API
Source:

virtualDeviceBaseURL

virtual device url
Source:

virtualDeviceToken

The virtual device token used for this test suite e2e tests depending on the platform and locale
Source:

voiceId

Get the voice id for e2e tests
Source:

Methods

filterObject() → {object}

Returns the filter as an object
Source:
Returns:
the filter object
Type
object

getLocalizedValue(key) → {string}

Returns the value for a key for the locale used on this test suite
Parameters:
Name Type Description
key string key to find in the localized values list
Source:
Returns:
value for the specific key on this locale
Type
string

getTagsFromString() → {Array.<string>}

Get a list of tags from a comma delimited string
Source:
Returns:
the list of tags
Type
Array.<string>

(async) loadLocalizedValues()

Read the locales folder path and obtain the list of values to used to replace depending on which locale is running
Source:

processIncludedAndExcludedTags()

Process the include and exclude flags and turn them to skip's and only's
Source:

processOnlyFlag()

Process the skip and only flags for the tests inside the suite
Source:

resolvePath(pathToResolve) → {string}

Returns the absolute path
Parameters:
Name Type Description
pathToResolve string the path to resolve
Source:
Returns:
the complete path
Type
string

toYamlObject()

test as yaml object
Source:

wrapFilterFunctions(filterObject) → {object}

Returns the filter object with the functions wrapped around try catch methods
Parameters:
Name Type Description
filterObject object the filter object
Source:
Returns:
the modified object with the functions wrapped up
Type
object