Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import com.applitools.eyes.BatchInfo;
import com.applitools.eyes.RectangleSize;
import com.applitools.eyes.TestResults;
import com.applitools.eyes.selenium.Eyes;
public class SlackIntegrationTest {
public static void main(String[] args) {
// Build eyes object
Eyes eyes = new Eyes();
// Get Applitools API key from an environment variable
// Create our web driver
ChromeDriver driver = new ChromeDriver();
// set BatchInfo (just for the sake of the example)
BatchInfo bi = new BatchInfo("Hello World");
// Open eyes to get ready to grab screenshots, "My Slack Integration App", "Slack Integration Test", new RectangleSize(800, 600));
// Navigate to the page under test
driver.get(""); // Baseline
//driver.get(""); // Checkpoint
// Grab screenshot and upload to Applitools
// Close web driver
// Close eyes and get the TestResults Object with all the data we need
TestResults testResults = eyes.close(false);
// Post to results to Slack, passing the SLACK_WEBHOOK_URL we are getting from an environment variable , System.getenv("SLACK_WEBHOOK_URL"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.