Kui API Documentation - v11.0.0 / @kui-shell/test / Util
@kui-shell/test.Util
- clickBlockActionButton
- clickNewTabButton
- clickSidecarButtonCustomized
- clickSidecarModeButton
- clickToExpandMonacoFold
- closeAllExceptFirstTab
- copyBlockLink
- doCancel
- doClear
- doList
- expectArray
- expectStruct
- expectSubset
- expectText
- expectYAML
- expectYAMLSubset
- getValueFromMonaco
- listAndOpenSidecarNoWait
- markBlockAsSection
- openSidecarByClick
- outputOf
- removeBlock
- rerunCommand
- switchToTab
- switchToTopLevelTabViaClick
- tabCount
- uniqueFileForSnapshot
- waitForXtermInput
▸ clickBlockActionButton(res, buttonSelector): Promise<void>
Click the specified button action button
| Name | Type |
|---|---|
res |
AppAndCount |
buttonSelector |
string |
Promise<void>
packages/test/src/api/util.ts:317
▸ clickNewTabButton(ctx, expectedNewTabIndex): Promise<Application>
| Name | Type |
|---|---|
ctx |
ISuite |
expectedNewTabIndex |
number |
Promise<Application>
packages/test/src/api/util.ts:490
▸ clickSidecarButtonCustomized(ctx, res, selector): Promise<void>
Click a sidecar button with selector
| Name | Type |
|---|---|
ctx |
ISuite |
res |
AppAndCount |
selector |
string |
Promise<void>
packages/test/src/api/util.ts:446
▸ clickSidecarModeButton(ctx, res, mode): Promise<void>
Click sidecar mode button by mode
| Name | Type |
|---|---|
ctx |
ISuite |
res |
AppAndCount |
mode |
string |
Promise<void>
packages/test/src/api/util.ts:435
▸ clickToExpandMonacoFold(res, lineIdx): Promise<void>
Expand the fold on the given line of a monaco editor
| Name | Type |
|---|---|
res |
AppAndCount |
lineIdx |
number |
Promise<void>
packages/test/src/api/util.ts:183
▸ closeAllExceptFirstTab(expectedInitialNTabs): void
Close all except the first tab
| Name | Type |
|---|---|
expectedInitialNTabs |
number |
void
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
| Name | Type |
|---|---|
res |
AppAndCount |
Promise<void>
packages/test/src/api/util.ts:340
▸ doCancel(cmd): Promise<unknown>
| Name | Type |
|---|---|
cmd |
string |
Promise<unknown>
packages/test/src/api/util.ts:453
▸ doClear(residualBlockCount, splitIndex?): Promise<unknown>
| Name | Type | Default value |
|---|---|---|
residualBlockCount |
number |
undefined |
splitIndex |
number |
1 |
Promise<unknown>
packages/test/src/api/util.ts:483
▸ doList(ctx, command, name): Promise<string>
Execute command and expect a table with name
| Name | Type |
|---|---|
ctx |
ISuite |
command |
string |
name |
string |
Promise<string>
packages/test/src/api/util.ts:371
▸ Const expectArray(expected, failFast?, subset?): (actual: string | string[]) => boolean
is the given actual array the same as the given expected array?
| Name | Type | Default value |
|---|---|---|
expected |
string[] |
undefined |
failFast |
boolean |
true |
subset |
boolean |
false |
fn
▸ (actual): boolean
| Name | Type |
|---|---|
actual |
string | string[] |
boolean
packages/test/src/api/util.ts:157
▸ Const expectStruct(struct1, noParse?, failFast?): (str: string) => boolean
is the given struct2 the same as the given struct2 (given as a string)
| Name | Type | Default value |
|---|---|---|
struct1 |
object |
undefined |
noParse |
boolean |
false |
failFast |
boolean |
true |
fn
▸ (str): boolean
| Name | Type |
|---|---|
str |
string |
boolean
packages/test/src/api/util.ts:119
▸ Const expectSubset(struct1, failFast?): (str: string) => boolean
| Name | Type | Default value |
|---|---|---|
struct1 |
object |
undefined |
failFast |
boolean |
true |
fn
▸ (str): boolean
| Name | Type |
|---|---|
str |
string |
boolean
packages/test/src/api/util.ts:105
▸ Const expectText(app, expectedText, exact?, timeout?): (selector: string) => Promise<Application>
| Name | Type | Default value |
|---|---|---|
app |
Application |
undefined |
expectedText |
string |
undefined |
exact |
boolean |
true |
timeout |
number |
CLI.waitTimeout |
fn
▸ (selector): Promise<Application>
| Name | Type |
|---|---|
selector |
string |
Promise<Application>
packages/test/src/api/util.ts:253
▸ Const expectYAML(struct1, subset?, failFast?): (str: string) => boolean
| Name | Type | Default value |
|---|---|---|
struct1 |
object |
undefined |
subset |
boolean |
false |
failFast |
boolean |
true |
fn
▸ (str): boolean
| Name | Type |
|---|---|
str |
string |
boolean
packages/test/src/api/util.ts:132
▸ Const expectYAMLSubset(struct1, failFast?): (str: string) => boolean
| Name | Type | Default value |
|---|---|---|
struct1 |
object |
undefined |
failFast |
boolean |
true |
fn
▸ (str): boolean
| Name | Type |
|---|---|
str |
string |
boolean
packages/test/src/api/util.ts:154
▸ Const getValueFromMonaco(res, container?): Promise<string>
get the monaco editor text
| Name | Type |
|---|---|
res |
AppAndCount |
container? |
string |
Promise<string>
packages/test/src/api/util.ts:214
▸ listAndOpenSidecarNoWait(ctx, command, name, mode?): Promise<AppAndCount>
Execute command and expect a table with name,
and then open sidecar by clicking the name
| Name | Type |
|---|---|
ctx |
ISuite |
command |
string |
name |
string |
mode? |
string |
Promise<AppAndCount>
packages/test/src/api/util.ts:426
▸ markBlockAsSection(res): Promise<void>
Click the section button on a block, and expect it to be a section
| Name | Type |
|---|---|
res |
AppAndCount |
Promise<void>
packages/test/src/api/util.ts:335
▸ openSidecarByClick(ctx, selector, name, mode?, activationId?, splitIndex?, inNotebook?): Promise<AppAndCount>
| Name | Type | Default value |
|---|---|---|
ctx |
ISuite |
undefined |
selector |
string |
undefined |
name |
string |
undefined |
mode? |
string |
undefined |
activationId? |
string |
undefined |
splitIndex |
number |
2 |
inNotebook |
boolean |
false |
Promise<AppAndCount>
packages/test/src/api/util.ts:380
▸ outputOf(res): Promise<string>
Output of the given block
| Name | Type |
|---|---|
res |
AppAndCount |
Promise<string>
packages/test/src/api/util.ts:363
▸ removeBlock(res): Promise<void>
Click the close button on a block, and expect it to be gone
| Name | Type |
|---|---|
res |
AppAndCount |
Promise<void>
packages/test/src/api/util.ts:330
▸ rerunCommand(res): Promise<void>
Click the section button on a block, and expect it to be a section
| Name | Type |
|---|---|
res |
AppAndCount |
Promise<void>
packages/test/src/api/util.ts:345
▸ switchToTab(mode): (res: AppAndCount) => Promise<AppAndCount>
Switch sidecar tab
| Name | Type |
|---|---|
mode |
string |
fn
▸ (res): Promise<AppAndCount>
| Name | Type |
|---|---|
res |
AppAndCount |
Promise<AppAndCount>
packages/test/src/api/util.ts:350
▸ switchToTopLevelTabViaClick(ctx, N): Promise<unknown>
| Name | Type |
|---|---|
ctx |
ISuite |
N |
number |
Promise<unknown>
packages/test/src/api/util.ts:474
▸ tabCount(app): Promise<number>
| Name | Type |
|---|---|
app |
Application |
Promise<number>
the current number of tabs
packages/test/src/api/util.ts:280
▸ uniqueFileForSnapshot(): string
string
packages/test/src/api/util.ts:312
▸ Const waitForXtermInput(app, N): Promise<boolean>
| Name | Type |
|---|---|
app |
Application |
N |
number |
Promise<boolean>