I’m proud to announce our new Open Source tool! Masquerade - testing library for CUBA-based applications.
Masquerade is a set of libraries for automating user interface testing and ensuring regressions get caught. You can easily build tests that catch everything from UI changes to database quirks, maintain the test in any JVM language and run them manually or in your CI environment.
The library provides an ability to create UI tests for CUBA-based applications using masquerade-web module. Also, you can create REST-API tests with masquerade-connector module.
Essentially, masquerade is based on well-known libraries such as selenium and retrofit2 and brings a lot of features for testing of CUBA applications. It makes it easier to start writing UI tests without hustle.
If we look closely enough we will see that UI tests could be simple and expressive:
public class LoginWindowTest {
@Test
public void loginTest() {
open("http://localhost:8080/app");
LoginWindow loginWindow = Components.wire(LoginWindow.class);
loginWindow.loginField
.shouldBe(EDITABLE)
.shouldBe(ENABLED);
loginWindow.loginField.setValue("admin");
loginWindow.passwordField.setValue("admin");
loginWindow.rememberMeCheckBox.setChecked(true);
loginWindow.loginSubmitButton
.shouldBe(VISIBLE)
.shouldBe(ENABLED)
.shouldHave(caption("Submit"));
loginWindow.loginSubmitButton.click();
}
}
And no HTML magic required!
We are already using masquerade tool suite for the platform itself. Moreover, it is used in products and projects that we are building at Haulmont for almost a year now.
You can learn more about masquerade on Github and in the demo project.
If you have any questions feel free to ask them here on forum.
Find regressions before your users do!