Class BrowserlessTestCreator
java.lang.Object
com.vaadin.copilot.testrecordergenerator.browserless.BrowserlessTestCreator
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe result of creating a test. -
Constructor Summary
ConstructorsConstructorDescriptionBrowserlessTestCreator(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinContext context) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncreate(TestRecorderScenario scenario, String fallbackViewFqn) Generates the test and configures the build.static StringgetDefaultTestClassName(String viewFqn) Gets the default test class name for a view.
-
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 usercontext- 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 scenariofallbackViewFqn- 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
Gets the default test class name for a view.- Parameters:
viewFqn- the view class name, can be null- Returns:
- the test class name
-