ui tests
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-09-15 15:47:58 -04:00
parent a7c8571afa
commit 963e8b6585
17 changed files with 191 additions and 9 deletions

View File

@ -766,6 +766,8 @@ Fix all items spawning above player head
Fix items falling below terrain
Fix gridded data cell manager saving attached items on realm save
Fix render signals caching between frames (not reseting global flags per usual)
Capture image from opengl to pixel-check
Add ui tests
# TODO
@ -778,11 +780,6 @@ Ability to fully reload game engine state without exiting client
- Back out to main menu and load a new level without any values persisting
- Receive a teleport packet from server and flush all game state before requesting state from server again
Unit Testing
- Capture image from opengl to pixel-check
- Ability to click through the ui via scripts
- Add ui tests
Bug Fixes
- Fix hitbox placement does not scale with entity scale on server
- Fix not all grass tiles update when updating a nearby voxel (ie it doesn't go into negative coordinates to scan for foliage updates)

View File

@ -5,7 +5,6 @@ import org.joml.Vector3d;
import electrosphere.client.collision.ClientHitboxCollision;
import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.logger.LoggerInterface;
import electrosphere.net.parser.net.message.CombatMessage;
import electrosphere.net.template.ClientProtocolTemplate;
@ -28,8 +27,6 @@ public class CombatProtocol implements ClientProtocolTemplate<CombatMessage> {
Entity receiverEntity = Globals.clientSceneWrapper.getEntityFromServerId(message.getreceiverEntityID());
if(senderEntity != null && receiverEntity != null){
ClientHitboxCollision.handleHitboxCollision(senderEntity, receiverEntity, position, message.gethitboxType(), message.gethurtboxType());
} else {
LoggerInterface.loggerEngine.WARNING("Received collision event for entities that are undefined! " + senderEntity + " " + receiverEntity);
}
} break;
}

View File

@ -0,0 +1,26 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the button ui component
*/
public class ButtonTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
WindowUtils.replaceMainMenuContents(Button.createButton("test", () -> {}));
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/button1.png");
}
}

View File

@ -0,0 +1,26 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the image panel ui component
*/
public class ImagePanelTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
WindowUtils.replaceMainMenuContents(ImagePanel.createImagePanelAbsolute(0,0,50,50,"Textures/default_diffuse.png"));
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/imagepanel1.png");
}
}

View File

@ -0,0 +1,26 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the label ui component
*/
public class LabelTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
WindowUtils.replaceMainMenuContents(Label.createLabel("Test Label"));
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/label1.png");
}
}

View File

@ -0,0 +1,27 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the text box ui component
*/
public class TestBoxTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
WindowUtils.replaceMainMenuContents(TextBox.createTextBox("test text", false));
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/textbox1.png");
}
}

View File

@ -0,0 +1,29 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the text input ui component
*/
public class TestInputTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
TextInput input = TextInput.createTextInput();
input.setText("asdf");
WindowUtils.replaceMainMenuContents(input);
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/textinput1.png");
}
}

View File

@ -0,0 +1,27 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the text input ui component
*/
public class ToggleInputTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
WindowUtils.replaceMainMenuContents(ToggleInput.createToggleInput());
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/toggleinput1.png");
}
}

View File

@ -24,7 +24,7 @@ public class WindowTest extends UITestTemplate {
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(60);
TestEngineUtils.simulateFrames(1);
// TestRenderingUtils.saveTestRender("./test/java/renderer/ui/elements/window.png");
this.checkRender("Basic", "./test/java/renderer/ui/elements/ui-test.png");

View File

@ -0,0 +1,27 @@
package electrosphere.renderer.ui.elements;
import electrosphere.menu.WindowUtils;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.UITestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests the text box ui component
*/
public class WordTests extends UITestTemplate {
@IntegrationTest
public void test_Create(){
//setup
this.setupBlankView();
WindowUtils.replaceMainMenuContents(Word.createWord("some word"));
//wait for ui updates
TestEngineUtils.flush();
TestEngineUtils.simulateFrames(1);
this.checkRender("Basic", "./test/java/renderer/ui/elements/word1.png");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB