public void MainTitleIsDisplayed()
        {
            _dogsListPageObject = _mainPagePageObject.OpenDogsListPage();

            _dogDetailPageObject = _dogsListPageObject.OpenDogDetailViewPage(UiText.ANY_DOG_NAME);

            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(UiText.TITLE_DOG_DETAIL + UiText.ANY_DOG_NAME));
        }
Example #2
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));
        }
Example #3
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));
        }
Example #4
0
        public void DogInShoppingCart_CancelShoppingCart_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;

            _dogsListViewObject     = _shoppingCartViewObject.TapCancelShoppingCart();
            _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));
        }
        public void OnDogDetaiPage_DogInformationsAreDisplayed()
        {
            _dogsListPageObject = _mainPagePageObject.OpenDogsListPage();
            const string DOG_TO_SELECT = UiText.ANY_DOG_NAME;

            _dogDetailPageObject = _dogsListPageObject.OpenDogDetailViewPage(DOG_TO_SELECT);

            const string EXPECTED_NAME_DISPLAYED        = UiText.ANY_DOG_NAME;
            const string EXPECTED_DESCRIPTION_DISPLAYED = UiText.ANY_DOG_DESCRIPTION;
            const string EXPECTED_RACE_DISPLAYED        = UiText.ANY_DOG_RACE;
            const string EXPECTED_SEX_DISPLAYED         = UiText.ANY_DOG_SEX;

            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(UiText.TITLE_DOG_DETAIL + UiText.ANY_DOG_NAME));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_NAME_DISPLAYED));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_DESCRIPTION_DISPLAYED));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_RACE_DISPLAYED));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_SEX_DISPLAYED));
        }
        public void AddToShoppingCart_DogsInformationsAreDisplayedInShoppingCartPage()
        {
            const string DOG_TO_SELECT = UiText.ANY_DOG_NAME;

            _dogsListPageObject  = _mainPagePageObject.UserHasDogSignIn();
            _dogDetailPageObject = _dogsListPageObject.OpenDogDetailViewPage(DOG_TO_SELECT);

            _dogDetailPageObject.TapAddDogToTheShoppingCart();
            _dogDetailPageObject.FromMasterDetailPageNavigateTo(UiText.BUTTON_TO_SHOPPING_CART_PAGE);

            const string EXPECTED_NAME_DISPLAYED  = UiText.ANY_DOG_NAME;
            const string EXPECTED_RACE_DISPLAYED  = UiText.ANY_DOG_RACE;
            const string EXPECTED_SEX_DISPLAYED   = UiText.ANY_DOG_SEX;
            const string EXPECTED_PRICE_DISPLAYED = "Le coût total est 259.99 $";

            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_PRICE_DISPLAYED));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_NAME_DISPLAYED));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_RACE_DISPLAYED));
            Assert.IsTrue(_dogDetailPageObject.IsTextDisplayed(EXPECTED_SEX_DISPLAYED));
        }