public void Purchase_SimpleBehaviourEngine() { var itemUrl = "/Selenium-Testing-Cookbook-Gundecha-Unmesh/dp/1849515743"; var itemPrice = "40.49"; var clientPurchaseInfo = new ClientPurchaseInfo( new ClientAddressInfo() { FullName = "John Smith", Country = "United States", Address1 = "950 Avenue of the Americas", State = "New York", City = "New York City", Zip = "10001-2121", Phone = "00164644885569" }) { CouponCode = "99PERDIS" }; var clientLoginInfo = new ClientLoginInfo() { Email = "*****@*****.**", Password = "******" }; BehaviourExecutor.Execute( new ItemPageNavigationBehaviour(itemUrl), new ItemPageBuyBehaviour(), new PreviewShoppingCartPageProceedBehaviour(), new SignInPageLoginBehaviour(clientLoginInfo), new ShippingAddressPageFillShippingBehaviour(clientPurchaseInfo), new ShippingAddressPageFillDifferentBillingBehaviour(clientPurchaseInfo), new ShippingAddressPageContinueBehaviour(), new ShippingPaymentPageContinueBehaviour(), new PlaceOrderPageAssertFinalAmountsBehaviour(itemPrice)); }
public new void FixedUpdate() { base.FixedUpdate(); switch (GetState()) { case Unit.STATES.WALKING: if (enableAI) { var plan = behaviourExecutor.Execute(gameContext, GetComponent <IUnit>()); plan?.Execute(gameContext, GetComponent <IUnit>()); } if (Mathf.Abs(Velocity.x) == 0 && Mathf.Abs(Velocity.z) == 0) { TrySetState(Unit.STATES.NEUTRAL); } break; case Unit.STATES.NEUTRAL: if (enableAI) { var plan = behaviourExecutor.Execute(gameContext, GetComponent <IUnit>()); plan?.Execute(gameContext, GetComponent <IUnit>()); } if (Mathf.Abs(Velocity.x) > 0 || Mathf.Abs(Velocity.z) > 0) { TrySetState(Unit.STATES.WALKING); } break; case Unit.STATES.ATTACK: if (AnimationUtil.IsAnimationDone(animator, "Enemy02Attack")) { TrySetState(Unit.STATES.NEUTRAL); } break; case Unit.STATES.DAMAGE: if (!damageFlowStarted) { damageFlowStarted = true; StartCoroutine(DamageStateFlow()); } break; case Unit.STATES.DEAD: if (!deadFlowStarted) { deadFlowStarted = true; StartCoroutine(DeadStateFlow()); } break; } if (Dimension == Unit.DIMENSION.LEFT) { transform.localScale = new Vector3(-1, 1, 1); } else { transform.localScale = new Vector3(1, 1, 1); } UpdateAnimator(); }