Self-healing elements
With custom method wrappers, we can now start to work to reduce the required maintenance in our framework with self-healing elements. These are elements in a user interface that automatically recover from issues without the need for updating the page object model. This can include link elements that have become invalid because the class has changed since the last release. Self-healing elements are designed to improve the testing experience by reducing the need for manual input and allowing the test a better chance to run to completion.
For example, let’s say the Login
button in the last release was a link:
public get lnkSubmit() { return $('//a[text()="submit"]'); }
After this, we call the button that is no longer valid:
// Class switching await helpers.clickAdv(this.lnkSubmit);
Normally, if this element were clicked, it would...