Ejemplo n.º 1
0
        public async void SelectFavoritePage(object sender, SelectedItemChangedEventArgs e)
        {
            FavoritePage favoritePage = e.SelectedItem as FavoritePage;

            if (favoritePage != null)
            {
                //DependencyService.Get<IProgressInterface>().Show();

                App.Current.MainPage.Navigation.PushPopupAsync(new MyMessageBoxView(AddErrorMessage("Error al agregar la fucion")), true);
                //App.CSurrent.MainPage.Navigation.PushPopupAsync(new MyMessageBoxView(AddSuccessMessage("Funcion agregada correctamente a tus funciones mas utilizadas")), true);

                /*if (favoritePage.ItsBeingUsed)
                 * {
                 *  RemoveFavoritePage();
                 * }
                 * else
                 * {
                 *  AddFavoritePage();
                 * }
                 */
                favoritePage.ItsBeingUsed = !favoritePage.ItsBeingUsed;
                AddFavoritePageViewModel.FavoritePageSelected = favoritePage;
            }
            ((ListView)sender).SelectedItem = null;
        }
Ejemplo n.º 2
0
        protected override long ExecuteWorkImplementation()
        {
            var now      = DateTime.UtcNow;
            var user     = m_favoritesRepository.Load <User>(m_userId);
            var bookPage = m_resourceRepository.GetLatestResourceVersion <PageResource>(m_data.PageId);

            if (bookPage == null)
            {
                throw new MainServiceException(MainServiceErrorCode.PageNotFound,
                                               $"Page with ID {m_data.PageId} not found",
                                               HttpStatusCode.NotFound,
                                               new object[] { m_data.PageId });
            }

            var label = GetFavoriteLabelAndCheckAuthorization(m_data.FavoriteLabelId, user.Id);

            label.LastUseTime = now;

            var favoriteItem = new FavoritePage
            {
                ResourcePage  = bookPage.Resource,
                Title         = m_data.Title,
                FavoriteLabel = label,
                CreateTime    = now,
            };

            var resultId = (long)m_favoritesRepository.Create(favoriteItem);

            return(resultId);
        }
Ejemplo n.º 3
0
        public void IsAddToFavoriteWork()
        {
            #region TestData
            string phoneName  = "huawei p10 plus";
            bool   testResult = false;
            #endregion

            HeaderPageFragment headerPageFragment = new HeaderPageFragment(webDriver);
            headerPageFragment.serachObject(phoneName);

            SearchResultPage searchResultPage = new SearchResultPage(webDriver);
            searchResultPage.addToFavorite(0);
            var favoriteTitle = searchResultPage.getTitle(searchResultPage.favoriteElement);

            headerPageFragment.navToFavourites();

            FavoritePage favoritePage = new FavoritePage(webDriver);
            favoritePage.createSnippedCardTitlesList();


            foreach (var title in favoritePage.snippetCardTitles)
            {
                if (title.Contains(favoriteTitle))
                {
                    testResult = true;
                    break;
                }
            }

            Assert.IsTrue(testResult);
        }
Ejemplo n.º 4
0
        public static void NavigateTo(PageTypes pageType, object viewmodel = null)
        {
            Page newPage = null;

            switch (pageType)
            {
            case PageTypes.Search:
                newPage = _searchPage = _searchPage ?? new SearchPage();
                break;

            case PageTypes.Favorite:
                newPage = new FavoritePage();
                break;

            case PageTypes.Checker:
                newPage = _checkerPage = _checkerPage ?? new CheckerPage();
                break;

            default:
                break;
            }
            if (newPage == null)
            {
                return;
            }

            if (viewmodel != null)
            {
                newPage.DataContext = viewmodel;
            }

            RootFrame.Navigate(newPage);
        }
Ejemplo n.º 5
0
 public void AddFavoritePage(FavoritePage favoritePage)
 {
     if (favoritePage != null)
     {
         FavoritePages.Add(favoritePage);
     }
 }
Ejemplo n.º 6
0
        public void N11()
        {
            // Driver & URL's configuration
            driver = new FirefoxDriver();
            //driver = new ChromeDriver();
            driver.Manage().Window.Maximize();
            driver.Navigate().GoToUrl("https://www.n11.com");
            Thread.Sleep(2000);

            //Login the n11
            LoginPage login = new LoginPage(driver);

            login.signInButton();
            login.typeUsername();
            login.typePassword();
            login.clickOnLoginButton();
            Thread.Sleep(2000);

            //Search activity
            Searching search = new Searching(driver);

            search.Search();
            Thread.Sleep(2000);
            search.clickSearchButton();
            Thread.Sleep(2000);
            search.pageTwo();
            Thread.Sleep(2000);

            //Result For Samsung search and adding 3 element in favorite list
            AddingFavorite checkPageAndAddFavorite = new AddingFavorite(driver);

            checkPageAndAddFavorite.resultForSamsung();
            Thread.Sleep(2000);

            //Open Favorite Page
            FavoritePage fav = new FavoritePage(driver);

            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            fav.hoverMenu();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            //Select Favorite Item
            fav.selectFavoriteItem();
            Thread.Sleep(2000);

            //Remove From Favorites
            fav.deleteFavoriteItem();
            Thread.Sleep(2000);

            //Check watched items
            fav.checkFavItem();
            Thread.Sleep(2000);

            //Quit browser
            driver.Quit();
        }
Ejemplo n.º 7
0
        public virtual IList <FavoritePage> GetAllPageBookmarksByBookId(long projectId, long userId)
        {
            FavoritePage  favoritePageAlias  = null;
            FavoriteLabel favoriteLabelAlias = null;
            Resource      resourcePageAlias  = null;

            return(GetSession().QueryOver(() => favoritePageAlias)
                   .JoinAlias(() => favoritePageAlias.ResourcePage, () => resourcePageAlias)
                   .JoinAlias(() => favoritePageAlias.FavoriteLabel, () => favoriteLabelAlias)
                   .Where(() => resourcePageAlias.Project.Id == projectId && favoriteLabelAlias.User.Id == userId)
                   .Fetch(SelectMode.Fetch, x => x.FavoriteLabel)
                   .List());
        }
        //private readonly ScenarioContext _scenarioContext;

        public TestMainFunctionsSteps(ScenarioContext scenarioContext)
        {
            //_scenarioContext = scenarioContext;
            testAppPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "BoxingTimer.apk");
            desiredCaps.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Android_Accelerated_x86_Oreo");
            desiredCaps.AddAdditionalCapability(AndroidMobileCapabilityType.AppPackage, "com.nulltree.roundbell");
            desiredCaps.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android");
            desiredCaps.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "9");
            desiredCaps.AddAdditionalCapability(MobileCapabilityType.App, testAppPath);
            _driver            = new AndroidDriver <AndroidElement>(new Uri("http://127.0.0.1:4723/wd/hub"), desiredCaps);
            mainPage           = new MainPage(_driver);
            settingsPage       = new SettingsPage(_driver);
            favoritePage       = new FavoritePage(_driver);
            additionalInfoPage = new AdditionalInfoPage(_driver);
        }
Ejemplo n.º 9
0
        public void TestMethod()
        {
            HomePage homePage = new HomePage(browser);

            //1
            homePage.OpenPage(Config.BaseUrl);
            Assert.IsTrue(homePage.IsOpenedPage(Config.BaseUrl));

            //2
            homePage.ClickBtnSignIn();
            LoginPage loginPage = new LoginPage(browser);

            loginPage.ClickLoginButton(Config.Username, Config.Password);

            //3
            homePage.SearchData("samsung");

            SearchResultPage searchResultPage = new SearchResultPage(browser);

            //4
            Assert.IsTrue(searchResultPage.IsThereSearchData);

            //5
            searchResultPage.GoPageNumber("2");
            Assert.IsTrue(searchResultPage.IsOpenPageNumer("2"));

            //6
            searchResultPage.AddItemFavoriteList(2, out string productCode);

            //7
            ClaimListPage claimListPage = new ClaimListPage(browser);

            claimListPage.GoClaimListPage();
            claimListPage.ClickMyFavorites();

            FavoritePage favoritePage = new FavoritePage(browser);

            //8
            Assert.IsTrue(favoritePage.IsThereFavoriteItem(productCode));

            //9
            favoritePage.RemoveFavoriteItem(productCode);

            //10
            Assert.IsFalse(favoritePage.IsThereFavoriteItem(productCode));
        }
Ejemplo n.º 10
0
        public async void SelectFavoritePage(object sender, SelectedItemChangedEventArgs e)
        {
            FavoritePage favoritePage = e.SelectedItem as FavoritePage;

            if (favoritePage != null)
            {
                var myClassType = Type.GetType(string.Format("{0}.{1}", Constants.NameSpace, favoritePage.Page + "View"));

                if (myClassType != null)
                {
                    await Navigation.PushAsync((MyContentPageRenderer)Activator.CreateInstance(myClassType));
                }
                else
                {
                    await Navigation.PushAsync(new NotFoundView());
                }
            }
            ((ListView)sender).SelectedItem = null;
        }
        public void LoadView(MainWindowViewType typeView)
        {
            switch (typeView)
            {
            case MainWindowViewType.Main:
                //загружаем вьюшку, ее вьюмодель
                HomePage          view = new HomePage();
                HomePageViewModel vm   = new HomePageViewModel(this);
                //связываем их м/собой
                view.DataContext = vm;
                //отображаем
                OutputView = view;
                break;

            case MainWindowViewType.BrowseAdverts:
                //загружаем вьюшку, ее вьюмодель
                BrowseAdvertsPage      viewBrowseAdverts = new BrowseAdvertsPage();
                BrowseAdvertsViewModel vmBrowseAdverts   = new BrowseAdvertsViewModel(this);
                //связываем их м/собой
                viewBrowseAdverts.DataContext = vmBrowseAdverts;
                //отображаем
                OutputView = viewBrowseAdverts;
                break;

            case MainWindowViewType.CreateAd:
                CreateAdPage      viewCreateAd = new CreateAdPage();
                CreateAdViewModel vmCreateAd   = new CreateAdViewModel(this);
                viewCreateAd.DataContext = vmCreateAd;
                OutputView = viewCreateAd;
                break;

            case MainWindowViewType.Favorite:
                FavoritePage          viewFavorite = new FavoritePage();
                FavoritePageViewModel vmFavorite   = new FavoritePageViewModel(this);
                viewFavorite.DataContext = vmFavorite;
                OutputView = viewFavorite;
                break;
            }
        }