You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Name

Invoke-JS7TestRun

SYNOPSIS

Performs test runs for JS7.

SYNTAX

Invoke-JS7TestRun [[-ControllerId] <Uri>] [[-TestRun] <String>] [[-Count] <Int32>] [[-BatchSize] <Int32>] [[-AtDate] <DateTime>] [[-BaseFolder] <String>] [[-SourceArchive] <String>] [[-SourceDirectory] <String>] [-Recursive] [[-WaitInterval] <Int32>] [-Prepare] [-Run] [-Monitor] [-Check] [-Cleanup] [-Progress] [<CommonParameters>]

DESCRIPTION

The cmdlet is used to automate execution of test cases with JS7.
A test run execution is a loop across a number of test cases for workflows.
Each test case is executed for a number of times that is specified with the -BatchSize parameter (default: 50).
The -Count parameter (default: 1) specifies the number of loops to repeat a test case.
The -SourceDirectory parameter indicates a directory that includes test cases, i.e. .json files for workflows.

Assuming that the source directory with test case files includes 10 workflows then for a -Ccount 5 and
a -BatchSize 100 an overall number of 5000 test cases will be executed in a test run.

When performing test runs by default the cmdlet will perform all steps in a test case lifecycle:

* Prepare: create a test folder in the JOC Cockpit inventory and add test resources such as workflows.
* Run: add orders to the workflows
* Monitor: wait for the test cases to be completed
* Check: check test execution results
* Cleanup: remove any resources of the test case, i.e. any remaining orders and workflows

Each step can be specified individually with the -Prepare, -Run, -Monitor, -Check and -Cleanup parameters.

PARAMETERS

ControllerId

-ControllerId <Uri>
Specifies the ID of a JS7 Controller that was used during installation of the product.
If no ID is specified then the first JS7 Controller registered with JOC Cockpit will be used.

Required?false
Position?1
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

TestRun

-TestRun <String>
Specifies an identifier for the given test run. This identifier is used to create
folders for objects in the JOC Cockpit inventory and it is used to qualify oder IDs.
Choosing a unique identifier simplifies to identify orders created for a given test run
with JOC Cockpit.

Required?false
Position?2
Default valueTest0000000000
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Count

-Count <Int32>
Indicates the number of loops that should be performed for test runs.

Required?false
Position?3
Default value1
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

BatchSize

-BatchSize <Int32>
Indicates the number of orders that are added for each test case in a test run loop.

Required?false
Position?4
Default value100
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

AtDate

-AtDate <DateTime>
Optionally specifies a date for which the test run should be executed.

If -AtDate is specified then the test run steps to monitor, to check and to cleanup are not performed.
Instead the cmdlet can later on be used with the -Check or -Cleanup parameters to verify test results
and to cleanup test resoures.

Required?false
Position?5
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

BaseFolder

-BaseFolder <String>
Specifies the root folder in the JOC Cockpit inventory to which test case resources such as workflows are added.

Required?false
Position?6
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

SourceArchive

-SourceArchive <String>
Specifies a source archive file (in .zip or .tar.gz format) that holds .json files for workflows and
related inventory objects.

The archive file can be created by exporting objects from the JOC Cockpit configuration.

Required?false
Position?7
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

SourceDirectory

-SourceDirectory <String>
Specifies the source directory where test case resources are stored. Test case resources
include .json files for workflows and related inventory objects.

Required?false
Position?8
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Recursive

-Recursive <SwitchParameter>
If this parameter is used then the source directory with test case resource files is
traversed recurisvley for any sub-directories.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

WaitInterval

-WaitInterval <Int32>
The wait interval is applied when monitoring test runs. It specifies the number of seconds
that the cmdlet will wait before repeating the check for running orders.

Required?false
Position?9
Default value10
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Prepare

-Prepare <SwitchParameter>
A test run lifecycle includes the steps to prepare test case resources, to run test cases, to monitor test case execution,
to check test results and to cleanup test resources.

With this parameter the step to prepare test resources only is executed.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Run

-Run <SwitchParameter>
A test run lifecycle includes the steps to prepare test case resources, to run test cases, to monitor test case execution,
to check test results and to cleanup test resources.

With this parameter the step to run test cases only is executed.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Monitor

-Monitor <SwitchParameter>
A test run lifecycle includes the steps to prepare test case resources, to run test cases, to monitor test case execution,
to check test results and to cleanup test resources.

With this parameter the step to monitor test case execution only is executed.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Check

-Check <SwitchParameter>
A test run lifecycle includes the steps to prepare test case resources, to run test cases, to monitor test case execution,
to check test results and to cleanup test resources.

With this parameter the step to check test case results only is executed.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Cleanup

-Cleanup <SwitchParameter>
A test run lifecycle includes the steps to prepare test case resources, to run test cases, to monitor test case execution,
to check test results and to cleanup test resources.

With this parameter the step to cleanup test case resources only is executed.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Progress

-Progress <SwitchParameter>
Specifies that a progress bar is displayed that provides information about the proceeding of test cases.

This parameter is ignored if the -AtDate parameter is used.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

about_JS7

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > Invoke-JS7TestRun -BaseFolder '/TestRuns' -SourceDirectory "Z:\Documents\PowerShell\jstest\TestCases\Instructions" -Recursive -TestRun Test0000000070

Run test cases from any sub-directories of the specified directory recursively and wait for completion to check results and to cleanup test data.

-------------------------- EXAMPLE 2 --------------------------

PS > Invoke-JS7TestRun -BaseFolder '/TestRuns' -SourceDirectory "Z:\Documents\PowerShell\jstest\testcases\instructions" -Recursive -TestRun Test0000000070 -Prepare -Run

Run test cases for the "prepare" and "run" steps only, i.e. the completion of test cases is not waited for and no cleanup is performed.

-------------------------- EXAMPLE 3 --------------------------

PS > Invoke-JS7TestRun -BaseFolder '/TestRuns' -TestRun Test0000000070 -Cleanup

Do not run test cases but perform the "cleanup" step only, i.e. erase the test data from JOC Cockpit.

-------------------------- EXAMPLE 4 --------------------------

PS > Invoke-JS7TestRun -TestRun Test0000000068 -BaseFolder '/TestRuns' -SourceDirectory "Z:\Documents\PowerShell\jstest\testcases\instructions" -Count 1 -AtDate "2020-12-31 01:02:03"

Run a single test case by modifying the batch size to 1 (Default: 100)

  • No labels