Class TestBenchBuildConfigurator

java.lang.Object
com.vaadin.copilot.testrecordergenerator.TestBuildConfigurator
com.vaadin.copilot.testrecordergenerator.testbench.TestBenchBuildConfigurator

public final class TestBenchBuildConfigurator extends TestBuildConfigurator
Adds the TestBench dependency needed by the recorded tests to a Maven or Gradle (Groovy or Kotlin DSL) build.

The recorded tests use the JUnit 5/6 API (BrowserTest), so vaadin-testbench-junit6 is added unless the build already has it or vaadin-testbench-junit5, which provides the same API. The Gradle test task is not changed, as the recorded tests need a running application. The JUnit 4 vaadin-testbench artifact does not run the recorded tests, so a warning is returned when the build uses it.

See Also:
  • Method Details

    • configure

      public static TestBenchBuildConfigurator.Result configure(Path moduleRoot) throws IOException
      Adds the TestBench dependency to the build file in the module root if it is missing.
      Parameters:
      moduleRoot - the module root folder
      Returns:
      the result
      Throws:
      IOException - if the build file cannot be read or written