IonicFormTestUtils
Utility class for testing Ionic dynamic forms
Static Methods
static assertFormValue() | |||||||||
|---|---|---|---|---|---|---|---|---|---|
Asserts that the form has a specific value | |||||||||
Presentation | |||||||||
Parameters
Returnsvoid |
static assertIonicFieldError() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Asserts that an Ionic field shows an error message | ||||||||||||
Presentation | ||||||||||||
Parameters
Returnsvoid |
static assertIonicFieldValue() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Asserts that an Ionic field has a specific value | ||||||||||||
Presentation | ||||||||||||
Parameters
Returnsvoid |
static builder() |
|---|
Creates a new Ionic form config builder |
Presentation |
Returns |
static async createTest() | ||||||
|---|---|---|---|---|---|---|
Creates an Ionic dynamic form test setup with proper providers | ||||||
Presentation | ||||||
Parameters
ReturnsPromise< |
static getFormErrors() | ||||||
|---|---|---|---|---|---|---|
Gets validation errors from the component | ||||||
Presentation | ||||||
Parameters
Returnsany[] |
static getFormValue() | ||||||
|---|---|---|---|---|---|---|
Gets the current form value from the component | ||||||
Presentation | ||||||
Parameters
ReturnsRecord<string, unknown> |
static getIonicFieldElements() | |||||||||
|---|---|---|---|---|---|---|---|---|---|
Gets all Ionic field elements from the fixture | |||||||||
Presentation | |||||||||
Parameters
ReturnsNodeListOf<Element> |
static isFormValid() | ||||||
|---|---|---|---|---|---|---|
Checks if the form is valid | ||||||
Presentation | ||||||
Parameters
Returnsboolean |
static async simulateIonicButtonClick() | |||||||||
|---|---|---|---|---|---|---|---|---|---|
Simulates Ionic button click Works by finding the button (either in shadow DOM or directly) and clicking it | |||||||||
Presentation | |||||||||
Parameters
ReturnsPromise<void> |
static async simulateIonicCheckbox() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Simulates Ionic checkbox toggle Works by finding the checkbox through shadow DOM and toggling it | ||||||||||||
Presentation | ||||||||||||
Parameters
ReturnsPromise<void> |
static async simulateIonicInput() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Simulates user input on an Ionic input field Works by finding the ion-input component and using its public API | ||||||||||||
Presentation | ||||||||||||
Parameters
ReturnsPromise<void> |
static async simulateIonicSelect() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Simulates user selection on an Ionic select | ||||||||||||
Presentation | ||||||||||||
Parameters
ReturnsPromise<void> |
static async simulateIonicToggle() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Simulates Ionic toggle switch Works by finding the toggle through shadow DOM and toggling it | ||||||||||||
Presentation | ||||||||||||
Parameters
ReturnsPromise<void> |
static async waitForInit() | ||||||
|---|---|---|---|---|---|---|
Waits for the Ionic dynamic form to initialize | ||||||
Presentation | ||||||
Parameters
ReturnsPromise<void> |