TextBox

The TextBox class provides a streamlined interface for interacting with text input fields. It includes methods for typing, asserting values, and scrolling elements into view. These capabilities improv

Usage : textbox

🧩 Code

The Textbox class is designed to interact with common textbox element

To insert a code block with syntax highlighting:

import { oi } from "@ordino.ai/spartify-engine";

oi.ui.textbox(this.txt_element).enterText(text)

Methods

enterText(text: string): void

Enters the specified text into the textbox.

  • @returns void

oi.ui.textbox(this.txt_element).enterText(text)

clickAndType(text: string, forceClick:boolean): void

Clicks on the textbox and types the given text.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).clickAndType(text)

clearText(): void

Clears the text from the textbox.

  • @returns void

oi.ui.textbox(this.txt_element).clearText()

typeInAll(text: string): void

Types the specified text in all instances of the textbox.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).typeInAll(text)

clickAndTypeFirst(text: string, forceClick:boolean): void

Clicks on the first instance of the textbox and types the given text.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).clickAndTypeFirst(text)

clickAndTypeLast(text: string, forceClick:boolean): void

Clicks on the last instance of the textbox and types the given text.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).clickAndTypeLast(text)

typeAndPressEnter(text: string): void

Types the specified text and presses Enter.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).typeAndPressEnter(text)

typeSlowly(text: string): void

Types the specified text slowly.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).typeSlowly(text)

appendText(text: string): void

Appends the specified text to the existing text in the textbox.

  • @param text – The text to append.

  • @returns void

oi.ui.textbox(this.txt_element).appendText(text)

clearAndType(text: string): void

Clears the existing text and types the specified text.

  • @param text – The text to type.

  • @returns void

oi.ui.textbox(this.txt_element).clearAndType(text)

Assertions

assertPlaceholder(text: string): void

Asserts that the placeholder text of the textbox matches the specified text.

  • @param text – The expected placeholder text.

  • @returns void

oi.ui.textbox(this.txt_element).assertPlaceholder(text)

assertMaxLength(length: number): void

Asserts that the maximum length of the textbox is equal to the specified length.

  • @param length – The expected maximum length.

  • @returns void

oi.ui.textbox(this.txt_element).assertMaxLength(length)

assertIsEmpty(): void

Asserts that the textbox is empty.

  • @returns void

oi.ui.textbox(this.txt_element).assertIsEmpty()

assertIsNotEmpty(): void

Asserts that the textbox is not empty.

  • @returns void

oi.ui.textbox(this.txt_element).assertIsNotEmpty()

assertTextAlignment(alignment: string): void

Asserts that the text alignment of the textbox matches the specified alignment.

  • @param alignment – The expected text alignment.

  • @returns void

oi.ui.textbox(this.txt_element).assertTextAlignment(alignment)

assertCssProperty(property: string, value: string): void

Asserts that the specified CSS property of the textbox matches the expected value.

  • @param property – The CSS property to check.

  • @returns void

oi.ui.textbox(this.txt_element).assertCssProperty(property, value)

Scrolling Actions

scrollToElement(): void

Scrolls to the textbox element.

  • @returns void

oi.ui.textbox(this.btn_element).scrollToElement()

Last updated