I built Paperwright: an end-to-end testing framework for Paper plugins using real simulated clients

U

/u/Drownek

Guest
Hey everyone,

If you develop or maintain custom plugins for your servers, you probably know the pain of manual testing. You write a feature, build the jar, restart your local test server, launch multiple test clients to test a trade or click through a custom GUI, realize you missed a null check, and have to do it all over again.

MockBukkit is great for unit testing pure Bukkit API logic, but once you start touching NMS, reflection, or need to test complex GUI interactions alongside other plugins, mock environments usually start to break down.

I wanted to bring modern web-dev testing standards (like Playwright) to Minecraft, so I put together an open-source framework called Paperwright. Instead of mocking the server, it tests your plugin by spinning up a real Paper server and connecting automated, simulated clients via Mineflayer.

What it does:

  • The simulated clients actually join the server, move around, type in chat, and click through GUIs.
  • Tests are written in JS or TS, so if you've used Playwright for web testing, the API will already feel familiar.
  • No more hardcoding exact inventory slots. Locators let you find items dynamically and click them.
  • Assertions are built in, e.g. await expect(player).toContainItem('emerald', { count: 5 });
  • It runs as a Gradle plugin: ./gradlew paperwrightInit gets you set up, and there's an official GitHub Action if you want it running tests on every push.

If you're tired of doing manual QA for every minor plugin update, feel free to check it out.

Repo & Docs: https://github.com/Drownek/paperwright

I'd love to hear your feedback, or answer any questions from other devs here about how it handles the server orchestration under the hood!

submitted by /u/Drownek
[link] [comments]

Continue reading...
 
Back
Top