Introduction
Functionize offers the ability to attach an extension to run before a test starts or after it ends. Pre-hook extensions (a feature coming soon) are used for test setup—either to set environment variables or run custom logic and persist some state needed for the test via the use of variables. Post-hook extensions are used at the end of a test to integrate with test management platforms or other services while having access to overall test and step-by-step results
Adding an Extension
This is done in the Test Settings modal on the Webhooks tab. From here, you can select either a Pre-Test (a feature coming soon) or a Post-Test Extension. You can choose from any created extension that is available for your personal account or shared across your entire team, and a search field is provided to easily find the extension you are looking for. Once added, the extension will be visible in both the Test Settings -> Webhooks section, as well as the main Test Details page.
Note: An upgraded runtime version is necessary to enable this feature. Please contact support if you need to upgrade your runtime version.
Project Level Extensions
Extensions can also be attached at the project level, via the Webhook tab in the Project Settings modal. Any extension attached at the project level will execute for all tests in that project.
Post-test Extensions
Here is an example request sent from Functionize into the extension:
{
"testResults": {
"result": "PASS",
"folderPath": "test-900000/job-10163538/"
},
"variables": {
"orchestration": {},
"project": {
"sampleObject": {
"testing": "123"
},
"sampleString": "value",
"SampleArray": [
"test",
"value"
]
},
"iteration": 0,
"team": {
"email": "tester@functionizeapp.com"
},
"tdm": {},
"env": {
"jobId": "10163538",
"testId": "900000",
"projectId": "24522",
"environment": "live",
"initialUrl": "https://www.google.com/",
"projSettingUrl": "google.com",
"timeouts": {
"pageLoadTimeout": 30,
"ajaxTimeout": 10,
"missingElementTimeout": 15
}
},
"local": {
"sampleLocal": {
"testing": "12345"
},
"iterations": [
0
]
},
"environment": "live",
"proxyIp": "10.200.1.20",
"orchestrationId": "0",
"testId": "900000",
"actionResults": [
{
"actionId": "1681486865296_V1CIIJZCL0",
"stepResult": {
"results": [
{
"result": "SUCCESS",
"message": ""
}
],
"executorResults": [
{
"executionMethodName": "pageinitMethod",
"successful": true,
"evaluatorResults": [
{
"evaluatorName": "empty",
"score": 100.0
}
],
"threshold": 0.0,
"confidenceScore": 100.0,
"totalEvals": 1.0,
"actionResults": {
"results": [
{
"result": "SUCCESS",
"message": ""
}
]
}
}
],
"actionMessages": [],
"resultCode": "PASS"
}
},
{
"actionId": "1681486871246_JYU07L63KF",
"stepResult": {
"results": [
{
"result": "SUCCESS",
"message": ""
}
],
"executorResults": [
{
"executionMethodName": "verifyAttributes",
"successful": true,
"evaluatorResults": [
{
"evaluatorName": "empty",
"score": 100.0
}
],
"threshold": 0.0,
"confidenceScore": 100.0,
"totalEvals": 1.0,
"actionResults": {
"results": [
{
"result": "SUCCESS",
"message": ""
}
]
}
}
],
"actionMessages": [],
"resultCode": "PASS"
}
}
],
"orchestrationRunId": "",
"TDMdataSetId": "",
"urlOverrideFrom": ""
}
}
The important fields to note:
testResults["result"]
- "PASS" - test is in green and passes successfully
- "FAIL" - test is red and one or more steps fail
- "WARNING" - test is orange and test passes but some steps have critical warning
- "ERROR" - test goes incomplete due to error
variables
- orchestration - coming soon
- project - available across all tests in the project
- iteration - used for looping to keep track of iterations
- team - team level settings
- tdm - variables used for TDM execution
- env - environment variables
- local - available for this specific test
For more information, see https://support.functionize.com/hc/en-us/articles/4411989719575-Expressions-and-Variables
actionResults
This is a list of all actions executed in a test, in order, so the first item in the array will correspond to the first action in the test. This contains information on an action-by-action basis regarding the results of each action.
- actionMessages - any message attached to the action describing the failure or warning
- resultCode - similar to testResults["result"] it can be "PASS", "FAIL", "WARNING", "ERROR", and for action level it can also be "SUPPRESS" if the action is skipped.
- stepResult and executorResult - give some information about internal runtime processes. Only in very advanced use cases would these be needed.
Pre-test Extensions
<Feature coming soon>