Class BrowserlessTestCreator

java.lang.Object
com.vaadin.copilot.testrecordergenerator.browserless.BrowserlessTestCreator

public class BrowserlessTestCreator extends Object
Creates a Browserless test for a recorded scenario: collects the project information from the running application, generates the test and adds the test dependencies to the build.
  • Constructor Details

    • BrowserlessTestCreator

      public BrowserlessTestCreator(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinContext context)
      Creates a new instance.
      Parameters:
      session - the Vaadin session, used to load classes and find the current user
      context - the Vaadin context
  • Method Details

    • create

      public BrowserlessTestCreator.Result create(TestRecorderScenario scenario, String fallbackViewFqn) throws IOException
      Generates the test and configures the build.
      Parameters:
      scenario - the recorded scenario
      fallbackViewFqn - the view where the recording started, if the scenario does not contain it
      Returns:
      the result
      Throws:
      IOException - if a file cannot be read or written
    • getDefaultTestClassName

      public static String getDefaultTestClassName(String viewFqn)
      Gets the default test class name for a view.
      Parameters:
      viewFqn - the view class name, can be null
      Returns:
      the test class name