Test Runner PlayMode tests folder? (2017.4)

Hi,
i recently discovered playmode tests and really like the idea.
I just can't seem to find a way to correctly put them anywhere.
When i place them inside an Editor folder they don't get listed in the playmode section but in the edit mode section, when i place them outside i can't build the player (Unity*Engine*.TestTools not found ? and NUnit being editor only).
In the end i wrapped the whole file in #if EDITOR, but this doesn't feel like the correct way of doing it.
Is there any other/right way to go about this?

ping

ping

ping

I think the manual tells you everything what you need to know, including where to put the scripts. Read it.
https://docs.unity3d.com/Manual/testing-editortestsrunner.html

After re-reading this i still couldn't get it to work. I prepared an example project, maybe you can tell me what i'm doing wrong?
(It's 2017.4 btw, the link you gave was for the most recent version)

3877582--329335--TestTest.zip (20.4 KB)

Hey,

I would imagine I am a little bit late on this, but in case someone else runs into this, you can solve by:
This should not happen to projects by default unless you explicitly disabled the test runner :/

Open Library/ProjectSettings.asset with text editor. Find playModeTestRunnerEnabled flag inside it and set to '1'
Then save the file.

1 Like

[quote=“gintautass”, post:7, topic: 719228]
Hey,

I would imagine I am a little bit late on this, but in case someone else runs into this, you can solve by:
This should not happen to projects by default unless you explicitly disabled the test runner :confused:

Open Library/ProjectSettings.asset with text editor. Find playModeTestRunnerEnabled flag inside it and set to ‘1’
Then save the file.
[/quote]
I thought that the play mode test runner could be enabled from the UI ? or was this option removed ?

[quote=“liortal”, post:8, topic: 719228]
I thought that the play mode test runner could be enabled from the UI ? or was this option removed ?
[/quote]

It can be enabled from the UI. The workaround mentioned by @gintautass is for the case when someone intentionally disabled the Test Runner, which might not be the case here. Let’s see if @Flavelius comes back with an answer.

Not sure what changed (i did not disable it manually, i recall not even having/seeing this option), but downloading what i attached to the last post again and running it with the latest 2017.4 version works without problems.