Frontend Testing Challenges Solved by Menditect
Fragility
Fragility is the problem of keeping Locators up-to-date when (Pages in) the App under test is constantly being changed. If the Page structure changes, the location of Widgets also changes.
MTA's solution for robust locators
Instead of scanning the generated HTML in the page and building a page object model from this, manually or assisted by AI, MTA 3.0 uses the page structure and widgets from the Mendix model to create highly reliable locators. This approach ensures that the locators always correspond to the underlying Mendix model and makes the use and updates for these locators as easy as possible. How does MTA 3.0 do this?
- MTA generates locators directly from the widgets in the Mendix model. Generated locators, based on the Mendix model structure, are a robust alternative for data-test-id locators, because they are generated by the Mendix platform and identical for all widgets of the same widget type. MTA supports all standard Mendix platform supported widgets and is extensible with your own custom built Mendix pluggable widgets.
- MTA can test the conditional visibility of widgets: by setting users (user role) and test data (data driven testing) MTA is capable of asserting whether a widget should be visible or not and therefore it can test the conditional visibility of widgets of your Mendix app
- MTA only lists locatable widgets: MTA intelligently identifies which widgets within your page structure are reliably locatable and which are not.
- MTA provides visual feedback for ambiguous Locators: To aid testers, MTA provides visual feedback for widgets that might have more than one potential locator, guiding them to choose the most robust option.
- MTA provides a Mendix widget inspector: By utilizing the Mendix Widget Inspector (available for Chrome and Firefox), MTA can detect visible widgets, their unique names, and their multiplicity on a specific page.
- MTA detects the structure of nested widgets: MTA leverages page structure and widget types to detect nested widgets that require a more advanced and resilient locator strategy. Self healing of tests with MTA
- MTA provinces self-healing widget name changes: MTA automatically adapts to and “self-heals” tests when widget names are changed during application updates, preventing unnecessary test failures.
- MTA detects removed widgets: MTA can detect when widgets have been removed from the application, allowing for proactive test suite adjustments. In a future release MTA will include the ability to self-heal locators for nested widgets where the nesting structure has changed.
Flakiness
Flakiness is the problem that the same test can either fail or pass, without any changes in the software code. If Widgets take longer to render (wait condition dependency) or data is still being processed (race condition), the result can vary.
MTA's solution for flaky test runs
MTA 3.0 builds upon Playwright’s capabilities and introduces specific features to enhance test reliability and eliminate flakiness.
- Intelligent wait conditions from Playwright: MTA leverages Playwright’s intelligent wait conditions, which automatically wait for elements to be actionable before interacting with them, significantly reducing timing-related flakiness.
- Default visibility check: For each locator test step, MTA performs a default visibility check (which can be toggled off if needed). This allows for easy detection of missing element visibility, preventing interactions with hidden or unrendered elements.
- Serial test execution on shared environments: To prevent race conditions, MTA recommends and facilitates running tests serially (not in parallel) on the same test environment, ensuring predictable outcomes.
- Test variations via backend test scripts: MTA enables the execution of test variations or data setup/teardown via faster and more robust backend tests, reducing the reliance on slower and larger frontend test scripts. These backend and frontend actions can be mixed in scripts wherever this is beneficial for executing a faster and more robust test script.