Skip to content

Latest commit

 

History

History
455 lines (271 loc) · 11.3 KB

kui_shell_test.CLI.md

File metadata and controls

455 lines (271 loc) · 11.3 KB

Kui API Documentation - v11.0.0 / @kui-shell/test / CLI

Namespace: CLI

@kui-shell/test.CLI

Table of contents

Variables

Functions

Variables

timeout

timeout: number

Defined in

packages/test/src/api/cli.ts:24


waitTimeout

waitTimeout: number

Defined in

packages/test/src/api/cli.ts:25

Functions

command

Const command(cmd, app, noNewline?, noCopyPaste?, noFocus?, block?, currentPrompt?): Promise<{ app: Application = app; count: number }>

Execute a CLI command, and return the data-input-count of that command

Parameters

Name Type Default value
cmd string undefined
app Application undefined
noNewline boolean false
noCopyPaste boolean undefined
noFocus boolean false
block string undefined
currentPrompt string undefined

Returns

Promise<{ app: Application = app; count: number }>

Defined in

packages/test/src/api/cli.ts:56


commandInSplit

Const commandInSplit(cmd, app, splitIndex): Promise<{ app: Application = app; count: number } & { splitIndex: number }>

Execute the given command in the given split

Parameters

Name Type
cmd string
app Application
splitIndex number

Returns

Promise<{ app: Application = app; count: number } & { splitIndex: number }>

Defined in

packages/test/src/api/cli.ts:102


exitCode

Const exitCode(statusCode): string | number

Exit code code for the given http status code; this is an identity function; for headless mode, there is the -256 part. See headless.js for the analogous headless implementation.

Parameters

Name Type
statusCode string | number

Returns

string | number

Defined in

packages/test/src/api/cli.ts:179


expandLast

expandLast(app, splitIndex?, N?): Promise<void>

Click to expand the last replayed sample output

Parameters

Name Type Default value
app Application undefined
splitIndex number 1
N number 1

Returns

Promise<void>

Defined in

packages/test/src/api/cli.ts:244


expandNth

expandNth(app, N, splitIndex?): Promise<void>

Click to expand the last replayed sample output

Parameters

Name Type Default value
app Application undefined
N number undefined
splitIndex number 1

Returns

Promise<void>

Defined in

packages/test/src/api/cli.ts:237


expectInput

Const expectInput(selector, expectedText): (app: Application) => Promise<Application>

Parameters

Name Type
selector string
expectedText string

Returns

fn

▸ (app): Promise<Application>

Parameters
Name Type
app Application
Returns

Promise<Application>

Defined in

packages/test/src/api/cli.ts:181


expectInputContext

expectInputContext(res, N, expectedText, exact?): Promise<boolean>

text repl input context text

Parameters

Name Type Default value
res AppAndCount undefined
N number undefined
expectedText string undefined
exact boolean false

Returns

Promise<boolean>

Defined in

packages/test/src/api/cli.ts:193


expectPriorInput

Const expectPriorInput(selector, expectedText): (app: Application) => Promise<Application>

Parameters

Name Type
selector string
expectedText string

Returns

fn

▸ (app): Promise<Application>

Parameters
Name Type
app Application
Returns

Promise<Application>

Defined in

packages/test/src/api/cli.ts:199


getTextContent

Const getTextContent(app, selector): Promise<string>

Parameters

Name Type
app Application
selector string

Returns

Promise<string>

Defined in

packages/test/src/api/cli.ts:157


grabFocus

Const grabFocus(app, currentPromptBlock?, currentPrompt?): Promise<boolean | void>

grab focus for the repl

Parameters

Name Type
app Application
currentPromptBlock string
currentPrompt string

Returns

Promise<boolean | void>

Defined in

packages/test/src/api/cli.ts:28


lastBlock

lastBlock(app, splitIndex?, N?, inNotebook?): Promise<AppAndCount>

Index of last executed block

Parameters

Name Type Default value
app Application undefined
splitIndex number 1
N number 1
inNotebook boolean false

Returns

Promise<AppAndCount>

Defined in

packages/test/src/api/cli.ts:223


makeCustom

Const makeCustom(selector, expect, exact?): Object

wait for the result of a cli.command

Parameters

Name Type
selector string
expect string
exact? boolean

Returns

Object

Name Type
exact boolean
expect string
selector string

Defined in

packages/test/src/api/cli.ts:169


nOfCurrentBlock

nOfCurrentBlock(app, splitIndex?): Promise<number>

Parameters

Name Type Default value
app Application undefined
splitIndex number 1

Returns

Promise<number>

the "N" of the current block

Defined in

packages/test/src/api/cli.ts:215


paste

Const paste(cmd, app, nLines?): Promise<{ app: Application = app; count: number }>

Parameters

Name Type Default value
cmd string undefined
app Application undefined
nLines number 1

Returns

Promise<{ app: Application = app; count: number }>

Defined in

packages/test/src/api/cli.ts:115


waitForRepl

Const waitForRepl(app): Promise<Application>

wait for the repl to be active

Parameters

Name Type
app Application

Returns

Promise<Application>

Defined in

packages/test/src/api/cli.ts:128


waitForSession

Const waitForSession(ctx, noProxySessionWait?): Promise<void>

Wait, if needed, for a proxy session

Parameters

Name Type Default value
ctx ISuite undefined
noProxySessionWait boolean false

Returns

Promise<void>

Defined in

packages/test/src/api/cli.ts:141