Constructor
new command()
Methods
add(caseIdStringopt, commandDataopt)
Add a new command to a testcase
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
|
The id of test case to add command |
commandData |
object |
<optional> |
The detail of command |
changeUsedIndex(usedIndex, type, commandIndexopt, caseIdStringopt)
Change the using locator of the target or value
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
usedIndex |
number | The index of locator that currently using |
||
type |
"target" | "value" | The type to change |
||
commandIndex |
number |
<optional> |
selectedCommandIndex
|
The index of command |
caseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case |
clearAllStatus()
clear all commands 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();
clearStatus(caseIdStringopt)
claer all commands status in a testcase
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
|
The id of test case |
copy(srcCaseIdStringopt, srcCommandIndexopt, destCaseIdStringopt, destCommandIndexopt)
Copy 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.copy("case-0", 1, "case-0", 3);
console.log(sideex.file.testCase.getCasesOrder());
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
srcCaseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case to copy |
srcCommandIndex |
number |
<optional> |
selectedCommandIndex
|
The index of command to copy |
destCaseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case to paste |
destCommandIndex |
number |
<optional> |
lastCommandIndex
|
The index of command to paste |
cut(srcCaseIdStringopt, srcCommandIndexopt, destCaseIdStringopt, destCommandIndexopt)
Cut 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.cut("case-0", 1, "case-0", 2);
console.log(sideex.file.testCase.getCasesOrder());
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
srcCaseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case to cut |
srcCommandIndex |
number |
<optional> |
selectedCommandIndex
|
The index of command to cut |
destCaseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case to paste |
destCommandIndex |
number |
<optional> |
lastCommandIndex
|
The index of command to paste |
delete(commandIndex, caseIdStringopt)
Delete 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 | The index of command |
||
caseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case |
deleteAll(caseIdStringopt)
Delete all the commands in a testcase
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
|
The id of test case |
get(commandIndex, caseIdStringopt) → {object}
Get the details of the 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 | The index of command |
||
caseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case |
Returns:
commandData - The detail of command
- Type
- object
getBreakPoint(commandIndex, caseIdStringopt) → {boolean}
Get 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 | The index of command |
||
caseIdString |
string |
<optional> |
selectedCaseId
|
The id of test case |
Returns:
commandData.breakpoint - does it have breakpoint in the command
- Type
- boolean
getSelected() → {Array.<string>}
Get the 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 - The id of commands
- Type
- Array.<string>
setBreakPoint(bool, caseIdStringopt, commandIndexopt)
Set 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
|
The id of test case |
commandIndex |
number |
<optional> |
selectedCommandIndex
|
The index of command |
setSelected(commandIdStrings)
Set the 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> | The id of commands |
Type Definitions
commandData
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
commandData.id |
string | The id of command |
|||||||||
commandData.name |
string | The name of command |
|||||||||
commandData.target |
object | The target of command Properties
|
|||||||||
commandData.value |
object | The value of command Properties
|
|||||||||
commandData.screenshot |
string | The screenshot of command |
|||||||||
commandData.breakpoint |
boolean | does it have breakpoint in the command |
|||||||||
commandData.status |
string | The status of command |
commandData
- The detail of command
Type:
- object
commandIdString
commandIdString
- The id of a command
Type:
- string
commandIdStrings
commandIdStrings
- The id of commands
Type:
- Array.<string>
lastCommandIndex
lastCommandIndex
- The last command index in the test case
Type:
- number
selectedCaseId
selectedCaseId
- The test case id that currently selected
Type:
- string
selectedCommandIndex
selectedCommandIndex
- The command index that currently selected
Type:
- string