public DateTimePickerComponent(ContextConfiguration contextConfiguration, string className)
 {
     WaitUtils.elementState(contextConfiguration.WebDriverWait, By.CssSelector($".{className}"), ElementState.EXISTS);
     DateTimePickerElement = contextConfiguration.WebDriver.FindElement(By.CssSelector($".{className}"));
     datePickerComponent   = new DatePickerComponent(contextConfiguration, className);
     timePickerComponent   = new TimePickerComponent(contextConfiguration, className);
 }
Пример #2
0
 public void ServerSetUp()
 {
     ServerOperationsFeather.DynamicModules().ExtractStructureZip(PackageResource, InstallationPath);
     ServerOperations.SystemManager().RestartApplication(false);
     WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)
                                        + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty));
 }
Пример #3
0
 public void WhenIFollowTheLinkAndCompleteTheResetPasswordForm()
 {
     _driver.Navigate().GoToUrl(_passwordResetEmail.Link);
     WaitUtils.waitForPage(_driverWait);
     Assert.NotNull(_passwordResetEmail.Link);
     _resetPasswordPage.EnterNewPasswordAndSubmit(_newPassword);
 }
Пример #4
0
 public void ThenIExpectThatMyOldPasswordWillNotLogMeIn()
 {
     WaitUtils.waitForPage(_driverWait);
     _loginPage.Login(_userEntity.EmailAddress, _userEntity.Password);
     WaitUtils.waitForPage(_driverWait);
     Assert.Equal(_driver.Url, _baseUrl + "/login");
 }
Пример #5
0
        public void ClickSelectAllItemsButton()
        {
            const string entityXPath = "//section[@class='collection__select-options' and @aria-label='select options']";

            WaitUtils.elementState(_driverWait, By.XPath(entityXPath), ElementState.VISIBLE);
            SelectAllItemsButton.Click();
        }
Пример #6
0
        public PayPalSite(IWebDriver driver)
        {
            this.driver = driver;

            Task.Delay(1000).Wait();
            if (driver.FindElements(By.Id("preloaderSpinner")).Count > 0)
            {
                WaitIdToDisappear(driver, "preloaderSpinner", 120);
            }

            var r = WaitUtils.WaitLocators(driver, 60,
                                           By.Id("confirmButtonTop"),
                                           By.XPath("//b[contains(text(), 'Have a PayPal account?')]"),
                                           By.XPath("//h1[contains(text(), 'Pay with PayPal')]"),
                                           By.Id("miniCart"),
                                           By.Id("btnLogin")
                                           );

            signature = r.Item1 ?? -1;

            if (signature == 2)
            {
                var a = driver.FindElements(By.Id("email"));
                if (a != null && a.Count > 0)
                {
                    signature = 11;
                }
            }
            Console.WriteLine($"PAYPAL SITE SIGNATURE {signature}");
        }
Пример #7
0
        public PayPalLogin3(IWebDriver driver)
        {
            //WaitUtils.WaitIdToDisappear(driver, "preloaderSpinner", 60);
            WaitUtils.WaitId(driver, "btnLogin", 60);

            elements = new PageElements(driver, xpaths);
        }
Пример #8
0
        private static void LaunchBrowserAndNavigateToSupportPage(FeatureContext feature)
        {
            var driver = LaunchBrowser();

            WaitUtils.WaitUntilPageIsLoaded(driver.Driver, TimeOut);
            feature.Add(App, driver);
        }
Пример #9
0
        public void ClickAutomaticalyRenewalCheckbox(string productName)
        {
            string newLocator = locatorForAutoRenewalCheckboxByProductName.Replace("foo", productName);

            cmnElement.ClickElement(driver.FindElement(By.XPath(newLocator)));
            WaitUtils.WaitForLoaderToDisapear(driver);
        }
Пример #10
0
        public void SetMaintenanceAndSupportQuantity(int item)
        {
            string text = HelperUtils.GetDescription((YearQuantity)item - 1);

            SetQuantityAsString(MaintenanceAndSupportQuantity, text, locatorForYearlyDropdownValues);
            WaitUtils.WaitForLoaderToDisapear(driver);
        }
Пример #11
0
        public void SetQuantityAsString(IWebElement element, string item, string locator)
        {
            KendoDropdown kendoDropdown = new KendoDropdown(element);

            kendoDropdown.SelectItem(locator, item);
            WaitUtils.WaitForLoaderToDisapear(driver);
        }
Пример #12
0
        public void ActivateModule()
        {
            ServerOperations.ModuleBuilder().ActivateModule(ModuleName, string.Empty, TransactionName);

            WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url
                                               .GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty));
        }
Пример #13
0
        public WrappedWebElement WaitUntilExists(int timeout)
        {
            var wait = WaitUtils.CreateWait(WrappedDriver, TimeSpan.FromSeconds(timeout));

            WaitUtils.IgnoreImplicitWait(WrappedDriver, () => { wait.Until(ExpectedConditions.ElementExists(By)); });
            return(this);
        }
Пример #14
0
        public static void ClickCustom(this IWebElement webElement)
        {
            string Validacao = "Validação do click";

            if (!(webElement.Enabled && webElement.Displayed))
            {
                Ensure.Fail(Validacao, "Elemento disponivel e clicar com sucesso", "O elemento não esta disponivel para ser clicado");
            }
            else
            {
                Validacao = "Validação do click no Elemento: \n" +
                            "Tag: " + webElement.TagName +
                            " Id: " + webElement.GetAttribute("id")
                ;
            }
            try
            {
                WaitUtils.WaitUntilActionCuston(() => webElement.Click());
                WaitUtils.WaitUntilActionCuston(() => webElement.SetHighLight());
                Ensure.Pass(Validacao, "Clicar com sucesso", "Clique realizado com sucesso");
                WaitUtils.WaitUntilActionCuston(() => webElement.UnsetHighLight());
            }
            catch (Exception e)
            {
                Ensure.Fail(Validacao, "Clicar com sucesso", "Não foi possivel clicar no botão Erro: " + e.ToString());
            }
        }
Пример #15
0
        public void OpenDropdown(IWebElement element)
        {
            KendoDropdown dropdown = new KendoDropdown(element);

            dropdown.Expand();
            WaitUtils.WaitForLoaderToDisapear(driver);
        }
 public void RestartApplication()
 {
     ServerOperations.SystemManager().RestartApplication(false);
     WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url
                                        .GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty));
     ServerOperations.MultiSite().AssignModuleToCurrentSite(ModuleName);
 }
Пример #17
0
        public void IInsertValidBaseChoiceIntoElement(BaseChoiceType baseChoiceType, SelectorPathType selector, string path)
        {
            By elementBy = WebElementUtils.GetElementAsBy(selector, path);

            WaitUtils.elementState(_driverWait, elementBy, ElementState.EXISTS);

            switch (baseChoiceType)
            {
            case BaseChoiceType.INT:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandInt().ToString());
                break;

            case BaseChoiceType.DOUBLE:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandDouble().ToString());
                break;

            case BaseChoiceType.BOOL:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandBool().ToString());
                break;

            case BaseChoiceType.EMAIL:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandEmail());
                break;
            }
        }
Пример #18
0
 public FoldersAndLabelsPage CreateLabelsWithSameName(string labelName)
 {
     CreateNewLabel(labelName);
     WaitUtils.WaitUntilInvisible(NameInput, _driver);
     CreateNewLabel(labelName);
     return(this);
 }
        public PayPalLoginPassword(IWebDriver driver)
        {
            WaitUtils.WaitToDisappear(driver, By.ClassName("spinnerWithLockIcon"), 60);
            WaitUtils.WaitId(driver, "password", 30);
            Thread.Sleep(1000);  // hack for unattached element issue

            elements = new PageElements(driver, locators);
        }
Пример #20
0
 public void ServerSetUp()
 {
     ServerOperations.Pages().CreatePage(PageName);
     ServerOperationsFeather.DynamicModules().EnsureModuleIsImported(ModuleName, ModuleResource);
     WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url
                                        .GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty));
     ServerOperationsFeather.DynamicModules().ExtractStructureZip(PackageResource, Path);
 }
Пример #21
0
 protected override void WaitForPage()
 {
     WaitUtils.Wait(Driver, 30, d =>
     {
         var e = d.FindElements(By.XPath(Make_SuffixXpe("txtPrimaryFName")));
         return(e.Count() > 0);
     });
 }
Пример #22
0
        public VendOrHold SelectCapacity(int capacity)
        {
            var key = $"cap{capacity}";

            WaitUtils.WaitLocator(Driver, Locators[key], 5);
            elements[key].Click();
            return(this);
        }
Пример #23
0
        public FoldersAndLabelsPage VerifyLastFolder(string folderName)
        {
            WaitUtils.WaitUntilInvisible(NameInput, _driver);
            var LastFolderTitle = LastFolder.GetAttribute("title");

            Assert.IsTrue(LastFolderTitle.Equals(folderName));
            return(this);
        }
Пример #24
0
        public FoldersAndLabelsPage VerifyLastLabelName(string labelName)
        {
            WaitUtils.WaitUntilInvisible(NameInput, _driver);
            var LastLabelText = LastLabel.Text;

            Assert.IsTrue(LastLabelText.Equals(labelName));
            return(this);
        }
 public LoginPage EnterCrediantialsAndClickLogin(string userName, string password)
 {
     UserNameInput.SendKeys(userName);
     PasswordInput.SendKeys(password);
     LoginButton.Click();
     WaitUtils.WaitUntilInvisible(ProtonLoader, _driver);
     return(this);
 }
 public void ImportNewPackage()
 {
     ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath);
     ServerOperationsFeather.DynamicModules().ExtractStructureZip(PackageResourceEdited, InstallationPath);
     ServerOperations.SystemManager().RestartApplication(false);
     WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty));
     ServerOperations.MultiSite().AssignModuleToCurrentSite(ModuleName);
 }
Пример #27
0
        public async Task SetTopicConfigurationTests()
        {
            using (var snsClient = new AmazonSimpleNotificationServiceClient())
            {
                string topicName         = UtilityMethods.GenerateName("events-test");
                var    snsCreateResponse = await snsClient.CreateTopicAsync(topicName);

                var bucketName = await UtilityMethods.CreateBucketAsync(Client, "SetTopicConfigurationTests");

                try
                {
                    await snsClient.AuthorizeS3ToPublishAsync(snsCreateResponse.TopicArn, bucketName);

                    PutBucketNotificationRequest putRequest = new PutBucketNotificationRequest
                    {
                        BucketName          = bucketName,
                        TopicConfigurations = new List <TopicConfiguration>
                        {
                            new TopicConfiguration
                            {
                                Id     = "the-topic-test",
                                Topic  = snsCreateResponse.TopicArn,
                                Events = new List <EventType> {
                                    EventType.ObjectCreatedPut
                                }
                            }
                        }
                    };
                    await Client.PutBucketNotificationAsync(putRequest);

                    var getResponse = WaitUtils.WaitForComplete(
                        () =>
                    {
                        return(Client.GetBucketNotificationAsync(bucketName).Result);
                    },
                        (r) =>
                    {
                        return(r.TopicConfigurations.Count > 0);
                    });

                    Assert.Equal(1, getResponse.TopicConfigurations.Count);
                    Assert.Equal(1, getResponse.TopicConfigurations[0].Events.Count);
                    Assert.Equal(EventType.ObjectCreatedPut, getResponse.TopicConfigurations[0].Events[0]);

#pragma warning disable 618
                    Assert.Equal("s3:ObjectCreated:Put", getResponse.TopicConfigurations[0].Event);
#pragma warning restore 618
                    Assert.Equal("the-topic-test", getResponse.TopicConfigurations[0].Id);
                    Assert.Equal(snsCreateResponse.TopicArn, getResponse.TopicConfigurations[0].Topic);
                }
                finally
                {
                    await snsClient.DeleteTopicAsync(snsCreateResponse.TopicArn);

                    await UtilityMethods.DeleteBucketWithObjectsAsync(Client, bucketName);
                }
            }
        }
Пример #28
0
        public double GetSavingsForUnitPrice()
        {
            WaitUtils.WaitForLoaderToDisapear(driver);

            string savings = SavingsLabelForUnitPrice.Text;
            string removeDollarSignSavings = Regex.Replace(savings, @"[$ ]+", "");

            return(Double.Parse(removeDollarSignSavings));
        }
Пример #29
0
 public FoldersAndLabelsPage CreateNewFolder(string folderName)
 {
     WaitUtils.WaitUntilVisible(AddFolderButton, _driver);
     AddFolderButton.Click();
     WaitUtils.WaitUntilVisible(NameInput, _driver);
     NameInput.SendKeys(folderName);
     SaveButton.Click();
     return(this);
 }
Пример #30
0
        public double GetUnitPrice()
        {
            WaitUtils.WaitForLoaderToDisapear(driver);

            string unitPriceLabelText        = UnitPriceLabel.Text;
            string removeDollarSignUnitPrice = Regex.Replace(unitPriceLabelText, @"[$ ]+", "");

            return(Double.Parse(removeDollarSignUnitPrice));
        }