Class TestSourceCleaner
java.lang.Object
com.vaadin.copilot.plugins.testgeneration.TestSourceCleaner
Trims the view source and the rendered DOM before they are sent to the
Copilot server for test generation, so the prompt carries only what matters.
-
Method Summary
-
Method Details
-
cleanJavaCode
Strips comments and superfluous whitespace from Java source.- Parameters:
sourceCode- the source to clean- Returns:
- the cleaned source, or the input unchanged if it cannot be parsed
-
cleanHtml
Removes dev-tools markup, presentational attributes and generated ids from the rendered DOM.- Parameters:
html- the outer HTML of the view- Returns:
- the cleaned, whitespace-collapsed HTML
-