<commit_before>// Copyright (c) p<NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings.Sections.Input;
using osu.Game.Tests.Visual.Navigation;

namespace osu.Game.Tests.Visual.Menus
{
    public class TestSceneSideOverlays : OsuGameTestScene
    {
        [SetUpSteps]
        public override void SetUpSteps()
        {
            base.SetUpSteps();

            AddAssert("no screen offset applied", () => Game.ScreenOffsetContainer.X == 0f);
        }

        [Test]
        public void TestScreenOffsettingOnSettingsOverlay()
        {
            AddStep("open settings", () => Game.Settings.Show());
            AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == SettingsPanel.WIDTH * OsuGame.SCREEN_OFFSET_RATIO);

            AddStep("hide settings", () => Game.Settings.Hide());
            AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
        }

        [Test]
        public void TestScreenOffsettingAccountsForKeyBindingPanel()
        {
            AddStep("open settings", () => Game.Settings.Show());<commit_msg>Fix tests executing before overlays load<commit_after>// Copyright (c) <NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings.Sections.Input;
using osu.Game.Tests.Visual.Navigation;

namespace osu.Game.Tests.Visual.Menus
{
    public class TestSceneSideOverlays : OsuGameTestScene
    {
        [SetUpSteps]
        public override void SetUpSteps()
        {
            base.SetUpSteps();

            AddAssert("no screen offset applied", () => Game.ScreenOffsetContainer.X == 0f);
            AddUntilStep("wait for overlays", () => Game.Settings.IsLoaded && Game.Notifications.IsLoaded);
        }

        [Test]
        public void TestScreenOffsettingOnSettingsOverlay()
        {
            AddStep("open settings", () => Game.Settings.Show());
            AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == SettingsPanel.WIDTH * OsuGame.SCREEN_OFFSET_RATIO);

            AddStep("hide settings", () => Game.Settings.Hide());
            AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
        }

        [Test]
        public void TestScreenOffsettingAccountsForKeyBindingPanel()
        {
            AddStep("open settings", () => Game.Settings.Show());
{'fraction_non_alphanumeric': 0.11857142857142858, 'fraction_numerical': 0.0014285714285714286, 'mean_word_length': 2.9786931818181817, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1883844', 'n_tokens_mistral': 789, 'n_tokens_neox': 779, 'n_words': 175}