Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9e42dde
New branch and updated output format
Mar 4, 2026
43c2d8f
Add initial Playwright output support
FredRaw Mar 5, 2026
444d280
Add support for Playwright.
Mar 16, 2026
e780704
Fix header handling, send body, and test initialization for Playwright
Mar 18, 2026
a345275
Fix duplicate playwright entry
Mar 19, 2026
c5842f5
Add support for Playwright
Mar 19, 2026
cbf837b
Add support for Playwright
Mar 19, 2026
2ac346d
Add support for Playwright
Mar 19, 2026
1f0563b
Rewrite of existing support for Playwright, add Playwright support fo…
Mar 20, 2026
4969fb6
Add lombok
Mar 24, 2026
a3b7898
Merge branch 'master' into testify/playwright
Mar 24, 2026
8234fc3
added possible fixes for playwright code
FredRaw Apr 13, 2026
158e195
Add Playwright library to core-tests/e2e-tests/spring/spring-rest-bb/…
Apr 23, 2026
42c8bc7
Merge branch 'master' into testify/playwright
Apr 23, 2026
e666fb6
updated release.yml to include changes from master branch
FredRaw Apr 24, 2026
b8dc0a3
re-introduced if(nody.isNotBlank()) test to avoid failure of testInAc…
FredRaw Apr 27, 2026
188b96a
BlackBoxUtils.kt: Add base location and relative path for Playwright …
May 7, 2026
cd595a8
Merge branch 'master' into testify/playwright
May 7, 2026
ce12797
All changes only made to playwright code. Will hopefully fix BB test …
May 12, 2026
b8faf64
Merge branch 'master' into testify/playwright
May 13, 2026
21290a0
Merge branch 'master' into testify/playwright
May 19, 2026
0a9d352
Merge branch 'master' into testify/playwright
arcuri82 May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ object BlackBoxUtils {
private const val GENERATED_FOLDER_NAME = "generated"

const val baseLocationForJavaScript = "$JS_BASE_PATH/$GENERATED_FOLDER_NAME"
const val baseLocationForPlaywright = "$JS_BASE_PATH/$GENERATED_FOLDER_NAME/playwright"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the need for a new folder location instead of using same baseLocationForJavaScript? also, if really need new folder, should had written like:

const val baseLocationForPlaywright = "$baseLocationForJavaScript/playwright"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To isolate the playwright tests and avoid overwriting other tests. But if that's not required, I'll remove it. Or use your suggestion.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkugelstad thx. that shouldn't be necessary, as anyway we do a FileUtils.deleteDirectory(folder.toFile()) in SpringTestBase before each test case execution

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing baseLocationForPlaywright in new commit

const val baseLocationForPython = "$PY_BASE_PATH/$GENERATED_FOLDER_NAME"
const val baseLocationForJava = "$MAVEN_BASE_PATH/src/test/java"
const val baseLocationForKotlin = "$MAVEN_BASE_PATH/src/test/kotlin"

fun relativePath(folderName: String) = "$GENERATED_FOLDER_NAME/$folderName"

fun relativePathPlaywright(folderName: String) = "$GENERATED_FOLDER_NAME/playwright/$folderName"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comment. this function might not be needed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing relativePathPlaywright in new commit ref previous comment


fun checkCoveredTargets(targetLabels: Collection<String>) {
targetLabels.forEach {
assertTrue(CoveredTargets.isCovered(it), "Target '$it' is not covered")
Expand All @@ -36,7 +39,6 @@ object BlackBoxUtils {

private fun mvn() = if (isWindows()) "mvn.cmd" else "mvn"


private fun runNpmInstall() {
val command = listOf(npm(), "ci")

Expand Down Expand Up @@ -120,6 +122,20 @@ object BlackBoxUtils {
runTestsCommand(command, JS_BASE_PATH, "NPM")
}

fun runPlaywrightTests(folderRelativePath: String) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this function and not using runNpmTests()? aren't tests generated for JS_JEST_PLAYWRIGHT valid jest tests? why do they require to run npx playwright instead of using npm test?
add comments to clarify and explain the reason

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx playwright test is the recommended command (ref Playwright documentation), e.g. when using this command there is no need for a script in package.json. However, I've refactored runNpmTests to include Plawyright, and included a playwright script in package.json. Tests locally look promising, so will commit and verify in CI.

runNpmInstall()

val path = if(folderRelativePath.endsWith("/")){
folderRelativePath
} else {
"$folderRelativePath/"
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code here seems duplicated from runNpmTests(). if indeed this function is needed (see previous comment) than should refactor (eg a single function with possible more parameters) to avoid code duplication

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment


val npx = if (isWindows()) "npx.cmd" else "npx"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have fun npm() and fun mvn(). for consistency should introduce fun npx()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is removed in new commit due to refactoring of runNpmTests.

val command = listOf(npx, "playwright", "test", path)
runTestsCommand(command, JS_BASE_PATH, "Playwright")
}

fun runPythonTests(folderRelativePath: String) {
installPythonRequirements()

Expand Down Expand Up @@ -151,4 +167,4 @@ object BlackBoxUtils {

fun getOutputFilePrefixKotlin(outputFolderName: String) = "com.kotlin.$outputFolderName.EM"

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ abstract class SpringTestBase : GraphQLTestBase() {
lambda: Consumer<MutableList<String>>
){
val baseLocation = when {
outputFormat.isPlaywright() -> BlackBoxUtils.baseLocationForPlaywright
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should avoid switches that are order dependent. for example, currently all formats that satisfy isPlaywright() also satisfy isJavaScript().
if indeed playwright here needs to be handle differently (see previous comments) should rather have something like:

outputFormat.isJavaScript() && outputFormat.isPlaywright() -> BlackBoxUtils.baseLocationForPlaywright
outputFormat.isJavaScript() && !outputFormat.isPlaywright()-> BlackBoxUtils.baseLocationForJavaScript

note that in future we might have palywright tests that are not related to JS

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In new commit outputFormat.isJavaScript() has been refactored to include Playwright so that baseLocationForJavaScript will be used for both.

outputFormat.isJavaScript() -> BlackBoxUtils.baseLocationForJavaScript
outputFormat.isPython() -> BlackBoxUtils.baseLocationForPython
else -> throw IllegalArgumentException("Not supported output type $outputFormat")
Expand All @@ -100,6 +101,7 @@ abstract class SpringTestBase : GraphQLTestBase() {
fun runGeneratedTests(outputFormat: OutputFormat, outputFolderName: String){

when{
outputFormat.isPlaywright() -> BlackBoxUtils.runPlaywrightTests(BlackBoxUtils.relativePathPlaywright(outputFolderName))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New commit includes outputFormat.isPlaywright() still, but without runPlaywrightTests and relativePathPlaywright as these have been removed ref previous comments. Testing locally indicates slightly different handling is required for Playwright, i.e. isPlaywright = true'

outputFormat.isJavaScript() -> BlackBoxUtils.runNpmTests(BlackBoxUtils.relativePath(outputFolderName))
outputFormat.isPython() -> BlackBoxUtils.runPythonTests(BlackBoxUtils.relativePath(outputFolderName))
else -> throw IllegalArgumentException("Not supported output type $outputFormat")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"author": "EvoMaster Team",
"license": "LGPL-3.0-only",
"devDependencies": {
"@playwright/test": "^1.59.1",
"jest": "29.7.0",
"superagent": "9.0.2",
"supertest": "7.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { defineConfig } = require('@playwright/test');

module.exports = defineConfig({
testDir: './generated',
testMatch: /.*[tT]est\.js/,
});
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ abstract class SpringTestBase : RestTestBase() {
}
}


fun runBlackBoxEM(
outputFormat: OutputFormat,
outputFolderName: String,
Expand All @@ -160,6 +159,7 @@ abstract class SpringTestBase : RestTestBase() {
lambda: Consumer<MutableList<String>>
){
val baseLocation = when {
outputFormat.isPlaywright() -> BlackBoxUtils.baseLocationForPlaywright
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comments on use of .isPlaywright()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In new commit outputFormat.isJavaScript() has been refactored to include Playwright so that baseLocationForJavaScript will be used for both.

outputFormat.isJavaScript() -> BlackBoxUtils.baseLocationForJavaScript
outputFormat.isPython() -> BlackBoxUtils.baseLocationForPython
outputFormat.isJava() -> BlackBoxUtils.baseLocationForJava
Expand All @@ -172,6 +172,7 @@ abstract class SpringTestBase : RestTestBase() {
fun runGeneratedTests(outputFormat: OutputFormat, outputFolderName: String){

when{
outputFormat.isPlaywright() -> BlackBoxUtils.runPlaywrightTests(BlackBoxUtils.relativePathPlaywright(outputFolderName))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comments on use of .isPlaywright()

Copy link
Copy Markdown
Author

@mkugelstad mkugelstad May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New commit includes outputFormat.isPlaywright() still, but without runPlaywrightTests and relativePathPlaywright as these have been removed ref previous comments. Testing locally indicates slightly different handling is required for Playwright, i.e. isPlaywright = true'

outputFormat.isJavaScript() -> BlackBoxUtils.runNpmTests(BlackBoxUtils.relativePath(outputFolderName))
outputFormat.isPython() -> BlackBoxUtils.runPythonTests(BlackBoxUtils.relativePath(outputFolderName))
outputFormat.isJava() -> BlackBoxUtils.runJavaTests(outputFolderName)
Expand Down Expand Up @@ -230,4 +231,4 @@ abstract class SpringTestBase : RestTestBase() {
}
}

}
}
11 changes: 11 additions & 0 deletions core-tests/e2e-tests/spring/spring-rest-rsa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is something that was automatically added (by Maven?) when I initially set up the project. My bad for including it in commit, removed in new commit.

</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -133,6 +134,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this? also, it does not seem related to this PR's goals. if such change was needed for any reason, should had gone in its own separated PR.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment re lombok

<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why hardcoding here a version of lombok that might diverge from the one declared for the dependency?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment re lombok

</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum class OutputFormat {
KOTLIN_JUNIT_4,
KOTLIN_JUNIT_5,
JS_JEST,
JS_JEST_PLAYWRIGHT, // Testing new playwright imp
//CSHARP_XUNIT, //no longer supported, but there is still legacy code not removed
PYTHON_UNITTEST
;
Expand All @@ -28,6 +29,12 @@ enum class OutputFormat {

fun isJavaScript() = this.name.startsWith("js_", true)

/**
* Return true if the output format is Playwright.
* Playwright is currently only supported for JavaScript (or TypeScript).
*/
fun isPlaywright() = this.name.endsWith("_playwright", true) // Testing new playwright imp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is comment // Testing new playwright still relevant?


fun isJavaOrKotlin() = isJava() || isKotlin()

fun isJUnit5() = this.name.endsWith("junit_5", true)
Expand All @@ -40,5 +47,4 @@ enum class OutputFormat {
fun isCsharp() = this.name.startsWith("csharp",ignoreCase = true)

fun isPython() = this.name.startsWith("python_", true)

}
Loading
Loading