Beispiel #1
0
        public void ValidCreditCard_BuyShoppingCart_ShouldNavigateToDogsListPage()
        {
            const string DOG_TO_SELECT = UiText.ANY_DOG_NAME;

            _dogDetailViewObject = _dogsListViewObject.OpenDogDetailViewPage(DOG_TO_SELECT);
            _dogDetailViewObject.TapAddDogToTheShoppingCart();
            _shoppingCartViewObject = _dogDetailViewObject.FromMasterDetailPageNavigateTo(UiText.BUTTON_TO_SHOPPING_CART_PAGE) as ShoppingCartViewObject;
            const string VALID_CREDIT_CARD = "1234";

            _shoppingCartViewObject.EnterCreditCard(VALID_CREDIT_CARD);
            _dogsListViewObject = _shoppingCartViewObject.TapBuyShoppingCart();

            Assert.IsTrue(_dogsListViewObject.IsTextDisplayed(UiText.DOGS_LIST_PAGE_MAIN_TITLE));
            Assert.IsTrue(_dogsListViewObject.IsTextDisplayed(UiText.DOGS_LIST_PAGE_MAIN_LABEL));
        }
Beispiel #2
0
        public void InvalidCreditCard_BuyShoppingCart_ShouldDisplayAlertMessage()
        {
            const string DOG_TO_SELECT = UiText.ANY_DOG_NAME;

            _dogDetailViewObject = _dogsListViewObject.OpenDogDetailViewPage(DOG_TO_SELECT);
            _dogDetailViewObject.TapAddDogToTheShoppingCart();
            _shoppingCartViewObject = _dogDetailViewObject.FromMasterDetailPageNavigateTo(UiText.BUTTON_TO_SHOPPING_CART_PAGE) as ShoppingCartViewObject;
            const string INVALID_CREDIT_CARD = "123";

            _shoppingCartViewObject.EnterCreditCard(INVALID_CREDIT_CARD);
            _shoppingCartViewObject.TapButton(UiText.BUTTON_BUY_SHOPPING_CART);

            Assert.IsTrue(_shoppingCartViewObject.IsTextDisplayed(UiText.WARNING));
            Assert.IsTrue(_shoppingCartViewObject.IsTextDisplayed(UiText.INVALID_CONFIRMATION_CREDIT_CARD));
            Assert.IsTrue(_shoppingCartViewObject.IsTextDisplayed(UiText.OK));
        }
Beispiel #3
0
        public void ValidCreditCard_BuyShoppingCart_ShouldReinitializeTheShoppingCart()
        {
            const string DOG_TO_SELECT = UiText.ANY_DOG_NAME;

            _dogDetailViewObject = _dogsListViewObject.OpenDogDetailViewPage(DOG_TO_SELECT);
            _dogDetailViewObject.TapAddDogToTheShoppingCart();
            _shoppingCartViewObject = _dogDetailViewObject.FromMasterDetailPageNavigateTo(UiText.BUTTON_TO_SHOPPING_CART_PAGE) as ShoppingCartViewObject;
            const string VALID_CREDIT_CARD = "1234";

            _shoppingCartViewObject.EnterCreditCard(VALID_CREDIT_CARD);
            _dogsListViewObject     = _shoppingCartViewObject.TapBuyShoppingCart();
            _shoppingCartViewObject = _dogsListViewObject.FromMasterDetailPageNavigateTo(UiText.BUTTON_TO_SHOPPING_CART_PAGE) as ShoppingCartViewObject;

            const string EXPECTED_PRICE = "Le coût total est 0 $";

            Assert.IsTrue(_shoppingCartViewObject.IsTextDisplayed(EXPECTED_PRICE));
            const string NON_EXPECTED_NAME = DOG_TO_SELECT;

            Assert.IsFalse(_shoppingCartViewObject.IsTextDisplayed(NON_EXPECTED_NAME));
        }