mirror of https://github.com/ppy/osu
Add failing test cases
This commit is contained in:
parent
e43ce28ada
commit
f797514bce
|
@ -7,6 +7,7 @@
|
|||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
|
@ -66,6 +67,13 @@ public override void SetUpSteps()
|
|||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPopoverHasFocus()
|
||||
{
|
||||
clickDifficultyPiece(0);
|
||||
velocityPopoverHasFocus();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSingleSelection()
|
||||
{
|
||||
|
@ -133,6 +141,15 @@ private void clickDifficultyPiece(int objectIndex) => AddStep($"click {objectInd
|
|||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
private void velocityPopoverHasFocus() => AddUntilStep("velocity popover textbox focused", () =>
|
||||
{
|
||||
var popover = this.ChildrenOfType<DifficultyPointPiece.DifficultyEditPopover>().SingleOrDefault();
|
||||
var slider = popover?.ChildrenOfType<IndeterminateSliderWithTextBoxInput<double>>().Single();
|
||||
var textbox = slider?.ChildrenOfType<OsuTextBox>().Single();
|
||||
|
||||
return textbox?.HasFocus == true;
|
||||
});
|
||||
|
||||
private void velocityPopoverHasSingleValue(double velocity) => AddUntilStep($"velocity popover has {velocity}", () =>
|
||||
{
|
||||
var popover = this.ChildrenOfType<DifficultyPointPiece.DifficultyEditPopover>().SingleOrDefault();
|
||||
|
|
|
@ -57,6 +57,13 @@ public override void SetUpSteps()
|
|||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPopoverHasFocus()
|
||||
{
|
||||
clickSamplePiece(0);
|
||||
samplePopoverHasFocus();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSingleSelection()
|
||||
{
|
||||
|
@ -181,6 +188,15 @@ private void clickSamplePiece(int objectIndex) => AddStep($"click {objectIndex.T
|
|||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
private void samplePopoverHasFocus() => AddUntilStep("sample popover textbox focused", () =>
|
||||
{
|
||||
var popover = this.ChildrenOfType<SamplePointPiece.SampleEditPopover>().SingleOrDefault();
|
||||
var slider = popover?.ChildrenOfType<IndeterminateSliderWithTextBoxInput<int>>().Single();
|
||||
var textbox = slider?.ChildrenOfType<OsuTextBox>().Single();
|
||||
|
||||
return textbox?.HasFocus == true;
|
||||
});
|
||||
|
||||
private void samplePopoverHasSingleVolume(int volume) => AddUntilStep($"sample popover has volume {volume}", () =>
|
||||
{
|
||||
var popover = this.ChildrenOfType<SamplePointPiece.SampleEditPopover>().SingleOrDefault();
|
||||
|
|
Loading…
Reference in New Issue