public void CompleteCheckoutFormAndSubmit(ModelFormCheckOutPage model)
 {
     EmailTextBox.SendKeysWithWait(model.EmailID);
     NameTextBox.SendKeysWithWait(model.Name);
     AddressTextBox.SendKeysWithWait(model.Name);
     CardTypeDropdownMenu.SendKeysWithWait(model.CardType);
     CardNumberTextBox.SendKeysWithWait(model.CardNumber.ToString());
     CardHolderNameTextBox.SendKeysWithWait(model.CardHoldName);
     VerificationCodeTextBox.SendKeysWithWait(model.VerificationCode.ToString());
     PlaceOrderButton.ClickWithWait();
 }
示例#2
0
        private async Task RegurgitatePizza()
        {
            // check if the pizza is already flying
            if (FlyingPizza.IsVisible)
            {
                return;
            }


            var buttonBounds = PlaceOrderButton.Bounds;

            // work out where it needs to fly from?
            var size        = new Size(buttonBounds.Height, buttonBounds.Height);
            var location    = new Point(buttonBounds.Right - size.Width, buttonBounds.Top);
            var chompBounds = new Rectangle(location, size);

            // position pizza at the bottom
            AbsoluteLayout.SetLayoutBounds(FlyingPizza, chompBounds);

            // eat the pizza
            FlyingPizza.IsVisible = true;

            _ = FlyingPizza.RelRotateTo(90, 500, Easing.SinInOut);

            // open the button
            var buttonChompBounds = new Rectangle(PlaceOrderButton.Bounds.Location,
                                                  new Size(PlaceOrderButton.Width - buttonBounds.Height, buttonBounds.Height));
            await PlaceOrderButton.LayoutTo(buttonChompBounds, 500, Easing.SinInOut);


            // work out where it needs to fly to - pizza is
            var destRect = Pizza.Bounds;

            // animate the pizza up
            _ = FlyingPizza.LayoutTo(destRect, 500, Easing.SinInOut);
            _ = FlyingPizza.RotateTo(Pizza.Rotation, 500, Easing.SinInOut);

            // close the button chomp
            await PlaceOrderButton.LayoutTo(buttonBounds, 500, Easing.SinInOut);

            FlyingPizza.IsVisible = false;
        }