Exemple #1
0
        public void Click_CheckOut_Button_When_OrderDate_Is_Empty_Should_Display_OrderDate_Error_Message()
        {
            // Arrange
            var expectedResult = new CreateOrderResult
            {
                IsOrderDateErrorMessageDisplayed    = true,
                IsDeliveryTypeErrorMessageDisplayed = false,
                IsEmailErrorMessageDisplayed        = false,
                IsPaymentTypeErrorMessageDisplayed  = false,
                IsPhoneErrorMessageDisplayed        = false
            };

            _homePage.ClickCatalogMenu();
            _homePage.MoveToCatalogMenuItem1();
            _homePage.MoveToProductButton(0);
            _homePage.ClickProductButton(0);
            _homePage.ClickShoppingCart();
            Thread.Sleep(800);
            _homePage.ClickModalCheckOutButton();
            Thread.Sleep(800);
            _homePage.ClickCheckOutContinueButton();
            Thread.Sleep(1500);
            _homePage.SelectOrderPaymentType(1);
            _homePage.InputOrderCustomerName("testName");
            _homePage.InputOrderEmail("*****@*****.**");
            _homePage.SelectOrderDeliveryType(1);
            _homePage.InputOrderPhone("testPhone");
            _homePage.InputOrderAddress("testaddress");
            //Act
            _homePage.ClickCheckOutButtton();
            Thread.Sleep(2000);
            var actualResult = new CreateOrderResult
            {
                IsDeliveryTypeErrorMessageDisplayed = _homePage.IsDeliveryTypeErrorMessageDisplayed,
                IsEmailErrorMessageDisplayed        = _homePage.IsEmailErrorMessageDisplayed,
                IsPaymentTypeErrorMessageDisplayed  = _homePage.IsPaymentTypeErrorMessageDisplayed,
                IsOrderDateErrorMessageDisplayed    = _homePage.IsOrderDateErrorMessageDisplayed,
                IsPhoneErrorMessageDisplayed        = _homePage.IsPhoneErrorMessageDisplayed
            };

            //Assert
            expectedResult.Should().BeEquivalentTo(actualResult);
        }
Exemple #2
0
        public void Click_CheckOut_Button_When_All_Inputs_Are_Empty()
        {
            // Arrange
            var expectedResult = new CreateOrderResult
            {
                IsOrderDateErrorMessageDisplayed    = true,
                IsDeliveryTypeErrorMessageDisplayed = true,
                IsEmailErrorMessageDisplayed        = true,
                IsPaymentTypeErrorMessageDisplayed  = true,
                IsPhoneErrorMessageDisplayed        = true
            };

            _homePage.ClickCatalogMenu();
            _homePage.MoveToCatalogMenuItem1();
            _homePage.MoveToProductButton(0);
            _homePage.ClickProductButton(0);
            _homePage.ClickShoppingCart();
            Thread.Sleep(800);
            _homePage.ClickModalCheckOutButton();
            Thread.Sleep(800);
            _homePage.ClickCheckOutContinueButton();
            Thread.Sleep(1500);

            //Act
            _homePage.ClickCheckOutButtton();
            Thread.Sleep(1500);
            var actualResult = new CreateOrderResult
            {
                IsDeliveryTypeErrorMessageDisplayed = _homePage.IsDeliveryTypeErrorMessageDisplayed,
                IsEmailErrorMessageDisplayed        = _homePage.IsEmailErrorMessageDisplayed,
                IsPaymentTypeErrorMessageDisplayed  = _homePage.IsPaymentTypeErrorMessageDisplayed,
                IsOrderDateErrorMessageDisplayed    = _homePage.IsOrderDateErrorMessageDisplayed,
                IsPhoneErrorMessageDisplayed        = _homePage.IsPhoneErrorMessageDisplayed
            };

            //Assert
            expectedResult.Should().BeEquivalentTo(actualResult);
        }