The Versatility of AuroraTests
AuroraTests is continually evolving to support an increasingly versatile range of HMI testing scenarios. In our previous posts, we explored how AuroraTests enables touch simulations as the primary input for user actions to the HMI System Under Test (SUT). But AuroraTests goes beyond touch-based inputs, incorporating a wider range of standard user inputs, including traditional physical keyboards and mouse.
AuroraTests can simulate these inputs at both the software and hardware levels. This expanded input support allows testers to perform more versatile and comprehensive automated testing across various types of user interactions, bringing flexibility and depth to HMI testing.
In this post, we’ll demonstrate how AuroraTests can simulate mouse and keyboard inputs in automated testing scenarios.
The HMI Testing Scenarios in Action
Our SUT for this demo is an HMI application built using the Ignition HMI framework from Inductive Automation, running on a standard PC with Ubuntu OS. This setup enables us to illustrate different scenarios to verify core functionalities under various user input conditions.
To showcase AuroraTests’ expanded input capabilities, we’ll walk you through two main test scenarios highlighting the use of both physical and on-screen keyboards:
- Login and navigate the app using a simulated physical keyboard and mouse.
- Login and perform the same actions using a screen keyboard, controlled via simulated mouse clicks.
Let’s start by defining our test scenarios and their associated test cases.
Test Scenario #1: Login Using Physical Keyboard
The first test scenario uses a physical keyboard and mouse for logging in and navigating the application.
Test Case | Given | When | Then |
Login | App is started, and the login menu is displayed. | Enter credentials (username and password) using the physical keyboard, then click the “Login” button. | The user is logged in, and the main screen is displayed. |
“Hello World“ | Main screen is displayed and the “Empty” tab is selected. | Click the “Say Hello” button. | “Hello World” text appears. |
Exit | “Command” menu is selected. | Click the “Exit” sub-menu command. | App exits successfully. |
Test Scenario #2: Login Using On-Screen Keyboard
Test Case | Given | When | Then |
Login | App is started, login menu is displayed, and the screen keyboard is activated. | Enter credentials (username and password) using the screen keyboard, then click the “Login” button. | The user is logged in, and the main screen is displayed. |
“Hello World“ | Main screen is displayed, “Empty” tab is selected. | Click the “Say Hello” button. | The “Hello World” text is displayed. |
Exit | “Command” menu is selected. | Click the “Exit” sub-menu command. | App exits successfully. |
As presented, both test scenarios follow the same flow, with the only key difference being the input method (Test Scenario #2 – the activation of the screen keyboard). This minor variation showcases how easily AuroraTests adapts to different user input methods, supporting flexible test configurations.
The HMI Testing Scenarios Code
Now, let’s see how AuroraTests translates these scenarios into executable automated tests code. Each scenario is implemented using AuroraTests, allowing us to demonstrate how simple it is to switch between input types in a single test framework.
Code for Physical Keyboard and Mouse Scenario
# Test scenario using a physical keyboard for login and main screen actions
def test_hello_world_physical_keyboard(display, mouse, keyboard, resources):
# Start the Ignition HMI application
start_hmi_app(resources)
# Use the provided physical keyboard for this test
used_keyboard = keyboard
login_logic(display, mouse, used_keyboard, resources)
hello_world(display, mouse, resources)
exit_logic(display, mouse, resources)
Code for Screen Keyboard Scenario
# Test scenario using a screen keyboard for login and main screen actions
def test_hello_world_screen_keyboard(display, mouse, resources):
# Start the Ignition HMI application
start_hmi_app(resources)
# Use a ScreenKeyboard instance for this test
used_keyboard = ScreenKeyboard(display, mouse, resources)
login_logic(display, mouse, used_keyboard, resources)
hello_world(display, mouse, resources)
exit_logic(display, mouse, resources)
In both test functions, the core logic remains identical, differing only in input methods (physical keyboard vs. screen keyboard). This highlights AuroraTests’ versatility, demonstrating the ease of switching between user input devices within a single framework.
Key Takeaways: Extending HMI Testing Scenarios with AuroraTests
With AuroraTests, your HMI testing isn’t limited to touch interactions alone. By incorporating keyboard, mouse, and additional input types, AuroraTests ensures comprehensive and adaptable test coverage for any HMI application or system.
This flexibility enables testers to simulate real-world scenarios across diverse interfaces, allowing early detection of potential issues and enhancing user experience.
For developers interested in the technical details, the full source code from this post is available on our GitHub. Additionally, you can view a recorded video of the HMI tests execution to see AuroraTests in action.
Ready to Enhance Your HMI Testing?
Take your HMI testing to the next level with AuroraTests. Our team is ready to support you in implementing efficient, automated tests that enhance the performance of your HMI projects. Contact us at info@datajob.se for more information or schedule a personalized demo, and unlock the full potential of your HMI testing strategy.
Stay tuned for upcoming posts as we dive into more advanced test cases and explore further possibilities with AuroraTests!