Esempio n. 1
0
        public void TestDeleteViaRightClick()
        {
            AddStep("open menu for top score", () =>
            {
                InputManager.MoveMouseTo(leaderboard.ChildrenOfType <LeaderboardScore>().First());
                InputManager.Click(MouseButton.Right);
            });

            // Ensure the context menu has finished showing
            AddStep("finish transforms", () => contextMenuContainer.FinishTransforms(true));

            AddStep("click delete option", () =>
            {
                InputManager.MoveMouseTo(contextMenuContainer.ChildrenOfType <DrawableOsuMenuItem>().First(i => i.Item.Text.Value.ToString().ToLowerInvariant() == "delete"));
                InputManager.Click(MouseButton.Left);
            });

            // Ensure the dialog has finished showing
            AddStep("finish transforms", () => dialogOverlay.FinishTransforms(true));

            AddStep("click delete button", () =>
            {
                InputManager.MoveMouseTo(dialogOverlay.ChildrenOfType <DialogButton>().First());
                InputManager.Click(MouseButton.Left);
            });

            AddUntilStep("score removed from leaderboard", () => leaderboard.Scores.All(s => s.OnlineScoreID != scores[0].OnlineScoreID));
        }
Esempio n. 2
0
        public void TestDeleteViaRightClick()
        {
            ScoreInfo scoreBeingDeleted = null;

            AddStep("open menu for top score", () =>
            {
                var leaderboardScore = leaderboard.ChildrenOfType <LeaderboardScore>().First();

                scoreBeingDeleted = leaderboardScore.Score;

                InputManager.MoveMouseTo(leaderboardScore);
                InputManager.Click(MouseButton.Right);
            });

            // Ensure the context menu has finished showing
            AddStep("finish transforms", () => contextMenuContainer.FinishTransforms(true));

            AddStep("click delete option", () =>
            {
                InputManager.MoveMouseTo(contextMenuContainer.ChildrenOfType <DrawableOsuMenuItem>().First(i => i.Item.Text.Value.ToString().ToLowerInvariant() == "delete"));
                InputManager.Click(MouseButton.Left);
            });

            // Ensure the dialog has finished showing
            AddStep("finish transforms", () => dialogOverlay.FinishTransforms(true));

            AddStep("click delete button", () =>
            {
                InputManager.MoveMouseTo(dialogOverlay.ChildrenOfType <DialogButton>().First());
                InputManager.PressButton(MouseButton.Left);
            });

            AddUntilStep("wait for fetch", () => leaderboard.Scores != null);
            AddUntilStep("score removed from leaderboard", () => leaderboard.Scores.All(s => s.OnlineID != scoreBeingDeleted.OnlineID));

            // "Clean up"
            AddStep("release left mouse button", () => InputManager.ReleaseButton(MouseButton.Left));
        }