package com.example;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.vaadin.testbench.TestBench;
import com.vaadin.testbench.TestBenchTestCase;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.testbench.parallel.Browser;

/**
 * @author Vaadin Ltd
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class VaadinSpringBootSmokeIT extends TestBenchTestCase {

    @LocalServerPort
    Integer port;

    @Before
    public void setUp() {
        setDriver(TestBench.createDriver(new PhantomJSDriver(
                Browser.PHANTOMJS.getDesiredCapabilities())));
    }

    @Test
    public void testPageLoadsAndButtonWorks() {
        getDriver().navigate().to("http://localhost:" + port + "");
        $(ButtonElement.class).first().click();
        Assert.assertTrue($(NotificationElement.class).exists());
        Assert.assertEquals(ThankYouService.THANK_YOU_TEXT,
                $(NotificationElement.class).first().getText());
    }
}

@@ -65,16 +65,39 @@
 Before;%0A
+import org.junit.Rule;%0A
 import o
@@ -107,24 +107,24 @@
 junit.Test;%0A
-
 import org.j
@@ -474,16 +474,69 @@
 unner;%0A%0A
+import com.vaadin.testbench.ScreenshotOnFailureRule;%0A
 import c
@@ -904,16 +904,16 @@
 M_PORT)%0A
-
 public c
@@ -970,16 +970,133 @@
 Case %7B%0A%0A
+    @Rule%0A    public ScreenshotOnFailureRule screenshotRule = new ScreenshotOnFailureRule(%0A            this, true);%0A%0A
     @Loc

Add missing ScreenshotRule to Spring integration test (#8455)