Why test runner not working in Unity 6 Preview like in older Versions?

I’m working on a Project in Unity 6 and the test Runner isn’t working.

Unity 6 Version (6000.0.15f)

.asmdef File

{
"name": "PlayModeTests",
"rootNamespace": "",
"references": [
    "UnityEngine.TestRunner",
    "UnityEditor.TestRunner",
    "TestSceneScripts"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
    "nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
    "UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

As you can see I made an Assembly definition in my Scripts Folder and attached it to the Assembly Definition References from the Test Runner Assembly Definition Asset because I thought that might fix the problem.


But the Button in Test Runner for creating Test Scripts the proper way is still greyed out.

I tested everything in older versions (22LTS) and had no problem at all creating a Play Mode Test. Also, the .asmdef File looks very different in older Versions.

{
"name": "Tests",
"optionalUnityReferences": [
    "TestAssemblies"
]
}

Has someone faced this type of issue? What am I doing wrong?

No. It’s the button to quickly create a test script that seemingly isn’t working for you. :wink:

Note that it depends on the selected folder whether this button is available. After you created the test assembly you have to doubleclick (open) the created Test folder with the asmdef inside. Only then will the button to create a script in the “active path” be available because it won’t let you create tests scripts outside of test assemblies.

Hey, thanks for the input. I’m aware of how the test runner works and that the button will not work outside of the test assembly folder. So that’s not the problem I’m facing.

Maybe try the latest 18f1. I use that and didn’t have that issue.
If it still happens check if it also happens in an empty project.

I’ve tested it on several empty projects ( URP, Build-in) with 18.f1 and it still doesn’t work. It will work fine as soon as I test it on older versions. Very strange. Did you changed something in the settings or preferences?

“You” so far no unity employees in this thread.

Id say log a bug.