CreateTestCaseCommand

Creates a test case.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AppTestClient, CreateTestCaseCommand } from "@aws-sdk/client-apptest"; // ES Modules import
// const { AppTestClient, CreateTestCaseCommand } = require("@aws-sdk/client-apptest"); // CommonJS import
const client = new AppTestClient(config);
const input = { // CreateTestCaseRequest
  name: "STRING_VALUE", // required
  description: "STRING_VALUE",
  steps: [ // StepList // required
    { // Step
      name: "STRING_VALUE", // required
      description: "STRING_VALUE",
      action: { // StepAction Union: only one key present
        resourceAction: { // ResourceAction Union: only one key present
          m2ManagedApplicationAction: { // M2ManagedApplicationAction
            resource: "STRING_VALUE", // required
            actionType: "Configure" || "Deconfigure", // required
            properties: { // M2ManagedActionProperties
              forceStop: true || false,
              importDataSetLocation: "STRING_VALUE",
            },
          },
          m2NonManagedApplicationAction: { // M2NonManagedApplicationAction
            resource: "STRING_VALUE", // required
            actionType: "Configure" || "Deconfigure", // required
          },
          cloudFormationAction: { // CloudFormationAction
            resource: "STRING_VALUE", // required
            actionType: "Create" || "Delete",
          },
        },
        mainframeAction: { // MainframeAction
          resource: "STRING_VALUE", // required
          actionType: { // MainframeActionType Union: only one key present
            batch: { // Batch
              batchJobName: "STRING_VALUE", // required
              batchJobParameters: { // BatchJobParameters
                "<keys>": "STRING_VALUE",
              },
              exportDataSetNames: [ // ExportDataSetNames
                "STRING_VALUE",
              ],
            },
            tn3270: { // TN3270
              script: { // Script
                scriptLocation: "STRING_VALUE", // required
                type: "Selenium", // required
              },
              exportDataSetNames: [
                "STRING_VALUE",
              ],
            },
          },
          properties: { // MainframeActionProperties
            dmsTaskArn: "STRING_VALUE",
          },
        },
        compareAction: { // CompareAction
          input: { // Input Union: only one key present
            file: { // InputFile
              sourceLocation: "STRING_VALUE", // required
              targetLocation: "STRING_VALUE", // required
              fileMetadata: { // FileMetadata Union: only one key present
                dataSets: [ // DataSetList
                  { // DataSet
                    type: "PS", // required
                    name: "STRING_VALUE", // required
                    ccsid: "STRING_VALUE", // required
                    format: "FIXED" || "VARIABLE" || "LINE_SEQUENTIAL", // required
                    length: Number("int"), // required
                  },
                ],
                databaseCDC: { // DatabaseCDC
                  sourceMetadata: { // SourceDatabaseMetadata
                    type: "z/OS-DB2", // required
                    captureTool: "Precisely" || "AWS DMS", // required
                  },
                  targetMetadata: { // TargetDatabaseMetadata
                    type: "PostgreSQL", // required
                    captureTool: "Precisely" || "AWS DMS", // required
                  },
                },
              },
            },
          },
          output: { // Output Union: only one key present
            file: { // OutputFile
              fileLocation: "STRING_VALUE",
            },
          },
        },
      },
    },
  ],
  clientToken: "STRING_VALUE",
  tags: { // TagMap
    "<keys>": "STRING_VALUE",
  },
};
const command = new CreateTestCaseCommand(input);
const response = await client.send(command);
// { // CreateTestCaseResponse
//   testCaseId: "STRING_VALUE", // required
//   testCaseVersion: Number("int"), // required
// };

CreateTestCaseCommand Input

See CreateTestCaseCommandInput for more details

Parameter
Type
Description
name
Required
string | undefined

The name of the test case.

steps
Required
Step[] | undefined

The steps in the test case.

clientToken
string | undefined

The client token of the test case.

description
string | undefined

The description of the test case.

tags
Record<string, string> | undefined

The specified tags of the test case.

CreateTestCaseCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
testCaseId
Required
string | undefined

The test case ID of the test case.

testCaseVersion
Required
number | undefined

The test case version of the test case.

Throws

Name
Fault
Details
AccessDeniedException
client

The account or role doesn't have the right permissions to make the request.

ConflictException
client

The parameters provided in the request conflict with existing resources.

InternalServerException
server

An unexpected error occurred during the processing of the request.

ServiceQuotaExceededException
client

One or more quotas for AWS Application Testing exceeds the limit.

ThrottlingException
client

The number of requests made exceeds the limit.

ValidationException
client

One or more parameter provided in the request is not valid.

AppTestServiceException
Base exception class for all service exceptions from AppTest service.