Example #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            filesScrollViewer = GetTemplateChild("FilesScrollViewer") as ScrollViewer;
            clearFilesButton  = GetTemplateChild("ClearFilesButton") as Button;

            m_scrollHelper = new ScrollHelper(filesScrollViewer);

            clearFilesButton.Click += new RoutedEventHandler(OnClearFileButtonClick);

            // 第一次加载可能会失败(控件未完全加载,这里在加载一次)
            if (this.AllowThumbnail)
            {
                this.displayThumbailChkBox.Visibility = Visibility.Visible;
            }
            else
            {
                this.displayThumbailChkBox.Visibility = Visibility.Collapsed;
            }
            if (MaxNumberToUpload > -1)
            {
                AlertInfoTextBlock.Text += "       文件个数上限:" + MaxNumberToUpload.ToString() + "个";
            }
            if (MaximumUpload > -1)
            {
                AlertInfoTextBlock.Text += "  文件大小上限:" + (MaximumUpload / (1024 * 1024)).ToString() + "M";
            }
        }
Example #2
0
        public void Setup()
        {
            Log4netHelper.ConfigureLog4net(TestContext.CurrentContext.Test.FullName, Path.Combine(TestContext.CurrentContext.WorkDirectory, $"{TestContext.CurrentContext.Test.FullName}.txt"));
            log = Log4netHelper.GetLogger();

            log.Info($"Preparing {browser} driver");
            driver           = WebDriverFactory.CreateWebDriver(browser);
            screenshotHelper = new ScreenshotHelper((ITakesScreenshot)driver);
            scrollHelper     = new ScrollHelper(driver);
        }
Example #3
0
 public void RegisterIntoApplication(string firstName, string lastName, string phoneNumber, string email, string password, string repeatPassword)
 {
     RegisterFirstNameTextField.SendKeys(firstName);
     RegisterLastNameTextField.SendKeys(lastName);
     RegisterPhoneNumberTextField.SendKeys(phoneNumber);
     RegisterEmailTextField.SendKeys(email);
     RegisterPasswordTextField.SendKeys(password);
     RegisterRepeatPasswordTextField.SendKeys(repeatPassword);
     ScrollHelper.ScrollToView(_driver, RegisterButton);
     RegisterButton.Click();
 }
 private void KeyBoardUpNotification(NSNotification notification)
 {
     if (bottom != 0)
     {
         amountToScroll = ScrollHelper.ScrollOnHiddenUiElement(View, bottom, notification, InterfaceOrientation);
         if (amountToScroll < 0)
         {
             SetViewMovedUp(true, amountToScroll);
         }
     }
     bottom = 0;
 }
        public void CreateWishlist(string wishlistName, string wishlistComment, string extraInfo, string customerName, string customerEmail)
        {
            WishlistNameTextField.SendKeys(wishlistName);
            WishlistCommentTextField.SendKeys(wishlistComment);
            WishlsitExtraInfoTextField.SendKeys(extraInfo);
            ScrollHelper.ScrollToView(_driver, WishlistCustomerNameTextField);
            WishlistCustomerNameTextField.SendKeys(customerName);
            WishlistCustomerEmailTextField.SendKeys(customerEmail);
            WishlistConfidentialityCheckBox.Click();

            // Wishlist save disabled because is live app
            //WishListSaveButton.Click();
        }
        public void ClickOnSpecifiedProductByIndex(int index)
        {
            if (SearchedProductsList.Any() == false)
            {
                return;
            }

            if (index >= SearchedProductsList.Count())
            {
                return;
            }

            ScrollHelper.ScrollToView(_driver, SearchedProductsList.ElementAt(index));
            SearchedProductsList.ElementAt(index).Click();
        }
Example #7
0
 private void KeyBoardUpNotification(NSNotification notification)
 {
     // Find what opened the keyboard
     foreach (UIView view in ScrollView.Subviews)
     {
         if (view.IsFirstResponder)
         {
             ScrollHelper.ScrollOnHiddenUIElement(View
                                                  , ScrollView
                                                  , ((float)(view.Frame.Y + view.Frame.Height + 10)) // 10 is extra offset
                                                  , notification
                                                  , InterfaceOrientation);
             break;
         }
     }
 }
 public async Task UpdateAsync()
 {
     if (ChapterList.Count > 0)
     {
         Ts.Cancel();
         T?.Wait(Ts.Token);
         Ts = new CancellationTokenSource();
         ImageHeight.Clear();
         ImageDimension.Clear();
         ScrollHelper.Helper();
         T = await Task.Run(async() =>
         {
             await DataSource.PopulateImageAsync(_chapterList[ActiveIndex], Ts.Token).ConfigureAwait(false);
             return(T);
         }).ConfigureAwait(false);
     }
     else
     {
         DataSource.ImageList.Clear();
         ImageHeight.Clear();
         ImageDimension.Clear();
     }
 }
 public void ClickOnAddToShoppingCartButton()
 {
     ScrollHelper.ScrollToView(_driver, AddToCartButton);
     AddToCartButton.Click();
 }
 public void ClickOnSpecifiedFilterCategoryByText(string filterCategoryName)
 {
     ScrollHelper.ScrollToView(_driver, FilterCategoryButton(filterCategoryName));
     FilterCategoryButton(filterCategoryName).Click();
 }
 public void SearchForWishList(string wishListName)
 {
     WishListSearchBar.SendKeys(wishListName);
     ScrollHelper.ScrollToView(_driver, WishListSearchButton);
     WishListSearchButton.Click();
 }