copy Copy chevron-down
code SDK Referencechevron-right toggle-off ComponentsDropDown The DropDown class provides a clean interface for interacting with generic container elements such as <select> blocks. It includes methods for selection, assertions, and scrolling into view.
Usage : dropdown
The Dropdown class is designed to interact with common drop-down element
To insert a code block with syntax highlighting:
Copy import { oi } from " @ordino.ai/spartify-engine " ;
oi . ui . dropdown ( this . ddl_element ) . click ()
Copy import { oi } from " @ordino.ai/spartify-engine " ;
await oi . ui ( this . page ) . dropdown ( this . ddl_element ) . click ()
openDropdown(): void
Opens the dropdown.
Copy oi . ui . dropdown ( this . element ) . openDropdown ()
Copy await oi . ui ( this . page ) . dropdown ( this . element ) . openDropdown () closeDropdown(): void
Closes the dropdown..
Copy oi . ui . dropdown ( this . element ) . closeDropdown ()
Copy await oi . ui ( this . page ) . dropdown ( this . element ) . closeDropdown () selectByIndex(index: number, forceSelect:boolean): void
Selects an option by its index.
@param {index} – The index of the option to select.
@param {force} – true (optional)
selectByText(text: string, forceSelect:boolean): void
Selects an option by its text.
@param {index} – The index of the option to select.
@param {force} – true (optional)
selectByValue(value: string , forceSelect:boolean): void
Selects an option by its value.
@param {value} – The value of the option to select.
@param {force} – true (optional)
filterByText(text: string , forceSelect:boolean): void
Filters options by text.
@param {text} – The text to filter options by.
@param {force} – true (optional)
filterByValue(value: string): void
Filters options by value.
@param {value} – The value to filter options by
filterByPartialText(partialText: string): void
Filters options by partial text.
@param {text} – The partial text to filter options by.
clearSelection(): void
Clears the current selection in the dropdown.
selectRandomOption(): void
Selects a random option from the dropdown.
clickOptionByText(text: string, forceSelect:boolean): void
Clicks an option by its text.
@param {text} – The text to filter options by.
@param {force} – true (optional)
assertSelectedText(text: string): void
Clicks an option by its text.
@param {text} – The partial text to filter options by.
assertSelectedValue(value: string): void
The value to assert against the selected option’s value.
@param {value} – The value to filter options by.
assertContainsOption(value: string): void
Asserts that the dropdown contains an option with the given value.
@param {option} – The value of the option to check for
assertNotContainsOption(value: string): void
Asserts that the dropdown does not contain an option with the given value.
@param {text} – The partial text to filter options by.
assertNotContainsOption(value: string): void
Asserts that the dropdown does not contain an option with the given value.
@param {text} – The value of the option to check for.
assertIsDisabled(): void
Asserts that the dropdown is disabled.
assertIsEnabled(): void
Asserts that the dropdown is enabled.
assertOptionCount(count: number): void
Asserts that the number of options in the dropdown matches the given count
@param {count} – The expected number of options.
assertSelectedByIndex(index: number): void
Asserts that the selected option’s index matches the given index.
@param {index} – The index to assert against the selected option’s index.
assertIsVisible(): void
Asserts that the dropdown is visible.
assertPlaceholder(text: string): void
Asserts that the placeholder text matches the given text.
@param {text} – The placeholder to assert
scrollToOption(value: string): void;
Scrolls to an option with the given value.
@param {value} – The value of the option to scroll to.
Ordino allows you to build custom actions or user journeys by directly interacting with the underlying tool’s native methods and actions.
This approach gives you full control, bypassing Ordino’s abstraction layer, and ensures you can leverage tool-specific capabilities as needed.
locator → The element locator (e.g., XPath, CSS selector, or tool-specific reference).
Returns → A tool element object on which you can invoke native actions (e.g., .click(), .type()).
Ordino Custom Mode
Using Ordino’s direct tool method reference:
Here, Ordino will call the Cypress (or other tool) element object directly, rather than going through Ordino’s wrapper.
Building User Journeys
By chaining multiple oi.ui.element() calls, you can construct full user journeys while still working with native tool methods .
Example: Login Flow
Use this mode when you need maximum control over the test framework.
This does not abstract or transform the call – it executes directly on the tool object (e.g., Cypress, Playwright, etc.).
Perfect for custom journeys, advanced locators, or tool-specific actions not exposed by Ordino’s higher-level API.
Last updated 5 months ago