Tests with test players
Codexe's test players join your test server, run every command and check what you asked for. Add your own tests in words or step by step.
Updated
Codexe can test a project on a real Minecraft server with test players: bots that join your test server, type the commands, write in chat, use items and click menus, and check that what should happen happens. Tests work on Spigot / Paper plugins (Java or Kotlin) and Skript projects.
#Where they are
Open Try it now and pick the Tests tab. It lists:
- Every command: Codexe tries each command the project declares and checks that none of them throws an error.
- What you asked for: tests Codexe writes from your request when it delivers the project, one for each thing you asked for.
- Your own tests, under Add a test.
#Run them
Press Run the tests. If your test server is off it starts first, and it counts as one of today's test servers (limits per plan); for a plugin, Compile the current code first. Join the server too if you want to watch the test players and read the test in chat, or just follow it in the tab.
Each test ends as Passed, Failed or Did not finish, with what the test players did step by step and any error from the plugin. For a failed test Codexe also says whether it thinks the code or the test itself is wrong. Ask the AI to fix it sends the failure to the project chat, ready to send.
When your project changes after a run, the tab says so: run the tests again.
#Add your own tests
Under Add a test:
- Describe it: write what should happen in your own words ("an operator runs /heal and gets full health"). Codexe writes the steps; check them, they are exactly what the test players will do, then Save the test.
- Step by step: pick who acts (a normal player or an operator), an item to give them first if needed, what they do (types a command, writes in chat, uses the item in hand, clicks a slot of the open menu, leaves and joins again) and what must happen (see a message, not see a message, have an item, not have an item, see a menu open).
New tests run with the next run, and every time Codexe delivers a change to the project: before a change reaches you, Codexe runs the tests on the real server and repairs the code when a test fails because of it.
#What tests cannot do
Tests check what players see and get: messages, items, menus. They do not look at the world (blocks, mobs, particles) and do not measure performance; for those, join the test server and try it yourself.