コード例 #1
0
        public void Should_BePossibleTo_CheckVisualState_WhenItHasNotChanged()
        {
            var sliderForm = new SliderForm();

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

            Assert.DoesNotThrow(() => sliderForm.Dump.Save(), "Should be possible to save dump");
            Assert.That(sliderForm.Dump.Compare() == 0L || sliderForm.Style != style, "Form dump should remain the same, unless the slider has already scrolled");
        }
コード例 #2
0
        public void Should_BePossibleTo_ScrollWindowBy()
        {
            OpenAutomationPracticeSite();
            var sliderForm = new SliderForm();
            var initialY   = sliderForm.FormPointInViewPort.Y;
            var formHeight = sliderForm.Size.Height;

            AqualityServices.Browser.ScrollWindowBy(0, formHeight);
            Assert.LessOrEqual(Math.Abs(formHeight - (initialY - sliderForm.FormPointInViewPort.Y)), 1, "Window should be scrolled.");
        }
        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");
        }
コード例 #4
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");
        }
コード例 #5
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");
        }
コード例 #6
0
        public void goToPresentation()
        {
            SliderForm _presentation = new SliderForm();

            _presentation.Show();
        }
        public void Should_BePossibleTo_WaitForElement_WhichExistsButNotDisplayed()
        {
            var button = new SliderForm().GetAddToCartBtn(ElementState.ExistsInAnyState);

            Assert.IsTrue(AqualityServices.ConditionalWait.WaitFor(() => button.State.IsExist && !button.State.IsDisplayed));
        }