Add more UI helper methods for tests (#15463)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Client.Chemistry.UI;
|
||||
using Content.IntegrationTests.Tests.Interaction;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
@@ -22,7 +23,7 @@ public sealed class DispenserTest : InteractionTest
|
||||
Assert.IsNull(Hands.ActiveHandEntity);
|
||||
|
||||
// Open BUI
|
||||
await Interact("");
|
||||
await Interact();
|
||||
|
||||
// Eject beaker via BUI.
|
||||
var ev = new ItemSlotButtonPressedEvent(SharedChemMaster.InputSlotName);
|
||||
@@ -31,5 +32,16 @@ public sealed class DispenserTest : InteractionTest
|
||||
// Beaker is back in the player's hands
|
||||
Assert.IsNotNull(Hands.ActiveHandEntity);
|
||||
AssertPrototype("Beaker", Hands.ActiveHandEntity);
|
||||
|
||||
// Re-insert the beaker
|
||||
await Interact();
|
||||
Assert.IsNull(Hands.ActiveHandEntity);
|
||||
|
||||
// Re-eject using the button directly instead of sending a BUI event. This test is really just a test of the
|
||||
// bui/window helper methods.
|
||||
await ClickControl<ReagentDispenserWindow>(nameof(ReagentDispenserWindow.EjectButton));
|
||||
await RunTicks(5);
|
||||
Assert.IsNotNull(Hands.ActiveHandEntity);
|
||||
AssertPrototype("Beaker", Hands.ActiveHandEntity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user