command

#SideeX#file. command

Methods

(static) add(caseIdStringopt, commandDataopt)

Adds a new command to a test case.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
//You need to have a test suite and a test case to add commands.
sideex.file.command.add();
Parameters:
Name Type Attributes Default Description
caseIdString string <optional>
selectedCaseId

Id of the test case to be added the command. selectedCaseId

commandData object <optional>

Details of the command. commandData


(static) changeUsedIndex(usedIndex, type, commandIndexopt, caseIdStringopt)

Changes the index of the locator to select another target or value.

Parameters:
Name Type Attributes Default Description
usedIndex number

Index of the locator that is currently being used

type "target" | "value"

The type to be changed

commandIndex number <optional>
selectedCommandIndex

Index of the command. selectedCommandIndex

caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId


(static) clearAllStatus()

Clears all command status.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.clearAllStatus();

(static) clearStatus(caseIdStringopt)

Clears all command status in a test case.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.clearStatus();
Parameters:
Name Type Attributes Default Description
caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId


(static) copy(srcCaseIdStringopt, srcCommandIndexopt, destCaseIdStringopt, destCommandIndexopt)

Copies a command from a test case to another test case.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.copy("case-0", 1, "case-0", 3);
console.log(sideex.file.testCase.getCasesOrder());
Parameters:
Name Type Attributes Default Description
srcCaseIdString string <optional>
selectedCaseId

Id of the source test case where the command will be copied. selectedCaseId

srcCommandIndex number <optional>
selectedCommandIndex

Index of the source command to be copied. selectedCommandIndex

destCaseIdString string <optional>
selectedCaseId

Id of the destination test case where the command will be pasted. selectedCaseId

destCommandIndex number <optional>
lastCommandIndex

Index for where the command will be pasted. lastCommandIndex


(static) cut(srcCaseIdStringopt, srcCommandIndexopt, destCaseIdStringopt, destCommandIndexopt)

Cuts a command from a test case and paste onto another test case.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.cut("case-0", 1, "case-0", 2);
console.log(sideex.file.testCase.getCasesOrder());
Parameters:
Name Type Attributes Default Description
srcCaseIdString string <optional>
selectedCaseId

Id of the source test case where the command will be cut. selectedCaseId

srcCommandIndex number <optional>
selectedCommandIndex

Index of the source command to be cut. selectedCommandIndex

destCaseIdString string <optional>
selectedCaseId

Id of the destination test case where the command will be pasted. selectedCaseId

destCommandIndex number <optional>
lastCommandIndex

Index for where the command will be pasted lastCommandIndex


(static) delete(commandIndex, caseIdStringopt)

Deletes a command.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.delete(1,"case-0");
console.log(sideex.file.testCase.getCasesOrder());
Parameters:
Name Type Attributes Default Description
commandIndex string

Index of the command to be deleted. commandIndex

caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId


(static) deleteAll(caseIdStringopt)

Deletes all the commands in a test case.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.deleteAll("case-0");
console.log(sideex.file.testCase.getCasesOrder());
Parameters:
Name Type Attributes Default Description
caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId


(static) get(commandIndex, caseIdStringopt) → {object}

Gets the details of a command.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.add();
sideex.file.command.add();
console.log(sideex.file.command.get(1,"case-0"));
Parameters:
Name Type Attributes Default Description
commandIndex string

Index of the command. commandIndex

caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId


Returns:

commandData - Details of the command. commandData

Type
object

(static) getBreakpoint(commandIndex, caseIdStringopt) → {boolean}

Gets the breakpoint status of a command.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.setBreakpoint(true, 0, "case-0");
console.log(sideex.file.command.getBreakpoint(0, "case-0"));
Parameters:
Name Type Attributes Default Description
commandIndex number

Index of the command

caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId


Returns:

commandData.breakpoint - If a breakpoint exists in the command. commandData

Type
boolean

(static) getSelected() → {Array.<string>}

Gets the currently selected commands

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.setSelected("command");
console.log(sideex.file.command.getSelected());
Returns:

commandIdStrings - Id of the commands. commandIdStrings

Type
Array.<string>

(static) setBreakpoint(bool, caseIdStringopt, commandIndexopt)

Sets a breakpoint to a command.

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.setBreakpoint(true, 0, "case-0");
console.log(sideex.file.command.getBreakpoint(0, "case-0"));
Parameters:
Name Type Attributes Default Description
bool boolean

Boolean of breakpoint

caseIdString string <optional>
selectedCaseId

Id of the test case. selectedCaseId

commandIndex number <optional>
selectedCommandIndex

Index of the command. selectedCommandIndex


(static) setSelected(commandIdStrings)

Sets a command to the currently selected commands

Example
import {SideeX} from "@sideex/api"
var sideex = new SideeX(); 
sideex.file.testSuite.add();
sideex.file.testCase.add();
sideex.file.command.add();
sideex.file.command.setSelected("command-0");
console.log(sideex.file.command.getSelected());
Parameters:
Name Type Description
commandIdStrings Array.<string>

Id of the commands. commandIdStrings


Type Definitions

commandData

Properties:
Name Type Description
commandData.id string

Id of the command

commandData.name string

Name of the command

commandData.target object

Target of the command

Properties
Name Type Description
usedIndex number

Index of the locator that is currently being used

options

Locators of target

commandData.value object

Value of the command

Properties
Name Type Description
usedIndex number

Index of the locator that is currently being used

options

Locators of value

commandData.screenshot string

Screenshot of the command

commandData.breakpoint boolean

If a breakpoint exists in the command

commandData.status string

Status of the command

commandData

  • Details of the command
Type:
  • object

commandIdString

commandIdString

  • Id of the command
Type:
  • string

commandIdStrings

commandIdStrings

  • Id of the commands
Type:
  • Array.<string>

lastCommandIndex

lastCommandIndex

  • The last command index in the test case.
Type:
  • number

selectedCaseId

selectedCaseId

  • The test case id that is currently selected
Type:
  • string

selectedCommandIndex

selectedCommandIndex

  • The command index that is currently selected
Type:
  • string