Class VisualVerificationTest

java.lang.Object
org.vaadin.addons.dramafinder.agent.VisualVerificationTest
All Implemented Interfaces:
AgentReportProvider

@ExtendWith(AgentReporting.class) public abstract class VisualVerificationTest extends Object implements AgentReportProvider
Base class for temporary, agent-driven visual verification tests that run against an already running application.

Unlike the Spring-based integration test base, this class does not boot the application — keeping the app out of the test run is what makes iterations cheap. It launches a Playwright browser, opens a fresh Page per test at a 1920×1080 viewport, and wires in AgentReporting so a failure automatically produces a screenshot, semantic snapshot, and stack trace.

Typical use (a throwaway AgentVerifyIT):


 class AgentVerifyIT extends VisualVerificationTest {
     @Test
     void verifyOrders() {
         open("orders");
         shot("01-order-list");
         GridElement.get(page).assertRowCount(12);
     }
 }
 
The base URL defaults to http://localhost:8080 and can be overridden with the dramafinder.agent.baseUrl system property or the DRAMAFINDER_BASE_URL environment variable. Headless mode follows the same headless / HEADLESS convention as the rest of the library.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.microsoft.playwright.Page
    The active page for the current test.
    protected AgentReport
    The report writer for the current test.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.microsoft.playwright.Page
    The page the extension should screenshot and inspect on failure.
    The report the extension should write the failure bundle into.
    protected String
    The base URL the test connects to.
    protected void
    open(String path)
    Navigate to a path relative to the configured base URL and wait for Vaadin to finish loading.
    protected void
    shot(String name)
    Capture a numbered screenshot into the report directory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • page

      protected com.microsoft.playwright.Page page
      The active page for the current test.
    • report

      protected AgentReport report
      The report writer for the current test.
  • Constructor Details

    • VisualVerificationTest

      public VisualVerificationTest()
  • Method Details

    • open

      protected void open(String path)
      Navigate to a path relative to the configured base URL and wait for Vaadin to finish loading.
      Parameters:
      path - the route path (with or without a leading slash)
    • shot

      protected void shot(String name)
      Capture a numbered screenshot into the report directory.
      Parameters:
      name - a short descriptive name for the interaction point
    • baseUrl

      protected String baseUrl()
      The base URL the test connects to.
      Returns:
      the configured base URL (default http://localhost:8080)
    • agentPage

      public com.microsoft.playwright.Page agentPage()
      Description copied from interface: AgentReportProvider
      The page the extension should screenshot and inspect on failure.
      Specified by:
      agentPage in interface AgentReportProvider
      Returns:
      the active Playwright page, or null if none is available
    • agentReport

      public AgentReport agentReport()
      Description copied from interface: AgentReportProvider
      The report the extension should write the failure bundle into.
      Specified by:
      agentReport in interface AgentReportProvider
      Returns:
      the report instance, or null to let the extension create one from AgentReportProvider.agentPage()