Auth0 Angular 10
Apex Designer Documentation
What's New
Getting Started
Business Objects
User Interfaces
App Behaviors
Project Settings
Patterns and Best Practices
App Showcase
Angular 10 Base Library
Frequently Asked Questions

User Interface Test Suite

Blank Profile Image
Written by Kyle Hoskins
Updated a year ago
Less than a minute read

User Interface Test Suite allows for creating unit tests for your Pages and Components.


  • Start by entering what each test should do.  For example: "it should display Hello World."  "it should update the value on button click."
  • You can run your tests manually by clicking the debug icon in the App Manager dialog, or automatically after each build by checking the "Run tests on build" option.
  • Each test runs separately, but if you need to run common code for each test, you can use the "Initialize Test Cases Script" section.
  • Use each test to verify functionality using the expect() function.  For example expect(myValue).toBe('Hello World');
  • "component" and "fixture" are available in every test as documented by Angular.

Helper Functions and Variables

initializeComponent(); // creates the component to be tested

setProperty('myInputString', 'Hello'); // sets a component property value

expect(component.myInputString).toBe('Hello'); // Tests a UI Property Value
expect(component.twoTimesTwoMethod()).toBe(4); // Tests a UI Method Result

expectText('p.myClassName', 'Hello World'); // Tests HTML text content: <p class="myClassName">Hello World</p>

queryElement('.my-class') // returns an HTML Element via querySelector

// testing with a formControl
expectNext(component.formControl.valueChanges, ''); // Runs a test on the next value change
const input = queryElement('input');
setInputValue(input, ''); // updates the input text

expect(component.formControl.value).toBe(''); // Compares the expected form control value



Powered by Apex Designer
Terms of ServicePrivacy Policy
© 2017-2024 Apex Process Consultants