-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hey, I think integration testing for plugins could be pretty useful and wondered if there will be a 1.20 support in the future
And I wondered if there is a way to simulate player activity.
For example I have this editor where players can right click a block to create a graph node in their world (used for citizens pathfinding and stuff). Could I possibly simulate a right click on a block from a player?
And if you really wanted to go crazy, there could be a record functionality to generate test classes based on what I do ingame. Like spigottester --record create graph node, then type command, right click block, what ever. then spigottester --stop generates a java.class file in the plugin dir that contains a list of player action simulations like
@Test("create graph node")
public void testCreateGraphNode() {
Player playerA = addPlayer("a");
Simulator simA = new Simulator();
simA .command("abc");
simA .chat("hello world");
// use primitive parameters to allow client side entity testing, like if there is a clientside display entity that can be clicked
// its basically parsed packet information instead of parsed event information, so its recording incoming packets and simulating them later
simA .interactBlock(ClickType.RIGHT_CLICK, "world", 0.123d, 1.234d, 2.345d);
simA .interactEntity(ClickType.RIGHT_CLICK, 123);
}of course the assertions must be added by hand but it would help a lot to quickly do your usual tests by hand but record them at the same time.
I'd love to help you out and am more than willing to try the record feature but I'm trying to avoid nms at all cost and would hope that you could add 1.20 support