示例#1
0
        public static async void PasteItem_ClickAsync(object sender, RoutedEventArgs e)
        {
            var             DestinationPath = App.ViewModel.Universal.path;
            DataPackageView packageView     = Clipboard.GetContent();
            var             oldCount        = App.ViewModel.FilesAndFolders.Count;
            var             ItemsToPaste    = await packageView.GetStorageItemsAsync();

            foreach (IStorageItem item in ItemsToPaste)
            {
                if (item.IsOfType(StorageItemTypes.Folder))
                {
                    CloneDirectoryAsync(item.Path, DestinationPath, item.Name);
                }
                else if (item.IsOfType(StorageItemTypes.File))
                {
                    StorageFile ClipboardFile = await StorageFile.GetFileFromPathAsync(item.Path);

                    await ClipboardFile.CopyAsync(await StorageFolder.GetFolderFromPathAsync(DestinationPath), item.Name, NameCollisionOption.GenerateUniqueName);
                }
            }

            if (packageView.RequestedOperation == DataPackageOperation.Move)
            {
                foreach (string path in pathsToDeleteAfterPaste)
                {
                    if (path.Contains("."))
                    {
                        StorageFile file = await StorageFile.GetFileFromPathAsync(path);

                        await file.DeleteAsync();
                    }
                    if (!path.Contains("."))
                    {
                        StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(path);

                        await folder.DeleteAsync();
                    }
                }
            }
            if (page.Name == "GenericItemView")
            {
                NavigationActions.Refresh_Click(null, null);
            }
            else if (page.Name == "PhotoAlbumViewer")
            {
                PhotoAlbumNavActions.Refresh_Click(null, null);
            }
        }
示例#2
0
        public static void AddProductsToCart()
        {
            ChewablesPageObjects cpo = new ChewablesPageObjects();

            ChewablesOrderPageObjects copo = new ChewablesOrderPageObjects();

            NavigationActions.NavigateOurProductsChewablesClick();
            Task.Delay(500).Wait(1500);

            cpo.ScrollViewport();
            cpo.ShopNowPremiumChewables.Click();
            Assert.IsTrue(Driver.WebDriver.PageSource.Contains("Premium Soft Chewables"));
            cpo.ScrollViewport();
            copo.AddToCartOrder.Click();
            Thread.Sleep(1000);
        }
示例#3
0
        public static void ChangeCountry()
        {
            CartPageObjects cpo = new CartPageObjects();

            //Driver.WebDriver.Navigate().GoToUrl("https://sculpt.staging.juiceplus.com/ie/en");
            NavigationActions.NavigateCountryClick();
            //var cartCount = cpo.ShoppingCartIcon.GetAttribute("value");
            //try
            //{
            //    Assert.That(cartCount, Is.EqualTo("1"));
            //}
            //catch (Exception e)
            //{

            //    throw;
            //}
        }
示例#4
0
        static void Main(string[] args)
        {
            using (IWebDriver driver = new ChromeDriver())
            {
                LogInActions.Login(driver);

                driver.Navigate().GoToUrl("https://www.unovarpg.com/pokemon_locator.php");

                Pokemon Solgaleo = new Pokemon();

                using (var db = new PokeContext())
                {
                    Solgaleo = db.Pokemons.FirstOrDefault(x => x.Name == "Electabuzz");
                }

                NavigationActions.FindPokemon(driver, new Uri("https://www.unovarpg.com/map.php?map=6"), Solgaleo, Enums.SpecialType.Shiny, true);
                Console.ReadLine();
            }
        }
示例#5
0
        public static async void PasteItem_ClickAsync(object sender, RoutedEventArgs e)
        {
            // TODO: Add progress box and collision options for this operation
            var             DestinationPath = ItemViewModel.PUIP.Path;
            DataPackageView packageView     = Clipboard.GetContent();

            var ItemsToPaste = await packageView.GetStorageItemsAsync();

            foreach (IStorageItem item in ItemsToPaste)
            {
                if (item.IsOfType(StorageItemTypes.Folder))
                {
                    CloneDirectoryAsync(item.Path, DestinationPath, item.Name);
                }
                else if (item.IsOfType(StorageItemTypes.File))
                {
                    StorageFile ClipboardFile = await StorageFile.GetFileFromPathAsync(item.Path);

                    await ClipboardFile.CopyAsync(await StorageFolder.GetFolderFromPathAsync(DestinationPath), item.Name, NameCollisionOption.GenerateUniqueName);
                }
            }
            NavigationActions.Refresh_Click(null, null);
            if (packageView.RequestedOperation == DataPackageOperation.Move)
            {
                foreach (string path in pathsToDeleteAfterPaste)
                {
                    if (path.Contains("."))
                    {
                        StorageFile file = await StorageFile.GetFileFromPathAsync(path);

                        await file.DeleteAsync();
                    }
                    if (!path.Contains("."))
                    {
                        StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(path);

                        await folder.DeleteAsync();
                    }
                }
            }
        }
示例#6
0
        public async void ToggleQuickLook()
        {
            try
            {
                if (CurrentInstance.ContentPage.IsItemSelected && !App.CurrentInstance.ContentPage.isRenamingItem)
                {
                    var clickedOnItem = CurrentInstance.ContentPage.SelectedItem;

                    Debug.WriteLine("Toggle QuickLook");
                    ApplicationData.Current.LocalSettings.Values["path"]      = clickedOnItem.ItemPath;
                    ApplicationData.Current.LocalSettings.Values["Arguments"] = "ToggleQuickLook";
                    await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
                }
            }
            catch (FileNotFoundException)
            {
                await DialogDisplayHelper.ShowDialog(ResourceController.GetTranslation("FileNotFoundDialog.Title"), ResourceController.GetTranslation("FileNotFoundPreviewDialog.Text"));

                NavigationActions.Refresh_Click(null, null);
            }
        }
        public void RegistrationByMail_success()
        {
            NavigationActions.OpenMyIvi(_session);
            _session.FindElementByName("Регистрация").Click();
            ChromeDriver EmailGenerator = new ChromeDriver();

            EmailGenerator.Url = "http://www.yopmail.com/ru/email-generator.php";
            EmailGenerator.Navigate();

            var randomMail = EmailGenerator.FindElementByXPath("//*[@id='login']").GetAttribute("value");

            _session.FindElementByClassName("TextBlock").SendKeys(randomMail);
            _session.FindElementByClassName("Button").Click();
            _session.FindElementByClassName("TextBlock").SendKeys("1");
            _session.FindElementByClassName("Button").Click();
            _session.FindElementByClassName("ScrollViewer").Click();
            _session.FindElementByClassName("Button").Click();

            var maintheme = _session.FindElementByName("Мой ivi");

            Assert.IsNotNull(maintheme);
        }
示例#8
0
        public async void ToggleQuickLook()
        {
            try
            {
                if (CurrentInstance.ContentPage.IsItemSelected && !App.CurrentInstance.ContentPage.isRenamingItem)
                {
                    var clickedOnItem = CurrentInstance.ContentPage.SelectedItem;

                    Debug.WriteLine("Toggle QuickLook");
                    ApplicationData.Current.LocalSettings.Values["path"]      = clickedOnItem.ItemPath;
                    ApplicationData.Current.LocalSettings.Values["Arguments"] = "ToggleQuickLook";
                    await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
                }
            }
            catch (FileNotFoundException)
            {
                MessageDialog dialog = new MessageDialog("The file you are attempting to preview may have been moved or deleted.", "File Not Found");
                var           task   = dialog.ShowAsync();
                task.AsTask().Wait();
                NavigationActions.Refresh_Click(null, null);
            }
        }
示例#9
0
 public void TestAllHeaderNavigation()
 {
     NavigationActions.NavigateLiveBetterOverviewClick();
     NavigationActions.NavigateLiveBetterHealthyFamilyClick();
     NavigationActions.NavigateLiveBetterActiveLifestyleClick();
     NavigationActions.NavigateLiveBetterFeelGoodLookGoodClick();
     NavigationActions.NavigateLiveBetterOneSimpleChangeClick();
     NavigationActions.NavigateOurProductsOverViewClick();
     NavigationActions.NavigateOurProductsCapsulesClick();
     NavigationActions.NavigateOurProductsChewablesClick();
     NavigationActions.NavigateOurProductsOmegaClick();
     NavigationActions.NavigateOurProductsCompleteClick();
     NavigationActions.NavigateOurProductsUpliftClick();
     NavigationActions.NavigateOurProductsWhatIsJuicePlusClick();
     NavigationActions.NavigateOurCommunityOverviewClick();
     NavigationActions.NavigateOurCommunityBlogClick();
     NavigationActions.NavigateOurCommunityGivingBackClick();
     //NavigationActions.NavigateOurCommunityGoBeyondClick();
     NavigationActions.NavigateJoinUsClick();
     NavigationActions.NavCartIconClick();
     NavigationActions.NavLoginButtonClick();
 }
 public void TestAllFooterNavigation()
 {
     NavigationActions.NavigateCompany_AboutUs();
     NavigationActions.NavigateCompany_GivingBack();
     NavigationActions.NavigateCompany_ContactUs();
     NavigationActions.NavigateJuicePlus_HowCapsAreMade();
     //NavigationActions.NavigateJuicePlus_ClinicalResearch();
     //NavigationActions.NavigateJuicePlus_InformedChoice();
     NavigationActions.NavigateResources_OneSimpleChange();
     NavigationActions.NavigateResources_HealthyStartforFamilies();
     //NavigationActions.NavigateResources_LetsGoBeyond();
     NavigationActions.NavigateTermsOfUse();
     NavigationActions.NavigatePrivacyPolicy();
     NavigationActions.NavigateReturnPolicy();
     NavigationActions.NavigateTermsofService();
     NavigationActions.NavigateCountrySelect();
     Driver.WebDriver.Url = "https://www.staging.juiceplus.com/ie/en/";
     NavigationActions.NavigateFacebookClick();
     Driver.WebDriver.Url = "https://www.staging.juiceplus.com/ie/en/";
     NavigationActions.NavigateInstagramClick();
     Driver.WebDriver.Url = "https://www.staging.juiceplus.com/ie/en/";
     NavigationActions.NavigateYoutubeClick();
     Driver.WebDriver.Url = "https://www.staging.juiceplus.com/ie/en/";
 }
示例#11
0
        public static void AddOmegaBlendToCart()
        {
            WebDriverWait waitForElement = new WebDriverWait(Driver.WebDriver, TimeSpan.FromSeconds(30));

            NavigationActions.NavigateOurProductsOmegaClick();
            OmegaPageObjects opo  = new OmegaPageObjects();
            CartPageObjects  carp = new CartPageObjects();

            try
            {
                try
                {
                    Assert.IsFalse(Driver.WebDriver.PageSource.Contains("£"));
//                    Assert.IsTrue(Driver.WebDriver.PageSource.Contains("€"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                LandingPageObjects lan = new LandingPageObjects();
                Thread.Sleep(1000);
                lan.CookieAlertAcceptButton.Click();
                Task.Delay(500).Wait(1500);
                opo.ScrollViewport();
                OmegaOrderPageObjects oopo = new OmegaOrderPageObjects();
                var NumOfProducts          = oopo.NumOfProductOrder.GetAttribute("value");
                try
                {
                    Assert.That(NumOfProducts, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                oopo.IncrementArrowOrder.Click();
                var incrProductCount = oopo.NumOfProductOrder.GetAttribute("value");
                Thread.Sleep(500);

                try
                {
                    Assert.That(incrProductCount, Is.EqualTo("2"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                oopo.DecrementArrowOrder.Click();
                var decrProductCount = oopo.NumOfProductOrder.GetAttribute("value");
                try
                {
                    Assert.That(decrProductCount, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                oopo.AddToCartOrder.Click();
                NavigationHeaderPageObjects nav = new NavigationHeaderPageObjects();
                Thread.Sleep(1000);
                var NumInCart = nav.CartIconCounter.Text;
                Console.WriteLine(NumInCart);
                try
                {
                    Assert.That(NumInCart, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                nav.CartIconCounter.Click();

                waitForElement.Until(ExpectedConditions.ElementIsVisible(By.CssSelector(".m-icon-badge__counter")));
                nav.CheckoutButton.Click();
                carp.NavigateToProceedToCheckoutAndClick();
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e);
            }
        }
示例#12
0
        private async void OpenSelectedItems(bool displayApplicationPicker)
        {
            try
            {
                int  selectedItemCount;
                Type sourcePageType = App.CurrentInstance.CurrentPageType;
                selectedItemCount = CurrentInstance.ContentPage.SelectedItems.Count;

                // Access MRU List
                var mostRecentlyUsed = Windows.Storage.AccessCache.StorageApplicationPermissions.MostRecentlyUsedList;

                if (selectedItemCount == 1)
                {
                    var clickedOnItem     = CurrentInstance.ContentPage.SelectedItem;
                    var clickedOnItemPath = clickedOnItem.ItemPath;
                    if (clickedOnItem.PrimaryItemAttribute == StorageItemTypes.Folder)
                    {
                        // Add location to MRU List
                        mostRecentlyUsed.Add(await StorageFolder.GetFolderFromPathAsync(clickedOnItemPath));

                        CurrentInstance.ViewModel.WorkingDirectory = clickedOnItemPath;
                        CurrentInstance.NavigationToolbar.PathControlDisplayText = clickedOnItemPath;

                        CurrentInstance.ContentPage.AssociatedViewModel.EmptyTextState.IsVisible = Visibility.Collapsed;
                        CurrentInstance.ContentFrame.Navigate(sourcePageType, clickedOnItemPath, new SuppressNavigationTransitionInfo());
                    }
                    else
                    {
                        // Add location to MRU List
                        mostRecentlyUsed.Add(await StorageFile.GetFileFromPathAsync(clickedOnItem.ItemPath));
                        if (displayApplicationPicker)
                        {
                            StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.ItemPath);

                            var options = new LauncherOptions
                            {
                                DisplayApplicationPicker = true
                            };
                            await Launcher.LaunchFileAsync(file, options);
                        }
                        else
                        {
                            await InvokeWin32Component(clickedOnItem.ItemPath);
                        }
                    }
                }
                else if (selectedItemCount > 1)
                {
                    foreach (ListedItem clickedOnItem in CurrentInstance.ContentPage.SelectedItems)
                    {
                        if (clickedOnItem.PrimaryItemAttribute == StorageItemTypes.Folder)
                        {
                            instanceTabsView.AddNewTab(typeof(ModernShellPage), clickedOnItem.ItemPath);
                        }
                        else
                        {
                            // Add location to MRU List
                            mostRecentlyUsed.Add(await StorageFile.GetFileFromPathAsync(clickedOnItem.ItemPath));
                            if (displayApplicationPicker)
                            {
                                StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.ItemPath);

                                var options = new LauncherOptions
                                {
                                    DisplayApplicationPicker = true
                                };
                                await Launcher.LaunchFileAsync(file, options);
                            }
                            else
                            {
                                await InvokeWin32Component(clickedOnItem.ItemPath);
                            }
                        }
                    }
                }
            }
            catch (FileNotFoundException)
            {
                MessageDialog dialog = new MessageDialog("The file you are attempting to access may have been moved or deleted.", "File Not Found");
                await dialog.ShowAsync();

                NavigationActions.Refresh_Click(null, null);
            }
        }
示例#13
0
 public NavigateEventArgs(NavigationActions navAction, NavigationSection navSection, INavigationItem navItem)
 {
     NavAction  = navAction;
     NavSection = navSection;
     NavItem    = navItem;
 }
        public static void AddUpliftInstallmentPayCapsulePayInFullRecurringToCart()
        {
            try
            {
                WebDriverWait waitForElement = new WebDriverWait(Driver.WebDriver, TimeSpan.FromSeconds(30));
                NavigationActions.NavigateOurProductsUpliftClick();
                UpliftPageObjects upo = new UpliftPageObjects();
                try
                {
                    Assert.IsFalse(Driver.WebDriver.PageSource.Contains("£"));
//                    Assert.IsTrue(Driver.WebDriver.PageSource.Contains("€"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                LandingPageObjects lan = new LandingPageObjects();
                Thread.Sleep(1000);
                lan.CookieAlertAcceptButton.Click();
                Task.Delay(500).Wait(1500);
                upo.ScrollViewport();
                UpliftOrderPageObjects uopo = new UpliftOrderPageObjects();
                var NumOfProducts           = uopo.NumOfProductOrder.GetAttribute("value");
                try
                {
                    Assert.That(NumOfProducts, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                uopo.IncrementArrowOrder.Click();
                var incrProductCount = uopo.NumOfProductOrder.GetAttribute("value");
                Thread.Sleep(500);

                try
                {
                    Assert.That(incrProductCount, Is.EqualTo("2"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                uopo.DecrementArrowOrder.Click();
                var decrProductCount = uopo.NumOfProductOrder.GetAttribute("value");
                try
                {
                    Assert.That(decrProductCount, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                uopo.AddToCartOrder.Click();
                NavigationHeaderPageObjects nav = new NavigationHeaderPageObjects();
                Thread.Sleep(1000);
                var NumInCart = nav.CartIconCounter.Text;
                Console.WriteLine(NumInCart);
                try
                {
                    Assert.That(NumInCart, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                nav.CartIconCounter.Click();
                waitForElement.Until(ExpectedConditions.ElementIsVisible(By.CssSelector(".m-icon-badge__counter")));
                nav.CheckoutButton.Click();


                CartPageObjects carp = new CartPageObjects();

                carp.PayInInstallments.Click();

                NavigationActions.NavigateOurProductsCapsulesClick();
                CapsulesPageObjects caps = new CapsulesPageObjects();
                try
                {
                    Assert.IsFalse(Driver.WebDriver.PageSource.Contains("£"));
                    Assert.IsTrue(Driver.WebDriver.PageSource.Contains("€"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                caps.ClickVegetablesAndFruitCapsuleShopNow();
                CapsulesOrderPageObjects cpo = new CapsulesOrderPageObjects();
                try
                {
                    Assert.IsTrue(Driver.WebDriver.PageSource.Contains("Fruit & Vegetable Blend Capsules"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                caps.ScrollViewport();
                try
                {
                    Assert.That(NumOfProducts, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                cpo.IncrementArrowOrderCapsules.Click();
                Thread.Sleep(500);
                try
                {
                    Assert.That(incrProductCount, Is.EqualTo("2"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                cpo.DecrementArrowOrderCapsules.Click();

                try
                {
                    Assert.That(decrProductCount, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                cpo.AddToCartOrderCapsules.Click();
                Thread.Sleep(1000);
                Console.WriteLine(NumInCart);
                try
                {
                    Assert.That(NumInCart, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                Thread.Sleep(500);
                nav.CartIconCounter.Click();
                waitForElement.Until(ExpectedConditions.ElementIsVisible(By.CssSelector(".m-icon-badge__counter")));
                nav.CheckoutButton.Click();
                carp.NavigateToProceedToCheckoutAndClick();
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e);
            }
        }
示例#15
0
        private async void OpenSelectedItems(bool displayApplicationPicker)
        {
            try
            {
                string selectedItemPath = null;
                int    selectedItemCount;
                Type   sourcePageType = App.CurrentInstance.CurrentPageType;
                selectedItemCount = (CurrentInstance.ContentPage as BaseLayout).SelectedItems.Count;
                if (selectedItemCount == 1)
                {
                    selectedItemPath = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0].FilePath;
                }

                // Access MRU List
                var mostRecentlyUsed = Windows.Storage.AccessCache.StorageApplicationPermissions.MostRecentlyUsedList;

                if (selectedItemCount == 1)
                {
                    var clickedOnItem = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0];
                    if (clickedOnItem.FileType == "Folder")
                    {
                        // Add location to MRU List
                        mostRecentlyUsed.Add(await StorageFolder.GetFolderFromPathAsync(selectedItemPath));

                        CurrentInstance.ViewModel.Universal.WorkingDirectory     = selectedItemPath;
                        CurrentInstance.NavigationToolbar.PathControlDisplayText = selectedItemPath;

                        (CurrentInstance.ContentPage as BaseLayout).AssociatedViewModel.EmptyTextState.isVisible = Visibility.Collapsed;
                        App.CurrentInstance.SidebarSelectedItem = App.sideBarItems.FirstOrDefault(x => x.Path != null && x.Path.Equals(selectedItemPath, StringComparison.OrdinalIgnoreCase));
                        if (App.CurrentInstance.SidebarSelectedItem == null)
                        {
                            App.CurrentInstance.SidebarSelectedItem = App.sideBarItems.FirstOrDefault(x => x.Path != null && x.Path.Equals(Path.GetPathRoot(selectedItemPath), StringComparison.OrdinalIgnoreCase));
                        }
                        CurrentInstance.ContentFrame.Navigate(sourcePageType, selectedItemPath, new SuppressNavigationTransitionInfo());
                    }
                    else
                    {
                        // Add location to MRU List
                        mostRecentlyUsed.Add(await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath));
                        if (displayApplicationPicker)
                        {
                            StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath);

                            var options = new LauncherOptions
                            {
                                DisplayApplicationPicker = true
                            };
                            await Launcher.LaunchFileAsync(file, options);
                        }
                        else
                        {
                            await InvokeWin32Component(clickedOnItem.FilePath);
                        }
                    }
                }
                else if (selectedItemCount > 1)
                {
                    foreach (ListedItem clickedOnItem in (CurrentInstance.ContentPage as BaseLayout).SelectedItems)
                    {
                        if (clickedOnItem.FileType == "Folder")
                        {
                            instanceTabsView.AddNewTab(typeof(ProHome), clickedOnItem.FilePath);
                        }
                        else
                        {
                            // Add location to MRU List
                            mostRecentlyUsed.Add(await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath));
                            if (displayApplicationPicker)
                            {
                                StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath);

                                var options = new LauncherOptions
                                {
                                    DisplayApplicationPicker = true
                                };
                                await Launcher.LaunchFileAsync(file, options);
                            }
                            else
                            {
                                await InvokeWin32Component(clickedOnItem.FilePath);
                            }
                        }
                    }
                }
            }
            catch (FileNotFoundException)
            {
                MessageDialog dialog = new MessageDialog("The file you are attempting to access may have been moved or deleted.", "File Not Found");
                await dialog.ShowAsync();

                NavigationActions.Refresh_Click(null, null);
            }
        }
示例#16
0
        public static async void PasteItem_ClickAsync(object sender, RoutedEventArgs e)
        {
            // TODO: Add progress box and collision options for this operation
            var             DestinationPath = ItemViewModel.PUIP.Path;
            DataPackageView packageView     = Clipboard.GetContent();
            var             ItemsToPaste    = await packageView.GetStorageItemsAsync();

            foreach (IStorageItem item in ItemsToPaste)
            {
                try // tries to do this if collision doesn't happen
                {
                    if (isReplaceEnabled)
                    {
                        if (item.IsOfType(StorageItemTypes.Folder))
                        {
                            CloneDirectoryAsync(item.Path, DestinationPath, item.Name, true, item);
                        }
                        else if (item.IsOfType(StorageItemTypes.File))
                        {
                            StorageFile ClipboardFile = await StorageFile.GetFileFromPathAsync(item.Path);

                            await ClipboardFile.CopyAndReplaceAsync(await StorageFile.GetFileFromPathAsync(DestinationPath + @"\" + item.Name));
                        }
                    }
                    else if (isSkipEnabled)
                    {
                        // Skip doing anything with file entirely
                    }
                    else if (isReviewEnabled)
                    {
                        ItemSnapshot            = item;
                        DestinationPathSnapshot = DestinationPath;
                        ItemViewModel.DisplayReviewUIWithArgs("Skip or Replace This Item?", "An item already exists with the name " + item.Name + ".");
                        isLoopPaused = true;
                    }
                    else   // First time of this collision, so prompt for user choice
                    {
                        ItemViewModel.DisplayCollisionUIWithArgs("Replace All Existing Items?", "You can choose whether to replace or skip all items if there are more than one. Optionally, you can review each one individually.");
                        return;
                    }
                }
                catch (Exception)
                {
                    if (isReplaceEnabled)
                    {
                        if (item.IsOfType(StorageItemTypes.Folder))
                        {
                            CloneDirectoryAsync(item.Path, DestinationPath, item.Name, true, item);
                        }
                        else if (item.IsOfType(StorageItemTypes.File))
                        {
                            StorageFile ClipboardFile = await StorageFile.GetFileFromPathAsync(item.Path);

                            await ClipboardFile.CopyAndReplaceAsync(await StorageFile.GetFileFromPathAsync(DestinationPath + @"\" + item.Name));
                        }
                    }
                    else if (isSkipEnabled)
                    {
                        // Skip doing anything with file entirely
                    }
                    else if (isReviewEnabled)
                    {
                        ItemSnapshot            = item;
                        DestinationPathSnapshot = DestinationPath;
                        ItemViewModel.DisplayReviewUIWithArgs("Skip or Replace This Item?", "An item already exists with the name " + item.Name + ".");
                    }
                    else   // First time of this collision, so prompt for user choice
                    {
                        ItemViewModel.DisplayCollisionUIWithArgs("Replace All Existing Items?", "You can choose whether to replace or skip all items if there are more than one. Optionally, you can review each one individually.");
                        return;
                    }
                }
            }

            NavigationActions.Refresh_Click(null, null);
        }
示例#17
0
        private async void OpenSelectedItems(bool displayApplicationPicker)
        {
            try
            {
                string selectedItemPath = null;
                int    selectedItemCount;
                Type   sourcePageType = App.CurrentInstance.CurrentPageType;
                selectedItemCount = (CurrentInstance.ContentPage as BaseLayout).SelectedItems.Count;
                if (selectedItemCount == 1)
                {
                    selectedItemPath = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0].FilePath;
                }

                // Access MRU List
                var mostRecentlyUsed = Windows.Storage.AccessCache.StorageApplicationPermissions.MostRecentlyUsedList;

                if (selectedItemCount == 1)
                {
                    var clickedOnItem = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0];
                    if (clickedOnItem.FileType == "Folder")
                    {
                        // Add location to MRU List
                        mostRecentlyUsed.Add(await StorageFolder.GetFolderFromPathAsync(selectedItemPath));

                        CurrentInstance.ViewModel.Universal.path = selectedItemPath;
                        CurrentInstance.PathControlDisplayText   = selectedItemPath;

                        (CurrentInstance.ContentPage as BaseLayout).AssociatedViewModel.EmptyTextState.isVisible = Visibility.Collapsed;
                        if (selectedItemPath == Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))
                        {
                            CurrentInstance.PathControlDisplayText = "Desktop";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = App.sideBarItems.First(x => (x as INavigationControlItem).Path.Equals(App.AppSettings.DesktopPath, StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.DesktopPath, new SuppressNavigationTransitionInfo());
                        }
                        else if (selectedItemPath == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
                        {
                            CurrentInstance.PathControlDisplayText = "Documents";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = App.sideBarItems.First(x => (x as INavigationControlItem).Path.Equals(App.AppSettings.DocumentsPath, StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.DocumentsPath, new SuppressNavigationTransitionInfo());
                        }
                        else if (selectedItemPath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads"))
                        {
                            CurrentInstance.PathControlDisplayText = "Downloads";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = App.sideBarItems.First(x => (x as INavigationControlItem).Path.Equals(App.AppSettings.DownloadsPath, StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.DownloadsPath, new SuppressNavigationTransitionInfo());
                        }
                        else if (selectedItemPath == Environment.GetFolderPath(Environment.SpecialFolder.MyPictures))
                        {
                            CurrentInstance.PathControlDisplayText = "Pictures";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = App.sideBarItems.First(x => (x as INavigationControlItem).Path.Equals(App.AppSettings.PicturesPath, StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.PicturesPath, new SuppressNavigationTransitionInfo());
                        }
                        else if (selectedItemPath == Environment.GetFolderPath(Environment.SpecialFolder.MyMusic))
                        {
                            CurrentInstance.PathControlDisplayText = "Music";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = App.sideBarItems.First(x => (x as INavigationControlItem).Path.Equals(App.AppSettings.MusicPath, StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.MusicPath, new SuppressNavigationTransitionInfo());
                        }
                        else if (selectedItemPath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\OneDrive"))
                        {
                            CurrentInstance.PathControlDisplayText = "OneDrive";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = SettingsViewModel.foundDrives.First(x => (x as DriveItem).tag.ToString().Equals("OneDrive", StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.OneDrivePath, new SuppressNavigationTransitionInfo());
                        }
                        else if (selectedItemPath == Environment.GetFolderPath(Environment.SpecialFolder.MyVideos))
                        {
                            CurrentInstance.PathControlDisplayText = "Videos";
                            (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = App.sideBarItems.First(x => (x as INavigationControlItem).Path.Equals(App.AppSettings.VideosPath, StringComparison.OrdinalIgnoreCase));
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, App.AppSettings.VideosPath, new SuppressNavigationTransitionInfo());
                        }
                        else
                        {
                            if (selectedItemPath.Split(@"\")[0].Contains("C:"))
                            {
                                (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = SettingsViewModel.foundDrives.Where(x => (x as DriveItem).tag == "C:\\").First();
                            }
                            else
                            {
                                (App.CurrentInstance as ProHome).SidebarControl.SidebarNavView.SelectedItem = SettingsViewModel.foundDrives.Where(x => (x as DriveItem).tag.Contains(selectedItemPath.Split(@"\")[0])).First();
                            }
                            CurrentInstance.ContentFrame.Navigate(sourcePageType, selectedItemPath, new SuppressNavigationTransitionInfo());
                        }
                    }
                    else
                    {
                        if (clickedOnItem.FileType == "Folder")
                        {
                            instanceTabsView.AddNewTab(typeof(ProHome), clickedOnItem.FilePath);
                        }
                        else
                        {
                            // Add location to MRU List
                            mostRecentlyUsed.Add(await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath));
                            if (displayApplicationPicker)
                            {
                                StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath);

                                var options = new LauncherOptions
                                {
                                    DisplayApplicationPicker = true
                                };
                                await Launcher.LaunchFileAsync(file, options);
                            }
                            else
                            {
                                await InvokeWin32Component(clickedOnItem.FilePath);
                            }
                        }
                    }
                }
                else if (selectedItemCount > 1)
                {
                    foreach (ListedItem clickedOnItem in (CurrentInstance.ContentPage as BaseLayout).SelectedItems)
                    {
                        if (clickedOnItem.FileType == "Folder")
                        {
                            instanceTabsView.AddNewTab(typeof(ProHome), clickedOnItem.FilePath);
                        }
                        else
                        {
                            // Add location to MRU List
                            mostRecentlyUsed.Add(await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath));
                            if (displayApplicationPicker)
                            {
                                StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath);

                                var options = new LauncherOptions
                                {
                                    DisplayApplicationPicker = true
                                };
                                await Launcher.LaunchFileAsync(file, options);
                            }
                            else
                            {
                                await InvokeWin32Component(clickedOnItem.FilePath);
                            }
                        }
                    }
                }
            }
            catch (FileNotFoundException)
            {
                MessageDialog dialog = new MessageDialog("The file you are attempting to access may have been moved or deleted.", "File Not Found");
                await dialog.ShowAsync();

                NavigationActions.Refresh_Click(null, null);
            }
        }
示例#18
0
 public void ValdiateContactForm()
 {
     NavigationActions.NavigateCompany_ContactUs();
 }
示例#19
0
        public static void AddSOROUpliftToCart()
        {
            try
            {
                WebDriverWait waitForElement = new WebDriverWait(Driver.WebDriver, TimeSpan.FromSeconds(30));
                NavigationActions.NavigateOurProductsOmegaClick();
                UpliftPageObjects upo = new UpliftPageObjects();
                try
                {
                    Assert.IsFalse(Driver.WebDriver.PageSource.Contains("£"));
                    Assert.IsTrue(Driver.WebDriver.PageSource.Contains("€"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                LandingPageObjects lan = new LandingPageObjects();
                lan.CookieAlertAcceptButton.Click();
                Task.Delay(500).Wait(1500);
                upo.ScrollViewport();
                UpliftOrderPageObjects uopo = new UpliftOrderPageObjects();
                var NumOfProducts           = uopo.NumOfProductOrder.GetAttribute("value");
                try
                {
                    Assert.That(NumOfProducts, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);;
                }

                uopo.IncrementArrowOrder.Click();
                var incrProductCount = uopo.NumOfProductOrder.GetAttribute("value");
                Thread.Sleep(500);

                try
                {
                    Assert.That(incrProductCount, Is.EqualTo("2"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                uopo.DecrementArrowOrder.Click();
                var decrProductCount = uopo.NumOfProductOrder.GetAttribute("value");
                try
                {
                    Assert.That(decrProductCount, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                uopo.AddToCartOrder.Click();
                NavigationHeaderPageObjects nav = new NavigationHeaderPageObjects();
                Thread.Sleep(1000);
                var NumInCart = nav.CartIconCounter.Text;
                Console.WriteLine(NumInCart);
                try
                {
                    Assert.That(NumInCart, Is.EqualTo("1"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                nav.CartIconCounter.Click();
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e);
            }
        }
示例#20
0
 public void num_fail()
 {
     NavigationActions.OpenMyIvi(_session);
     _session.FindElementByClassName("TextBlock").SendKeys("77777");
 }