Beispiel #1
0
        public async Task ClearValuesAndShowHint_WhenClearButtonIsClickedALongTimeAsync()
        {
            // Arrange
            var mainScreen = this.Application.GetMainWindow(this.Automation);

            // Act
            var resultLbl = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.EvaluationResultLbl)).AsLabel());

            Keyboard.Type("1234567890");
            Wait.UntilInputIsProcessed();
            var clearBtn = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.ClearBtn)).AsButton());

            Mouse.MoveTo(clearBtn.GetClickablePoint());
            await ExtendedMouseInput.LongLeftMouseClickAsync(this.touchDelayWithOffset).ConfigureAwait(false);

            Wait.UntilInputIsProcessed();
            var hintMessageTxt = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.HintView.HintMessageTxt)).AsLabel());

            // Assert
            hintMessageTxt.Text.Should().NotBeNullOrWhiteSpace();
            resultLbl.Text.Should().Be("0.");
        }
Beispiel #2
0
        public async Task ShowSavedSpecialFunctionValues_WhenSpecialFunctionButtonIsClickedALongTimeAsync()
        {
            // Arrange
            var mainScreen = this.Application.GetMainWindow(this.Automation);

            // Act
            var resultLbl = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.EvaluationResultLbl)).AsLabel());

            Keyboard.Type("1");
            var yearsBtn = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.YearsBtn)).AsButton());

            yearsBtn.Click();
            Wait.UntilInputIsProcessed();
            Keyboard.Type("2");
            var interestBtn = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.InterestBtn)).AsButton());

            interestBtn.Click();
            Wait.UntilInputIsProcessed();
            Keyboard.Type("3");
            var startBtn = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.StartBtn)).AsButton());

            startBtn.Click();
            Wait.UntilInputIsProcessed();
            Keyboard.Type("4");
            var rateBtn = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.RateBtn)).AsButton());

            rateBtn.Click();
            Wait.UntilInputIsProcessed();
            Keyboard.Type("5");
            var endBtn = WaitForElement(() => mainScreen.FindFirstDescendant(cf => cf.ByAutomationId(UiIds.ClassicCalculator.EndBtn)).AsButton());

            endBtn.Click();
            Wait.UntilInputIsProcessed();

            Mouse.MoveTo(yearsBtn.GetClickablePoint());
            await ExtendedMouseInput.LongLeftMouseClickAsync(this.touchDelayWithOffset).ConfigureAwait(false);

            Wait.UntilInputIsProcessed();
            var yearsResult = resultLbl.Text;

            Mouse.MoveTo(interestBtn.GetClickablePoint());
            await ExtendedMouseInput.LongLeftMouseClickAsync(this.touchDelayWithOffset).ConfigureAwait(false);

            Wait.UntilInputIsProcessed();
            var interestResult = resultLbl.Text;

            Mouse.MoveTo(startBtn.GetClickablePoint());
            await ExtendedMouseInput.LongLeftMouseClickAsync(this.touchDelayWithOffset).ConfigureAwait(false);

            Wait.UntilInputIsProcessed();
            var startResult = resultLbl.Text;

            Mouse.MoveTo(rateBtn.GetClickablePoint());
            await ExtendedMouseInput.LongLeftMouseClickAsync(this.touchDelayWithOffset).ConfigureAwait(false);

            Wait.UntilInputIsProcessed();
            var rateResult = resultLbl.Text;

            Mouse.MoveTo(endBtn.GetClickablePoint());
            await ExtendedMouseInput.LongLeftMouseClickAsync(this.touchDelayWithOffset).ConfigureAwait(false);

            Wait.UntilInputIsProcessed();
            var endResult = resultLbl.Text;

            // Assert
            yearsResult.Should().Be("1.00");
            interestResult.Should().Be("2.000");
            startResult.Should().Be("3.00");
            rateResult.Should().Be("4.00");
            endResult.Should().Be("5.00");
        }