private void ActionsOnAutomationPractice()
        {
            AqualityServices.Browser.Quit();
            OpenAutomationPracticeSite();
            AqualityServices.Browser.Maximize();
            var sliderForm = new SliderForm();

            Assert.IsTrue(sliderForm.State.WaitForDisplayed(), "Slider Form is not opened");

            sliderForm.ClickNextButton();
            sliderForm.ClickNextButton();
            var productListForm = new ProductListForm();

            Assert.AreEqual(ExpectedNumdberOfProducts, productListForm.GetNumberOfProductsInContainer(), "Number of products is incorrect");

            productListForm.AddRandomProductToCart();
            var proceedToCheckoutModal = new ProceedToCheckoutModal();

            proceedToCheckoutModal.ClickProceedToCheckoutButton();
            var shoppingCardSummaryForm = new ShoppingCardSummaryForm();

            shoppingCardSummaryForm.ClickPlusButton();
            var actualQuantity = shoppingCardSummaryForm.WaitForQuantityAndGetValue(ExpectedQuantity);

            Assert.AreEqual(ExpectedQuantity, actualQuantity, "Quantity is incorrect");

            shoppingCardSummaryForm.ClickProceedToCheckoutButton();
            var authForm = new AuthenticationForm();

            Assert.IsTrue(authForm.State.WaitForDisplayed(), "Authentication Form is not opened");

            var cartMenuForm = new CartMenuForm();

            cartMenuForm.OpenCartMenu();
            cartMenuForm.ClickCheckoutButton();

            shoppingCardSummaryForm.ClickProceedToCheckoutButton();
            authForm.SetEmail(Email);
            authForm.ClickCreateAccountButton();

            var personalInfoForm = new YourPersonalInfoForm();

            personalInfoForm.SelectGender(Gender);
            personalInfoForm.SetFirstName(FirstName);
            var actualNumberOfDays = personalInfoForm.GetNumberOfDays();

            Assert.AreEqual(ExpectedNumberOfDays, actualNumberOfDays, "Number of days from combobox is incorrect");

            personalInfoForm.SelectState(State);
            personalInfoForm.SelectDay(DayToSelect);
            Assert.IsFalse(personalInfoForm.IsNewsCheckBoxChecked(), "News checkbox state is not correct");

            personalInfoForm.SetNewsCheckBox();
            Assert.IsTrue(personalInfoForm.IsNewsCheckBoxChecked(), "News checkbox state is not correct");
        }
コード例 #2
0
        public void Should_BePossibleTo_CheckVisualState_WhenItDifferes()
        {
            const string dumpName   = "the differed slider";
            var          sliderForm = new SliderForm();

            Assume.That(sliderForm.State.WaitForDisplayed(), "Slider Form is not opened");
            var style = sliderForm.Style;

            Assert.DoesNotThrow(() => sliderForm.Dump.Save(dumpName), "Should be possible to save dump");
            sliderForm.ClickNextButton();
            sliderForm.WaitForSliding();
            Assert.That(sliderForm.Dump.Compare(dumpName), Is.GreaterThan(0), "After clicking on slider next button, the form dump should differ");
        }
コード例 #3
0
        public void Should_BePossibleTo_CheckVisualState_WhenItIsTheSame()
        {
            const string dumpName   = "the same slider";
            var          sliderForm = new SliderForm();

            Assume.That(sliderForm.State.WaitForDisplayed(), "Slider Form is not opened");
            sliderForm.ClickNextButton();
            sliderForm.ClickNextButton();
            sliderForm.WaitForSliding();
            var style = sliderForm.Style;

            Assert.DoesNotThrow(() => sliderForm.Dump.Save(dumpName), "Should be possible to save dump");
            sliderForm.ClickNextButton();
            sliderForm.WaitForSliding();
            Assert.That(sliderForm.Dump.Compare(dumpName), Is.GreaterThan(0), "After clicking on slider next button, the form dump should differ");
            AqualityServices.ConditionalWait.WaitForTrue(() =>
            {
                sliderForm.ClickNextButton();
                sliderForm.WaitForSliding();
                return(style == sliderForm.Style);
            }, message: "After some sliding, slider should get back to first slide");
            Assert.That(sliderForm.Dump.Compare(dumpName), Is.AtMost(0.02), "After slider returned to initial state, the form dump should be almost the same");
        }