Namespace: Util

January 18, 2022 · View on GitHub

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

Namespace: Util

@kui-shell/test.Util

Table of contents

Interfaces

Functions

Functions

clickBlockActionButton

clickBlockActionButton(res, buttonSelector): Promise<void>

Click the specified button action button

Parameters

NameType
resAppAndCount
buttonSelectorstring

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:317


clickNewTabButton

clickNewTabButton(ctx, expectedNewTabIndex): Promise<Application>

Parameters

NameType
ctxISuite
expectedNewTabIndexnumber

Returns

Promise<Application>

Defined in

packages/test/src/api/util.ts:490


clickSidecarButtonCustomized

clickSidecarButtonCustomized(ctx, res, selector): Promise<void>

Click a sidecar button with selector

Parameters

NameType
ctxISuite
resAppAndCount
selectorstring

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:446


clickSidecarModeButton

clickSidecarModeButton(ctx, res, mode): Promise<void>

Click sidecar mode button by mode

Parameters

NameType
ctxISuite
resAppAndCount
modestring

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:435


clickToExpandMonacoFold

clickToExpandMonacoFold(res, lineIdx): Promise<void>

Expand the fold on the given line of a monaco editor

Parameters

NameType
resAppAndCount
lineIdxnumber

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:183


closeAllExceptFirstTab

closeAllExceptFirstTab(expectedInitialNTabs): void

Close all except the first tab

Parameters

NameType
expectedInitialNTabsnumber

Returns

void

Defined in

packages/test/src/api/util.ts:286


copyBlockLink(res): Promise<void>

Click the section button on a block, and expect it to be a section

Parameters

NameType
resAppAndCount

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:340


doCancel

doCancel(cmd): Promise<unknown>

Parameters

NameType
cmdstring

Returns

Promise<unknown>

Defined in

packages/test/src/api/util.ts:453


doClear

doClear(residualBlockCount, splitIndex?): Promise<unknown>

Parameters

NameTypeDefault value
residualBlockCountnumberundefined
splitIndexnumber1

Returns

Promise<unknown>

Defined in

packages/test/src/api/util.ts:483


doList

doList(ctx, command, name): Promise<string>

Execute command and expect a table with name

Parameters

NameType
ctxISuite
commandstring
namestring

Returns

Promise<string>

Defined in

packages/test/src/api/util.ts:371


expectArray

Const expectArray(expected, failFast?, subset?): (actual: string | string[]) => boolean

is the given actual array the same as the given expected array?

Parameters

NameTypeDefault value
expectedstring[]undefined
failFastbooleantrue
subsetbooleanfalse

Returns

fn

▸ (actual): boolean

Parameters
NameType
actualstring | string[]
Returns

boolean

Defined in

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


expectStruct

Const expectStruct(struct1, noParse?, failFast?): (str: string) => boolean

is the given struct2 the same as the given struct2 (given as a string)

Parameters

NameTypeDefault value
struct1objectundefined
noParsebooleanfalse
failFastbooleantrue

Returns

fn

▸ (str): boolean

Parameters
NameType
strstring
Returns

boolean

Defined in

packages/test/src/api/util.ts:119


expectSubset

Const expectSubset(struct1, failFast?): (str: string) => boolean

Parameters

NameTypeDefault value
struct1objectundefined
failFastbooleantrue

Returns

fn

▸ (str): boolean

Parameters
NameType
strstring
Returns

boolean

Defined in

packages/test/src/api/util.ts:105


expectText

Const expectText(app, expectedText, exact?, timeout?): (selector: string) => Promise<Application>

Parameters

NameTypeDefault value
appApplicationundefined
expectedTextstringundefined
exactbooleantrue
timeoutnumberCLI.waitTimeout

Returns

fn

▸ (selector): Promise<Application>

Parameters
NameType
selectorstring
Returns

Promise<Application>

Defined in

packages/test/src/api/util.ts:253


expectYAML

Const expectYAML(struct1, subset?, failFast?): (str: string) => boolean

Parameters

NameTypeDefault value
struct1objectundefined
subsetbooleanfalse
failFastbooleantrue

Returns

fn

▸ (str): boolean

Parameters
NameType
strstring
Returns

boolean

Defined in

packages/test/src/api/util.ts:132


expectYAMLSubset

Const expectYAMLSubset(struct1, failFast?): (str: string) => boolean

Parameters

NameTypeDefault value
struct1objectundefined
failFastbooleantrue

Returns

fn

▸ (str): boolean

Parameters
NameType
strstring
Returns

boolean

Defined in

packages/test/src/api/util.ts:154


getValueFromMonaco

Const getValueFromMonaco(res, container?): Promise<string>

get the monaco editor text

Parameters

NameType
resAppAndCount
container?string

Returns

Promise<string>

Defined in

packages/test/src/api/util.ts:214


listAndOpenSidecarNoWait

listAndOpenSidecarNoWait(ctx, command, name, mode?): Promise<AppAndCount>

Execute command and expect a table with name, and then open sidecar by clicking the name

Parameters

NameType
ctxISuite
commandstring
namestring
mode?string

Returns

Promise<AppAndCount>

Defined in

packages/test/src/api/util.ts:426


markBlockAsSection

markBlockAsSection(res): Promise<void>

Click the section button on a block, and expect it to be a section

Parameters

NameType
resAppAndCount

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:335


openSidecarByClick

openSidecarByClick(ctx, selector, name, mode?, activationId?, splitIndex?, inNotebook?): Promise<AppAndCount>

Parameters

NameTypeDefault value
ctxISuiteundefined
selectorstringundefined
namestringundefined
mode?stringundefined
activationId?stringundefined
splitIndexnumber2
inNotebookbooleanfalse

Returns

Promise<AppAndCount>

Defined in

packages/test/src/api/util.ts:380


outputOf

outputOf(res): Promise<string>

Output of the given block

Parameters

NameType
resAppAndCount

Returns

Promise<string>

Defined in

packages/test/src/api/util.ts:363


removeBlock

removeBlock(res): Promise<void>

Click the close button on a block, and expect it to be gone

Parameters

NameType
resAppAndCount

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:330


rerunCommand

rerunCommand(res): Promise<void>

Click the section button on a block, and expect it to be a section

Parameters

NameType
resAppAndCount

Returns

Promise<void>

Defined in

packages/test/src/api/util.ts:345


switchToTab

switchToTab(mode): (res: AppAndCount) => Promise<AppAndCount>

Switch sidecar tab

Parameters

NameType
modestring

Returns

fn

▸ (res): Promise<AppAndCount>

Parameters
NameType
resAppAndCount
Returns

Promise<AppAndCount>

Defined in

packages/test/src/api/util.ts:350


switchToTopLevelTabViaClick

switchToTopLevelTabViaClick(ctx, N): Promise<unknown>

Parameters

NameType
ctxISuite
Nnumber

Returns

Promise<unknown>

Defined in

packages/test/src/api/util.ts:474


tabCount

tabCount(app): Promise<number>

Parameters

NameType
appApplication

Returns

Promise<number>

the current number of tabs

Defined in

packages/test/src/api/util.ts:280


uniqueFileForSnapshot

uniqueFileForSnapshot(): string

Returns

string

Defined in

packages/test/src/api/util.ts:312


waitForXtermInput

Const waitForXtermInput(app, N): Promise<boolean>

Parameters

NameType
appApplication
Nnumber

Returns

Promise<boolean>

Defined in

packages/test/src/api/util.ts:248