Salsa Verde translates to "Green Sauce," and if you are looking to create a greenfield UI testing project that is optimized for usage on Sauce Labs, this is a great choice.
This software is currently in its early stages of development, but we consider it to be a Minimum Viable Product and immediately usable in your UI testing efforts. What this means is that we have a long list of features that we are planning to add, and if you would like to use this software it would greatly help us to get feedback and feature requests so we know what to prioritize.
Solution Architects at Sauce Labs get to see many testing frameworks built by our clients. The majority of them do not handle synchronization very well, resulting in an excessive number of flaky tests. The teams that do properly manage the necessary synchronization often do so at the expense of performance. While this is always a worthwhile trade-off (optimize for maintenance costs, not execution costs), you can have both.
When executing locally, wire calls are essentially "free," executing in milliseconds, but when running against a remote server, each round trip takes significantly longer, and this overhead adds up quickly. Watir is a Ruby test library that implemented a successful synchronization optimization approach several years ago. Salsa Verde is leveraging this knowledge to a provide a Java solution. Specific implementation ideas for how to do this been pulled from several sources, including Mineraloil
Version 0.1.0 has been released on Maven; add this to your pom.xml
file:
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>salsa_verde</artifactId>
<version>0.1.0</version>
</dependency>
The test directory has a number of examples to demonstrate usage, but basically the syntax looks like:
Browser browser = new Browser();
PageObject.setBrowser(browser);
browser.goTo("https://www.saucedemo.com/");
userName userName = browser.element(By.id("user-name"));
userName.setText("standard_user");
Element password = browser.element(By.id("password"));
password.setText("secret_sauce");
Element submitButton = browser.element(By.className("btn_action"));
submitButton.click();
Assert.assertEquals("https://www.saucedemo.com/inventory.html", browser.getCurrentUrl())
browser.quit();
There are also a basic DataObject
and PageObject
classes that will allow you to
remove unnecessary details from the text of your tests allowing them to focus on
the actual business logic.
If you are interested in helping moving this project forward don't hesitate to contribute. Have a look into our contribution guidelines and for question please create an issue. Cheers!