Inheritance: System.Web.UI.Page
コード例 #1
0
 public static SearchPageViewModel Create(SearchPage currentPage, string query, int page) {
     var model= new SearchPageViewModel(currentPage);
     PageViewModelBuilder.SetBaseProperties(model);
     model.SearchResult = new PagedList<SearchHit>(GetSearchResult(currentPage, query, page), page, PageSize);
     model.Query = query;
     model.Page = page;
     return model;
 }
コード例 #2
0
        private static List<SearchHit> GetSearchResult(SearchPage currentPage, string query, int page) {
            // Build the query and tell the search engine that we want the additional fields "category" and "summary"
            var searchQuery = new SearchQuery(query) {
                MetaData = new[] {"category", "summary"}
                //NumberOfHitsToReturn = PageSize,
                //ReturnFromPosition = PageSize*(page - 1)
            };

            // Perform the searh
            var result = SearchManager.Instance.Search(searchQuery);

            return result.Hits;
        }
        public void VerifySearchResults_FoundationTemplate()
        {
            RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/sitefinity/pages", false));
            RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().User().EnsureAdminLoggedIn());
            BAT.Macros().NavigateTo().Pages(this.Culture);
            BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(SearchPage);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(SearchBoxWidget);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(SearchResultsWidget);

            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(SearchBoxWidget);
            BATFeather.Wrappers().Backend().Search().SearchBoxWrapper().SelectSearchIndex(SearchIndexName);
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ClickSelectButton();
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().WaitForItemsToAppear(2);
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInFlatSelector(SearchPage);
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().DoneSelecting();
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifySelectedItemsFromFlatSelector(new string[] { SearchPage });
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage();

            BAT.Macros().NavigateTo().CustomPage("~/" + SearchPage.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchInput(NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchButton(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(0, NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchInput(SearchText1);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchButton(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(1, SearchText1);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsList(NewsTitle1);

            BAT.Macros().User().LogOut();
            BAT.Macros().NavigateTo().CustomPage("~/" + SearchPage.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchInput(NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchButton(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(0, NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchInput(SearchText2);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchButton(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(1, SearchText2);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsList(NewsTitle2);
        }
コード例 #4
0
 public BaseSearchPageParser(int startFromPage)
 {
     page = new SearchPage(startFromPage);
 }
コード例 #5
0
        public void GivenISelectAnyRandomPaintFromSearchResultPage()
        {
            SearchPage mypage = new SearchPage();

            mypage.SelectPaint();
        }
コード例 #6
0
            public void ValidateAdvancedSearch()
            {
                var search = new SearchPage();

                search.ValidateSearch();
            }
コード例 #7
0
            public void ValidateSignin()
            {
                var search = new SearchPage();

                search.ValidateSignin();
            }
コード例 #8
0
        public void Prerequisites()
        {
            bool isMenuSelected = false;
            int stepNo = 0;
            int applicationNumber = 0;
            int indexNumber = 0;
            int fileNumber = 0;
            // Gets scriptname through reflection
            string testScriptName = GetTestScriptName();

            // Loads config data and creates a Singleton object of Configuration and loads data into generic test case variables
            GetConfigData();

            // Get process exe file path
            string[] processPath = PrepareProcessFilePath();

            // Get debug viewer exe file path
            string configFilesLocation = PrepareConfigureDataFilePath();

            // Get log directory details from xml file
            PrepareLogDirectoryPath(configFilesLocation);

            // Start debug viewer
            ApplicationLog applicationLog = new ApplicationLog(configFilesLocation, reportFileDirectory, testScriptName);
            applicationLog.StartDebugViewer();

            // Prepare test data file path
            string testDataFilePath = PrepareTestDataFilePath(testScriptName);

            string applicationName = null;

            SessionHandler sessionHandler = new SessionHandler();
            Browser browser = sessionHandler.GetBrowserInstance();
            try
            {
                if (null == browser)
                {
                    browser = BrowserFactory.Instance.GetBrowser(browserId, testScriptName, configFilesLocation);
                    LoginPage loginPage = new LoginPage(browser);
                    stepNo++;
                    SearchPage searchPageNew = loginPage.Login(this.userName, this.password, this.applicationURL, this.timeout, processPath);
                    Assert.IsNotNull(searchPageNew, "Failed to login in application");
                    WriteLogs(testScriptName, stepNo, "Login succssfull.", "PASS", browser);

                }

                SearchPage searchPage = new SearchPage(browser);
                string emailAddress = GetValuesFromXML("Prerequisite", "EmailAddress", testDataFilePath);
                string userPassword = GetValuesFromXML("Prerequisite", "Password", testDataFilePath);

                stepNo++;
                isMenuSelected = searchPage.SelectMenuItem("Admin", "User Configurations", null);
                Assert.IsTrue(isMenuSelected, "Navigation to User Configurations page failed.");
                WriteLogs(testScriptName, stepNo, "Navigation to User Configurations page passed.", "PASS", browser);

                for (int count1 = 1; count1 <= 2; count1++)
                {
                    string userNode = "User";
                    userNode = userNode + count1.ToString();
                    string user = GetValuesFromXML("Prerequisite", userNode, testDataFilePath);

                    stepNo++;
                    UserConfigurationPage userConfigurationPage = new UserConfigurationPage(browser);
                    userConfigurationPage = userConfigurationPage.VerifyUserPresent(user);

                    if (null == userConfigurationPage)
                    {
                        stepNo++;
                        userConfigurationPage = new UserConfigurationPage(browser);
                        UserDetailsPage userDetailsPage = userConfigurationPage.ClickAddUserButton();
                        Assert.IsNotNull(userDetailsPage, "Click add user failed");
                        WriteLogs(testScriptName, stepNo, "Add user button Clicked", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userDetailsPage.AddUpdateUser(user, emailAddress, userPassword,true,false);
                        Assert.IsNotNull(userConfigurationPage, "Adding user failed");
                        WriteLogs(testScriptName, stepNo, "Adding user passed", "PASS", browser);

                        stepNo++;
                        UserPermissionPage userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(user);
                        Assert.IsNotNull(userPermissionPage, "Click User aceess button failed");
                        WriteLogs(testScriptName, stepNo, "Click User aceess button passed", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userPermissionPage.UncheckResetPasswordNextLoginCheckbox();
                        Assert.IsNotNull(userPermissionPage, "Uncheck Reset Password Next Login Checkbox failed");
                        WriteLogs(testScriptName, stepNo, "Uncheck Reset Password Next Login Checkbox passed", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Click Update Button User Permission failed");
                        WriteLogs(testScriptName, stepNo, "Click Update Button User Permission passed", "PASS", browser);
                    }
                    else
                    {
                        WriteLogs(testScriptName, stepNo, "User already present", "PASS", browser);
                    }
                }
                string appliactionCount = GetValuesFromXML("Prerequisite", "ApplicationCount", testDataFilePath);
                int count = Int32.Parse(appliactionCount);
                for (applicationNumber = 1; applicationNumber <= count; applicationNumber++)
                {
                    string applicationNameNode = "Application";
                    applicationNameNode = applicationNameNode + applicationNumber.ToString();
                    applicationName = GetValuesFromXML(applicationNameNode, "Name", testDataFilePath);

                    //Navigating To Applications Page
                    stepNo++;
                    isMenuSelected = searchPage.SelectMenuItem("Admin", "Applications", null);
                    Assert.IsTrue(isMenuSelected, "Navigation to application page failed.");
                    WriteLogs(testScriptName, stepNo, "Navigation to application page passed.", "PASS", browser);

                    stepNo++;
                    ApplicationPage applicationPage = new ApplicationPage(browser);
                    applicationPage = applicationPage.IsApplicationExist(applicationName);
                    if (null == applicationPage)
                    {
                        applicationPage = new ApplicationPage(browser);
                        AddApplicationPage addApplicationPage = applicationPage.ClickAddApplicationButton();
                        Assert.IsNotNull(addApplicationPage, "Click add application failed");
                        WriteLogs(testScriptName, stepNo, "Add Application Button Clicked", "PASS", browser);

                        stepNo++;
                        EditApplicationPage editApplicationPage = new EditApplicationPage(browser);
                        if (applicationNumber == 4)
                        {
                            editApplicationPage = addApplicationPage.addApplicationDetails(applicationName, applicationName, false, false, false, false, false, true, false, null);
                            Assert.IsNotNull(editApplicationPage, applicationName + " application Added Failed");
                            WriteLogs(testScriptName, stepNo, applicationName + " application Added Succesfully ", "PASS", browser);
                        }
                        else if (applicationNumber == 1 || applicationNumber == 5)
                        {
                            editApplicationPage = addApplicationPage.addApplicationDetails(applicationName, applicationName, false, false, false, false, false, false, false, null);
                            Assert.IsNotNull(editApplicationPage, applicationName + " application Added Failed");
                            WriteLogs(testScriptName, stepNo, applicationName + " application Added Succesfully ", "PASS", browser);
                        }
                        else
                        {
                            editApplicationPage = addApplicationPage.addApplicationDetails(applicationName, applicationName, true, false, false, false, false, false, false, null);
                            Assert.IsNotNull(editApplicationPage, applicationName + " application added Failed");
                            WriteLogs(testScriptName, stepNo, applicationName + " application added Succesfully ", "PASS", browser);
                        }
                        string indexCount = GetValuesFromXML(applicationNameNode, "IndexCount", testDataFilePath);
                        int count1 = Int32.Parse(indexCount);
                        //Adding Application Index
                        for (indexNumber = 1; indexNumber <= count1; indexNumber++)
                        {
                            string indexNameNade = "IndexName";
                            string indexTypeNade = "IndexType";
                            indexNameNade = indexNameNade + indexNumber.ToString();
                            indexTypeNade = indexTypeNade + indexNumber.ToString();
                            string indexName = GetValuesFromXML(applicationNameNode, indexNameNade, testDataFilePath);
                            string indexType = GetValuesFromXML(applicationNameNode, indexTypeNade, testDataFilePath);
                            stepNo++;
                            if (1 == indexNumber)
                            {
                                editApplicationPage = editApplicationPage.AddApplicationIndex(true, indexName, indexType, false, false, false, false);
                            }
                            else
                            {
                                editApplicationPage = editApplicationPage.AddApplicationIndex(false, indexName, indexType, false, false, false, false);
                            }
                            Assert.IsNotNull(editApplicationPage, "Adding application index failed");
                            WriteLogs(testScriptName, stepNo, "Index in application Added Succesfully ", "PASS", browser);
                        }
                        //Implementing Application
                        stepNo++;
                        editApplicationPage = editApplicationPage.ImplementApplication(true);
                        Assert.IsNotNull(editApplicationPage, "Implement application failed for application " + applicationName);
                        WriteLogs(testScriptName, stepNo, applicationName + " application Implemented Succesfully ", "PASS", browser);

                        //Navigating To User Configuration Page
                        stepNo++;
                        isMenuSelected = searchPage.SelectMenuItem("Admin", "User Configurations", null);
                        Assert.IsTrue(isMenuSelected, "Navigating to user configuration failed");
                        WriteLogs(testScriptName, stepNo, "Navigation to User Configurations page passed.", "PASS", browser);

                        stepNo++;
                        UserConfigurationPage userConfigurationPage = new UserConfigurationPage(browser);
                        UserPermissionPage userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(this.userName);
                        Assert.IsNotNull(userPermissionPage, "Click user Access link failed");
                        WriteLogs(testScriptName, stepNo, "Click on User Access on User Configuration Page ", "PASS", browser);

                        stepNo++;
                        ApplicationLevelPermissionPage applicationLevelPermissionPage = userPermissionPage.NavigateToApplicationConfiguration(applicationName);
                        Assert.IsNotNull(applicationLevelPermissionPage, "Click  on application configuration image failed");
                        WriteLogs(testScriptName, stepNo, "Click on Application Configuration image ", "PASS", browser);

                        stepNo++;
                        applicationLevelPermissionPage = applicationLevelPermissionPage.SelectAllAccountFuncMgnt();
                        Assert.IsNotNull(applicationLevelPermissionPage, "Select all account function management failed");
                        WriteLogs(testScriptName, stepNo, "Select All Account Management Checkbox Clicked ", "PASS", browser);

                        stepNo++;
                        applicationLevelPermissionPage = applicationLevelPermissionPage.SelectAllCabinetMgnt();
                        Assert.IsNotNull(applicationLevelPermissionPage, "Select all cabinet mangement failed");
                        WriteLogs(testScriptName, stepNo, "Select All Cabinet Management Checkbox Clicked ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = applicationLevelPermissionPage.ClickUpdateButtonAppConf();
                        Assert.IsNotNull(userPermissionPage, "Update application level permissions failed");
                        WriteLogs(testScriptName, stepNo, "Update Application Level Permissions Clicked ", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Update user permissions failed");
                        WriteLogs(testScriptName, stepNo, "Update User Permissions Clicked ", "PASS", browser);

                        string user1 = GetValuesFromXML("Prerequisite", "User1", testDataFilePath);
                        string user2 = GetValuesFromXML("Prerequisite", "User2", testDataFilePath);

                        stepNo++;
                        userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(user1);
                        Assert.IsNotNull(userPermissionPage, "Click user Access link failed");
                        WriteLogs(testScriptName, stepNo, "Click on User Access on User Configuration Page ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userPermissionPage.CheckUncheckApplicationUserConf(applicationName, true);
                        Assert.IsNotNull(userPermissionPage, "Selecting Application for UserA failed");
                        WriteLogs(testScriptName, stepNo, "Selecting Application for UserA passed ", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Click Update Button failed");
                        WriteLogs(testScriptName, stepNo, "Click Update Button passed ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(user2);
                        Assert.IsNotNull(userPermissionPage, "Click user Access link failed");
                        WriteLogs(testScriptName, stepNo, "Click on User Access on User Configuration Page ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userPermissionPage.CheckUncheckApplicationUserConf(applicationName, true);
                        Assert.IsNotNull(userPermissionPage, "Selecting Application for UserA failed");
                        WriteLogs(testScriptName, stepNo, "Selecting Application for UserA passed ", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Click Update Button failed");
                        WriteLogs(testScriptName, stepNo, "Click Update Button passed ", "PASS", browser);
                        applicationName = GetValuesFromXML(applicationNameNode, "Name", testDataFilePath);
                        string fileCount = GetValuesFromXML(applicationNameNode, "FileCount", testDataFilePath);
                        int count2 = Int32.Parse(fileCount);
                        string sourceFolder = this.currentDirectory + this.projectDirectory + "\\" + this.testDataDirectory + "\\" + testScriptName + "\\";
                        string[] files = new string[count2];
                        for (fileNumber = 1; fileNumber <= count2; fileNumber++)
                        {
                            string fileNameNode = "FileName";
                            fileNameNode = fileNameNode + fileNumber.ToString();
                            files[fileNumber - 1] = GetValuesFromXML(applicationNameNode, fileNameNode, testDataFilePath);
                        }
                        stepNo++;
                        bool isFilesCopied = userConfigurationPage.CopyFilesToIncomingFolder(applicationName, sourceFolder, files);
                        Assert.IsTrue(isFilesCopied, "Copying files to incoming folder failed for " + applicationName);
                        WriteLogs(testScriptName, stepNo, "Copying files to incoming folder passed for " + applicationName, "PASS", browser);

                        stepNo++;
                        isMenuSelected = userConfigurationPage.SelectMenuItem("Indexing", null, null);
                        Assert.IsTrue(isMenuSelected, "Navigation to indexing page failed ");
                        WriteLogs(testScriptName, stepNo, "Navigation to indexing page passed ", "PASS", browser);

                        stepNo++;
                        IndexingPage indexingPage = new IndexingPage(browser);
                        indexingPage = indexingPage.SelectApplication(applicationName);
                        Assert.IsNotNull(indexingPage, "Select application failed for " + applicationName);
                        WriteLogs(testScriptName, stepNo, "Select application passed for " + applicationName, "PASS", browser);

                        stepNo++;
                        isMenuSelected = userConfigurationPage.SelectMenuItem("Indexing", null, null);
                        Assert.IsTrue(isMenuSelected, "Navigation to indexing page failed ");
                        WriteLogs(testScriptName, stepNo, "Navigation to indexing page passed ", "PASS", browser);

                        stepNo++;
                        indexingPage = indexingPage.SelectApplication(applicationName);
                        Assert.IsNotNull(indexingPage, "Select application failed for " + applicationName);
                        WriteLogs(testScriptName, stepNo, "Select application passed for " + applicationName, "PASS", browser);

                        stepNo++;
                        indexingPage = indexingPage.NavigateToFirstPage();
                        Assert.IsNotNull(indexingPage, "Navigation to first document failed ");
                        WriteLogs(testScriptName, stepNo, "Navigation to first document passed ", "PASS", browser);

                        string indexValeNode = "IndexValue";
                        string indexValue = GetValuesFromXML(applicationNameNode, indexValeNode, testDataFilePath);
                        if (indexValue == "null")
                        {
                            indexValue = null;
                        }
                        for (fileNumber = 1; fileNumber <= count2; fileNumber++)
                        {
                            stepNo++;
                            indexingPage = indexingPage.AddIndexDetails(indexValue, applicationName);
                            Assert.IsNotNull(indexingPage, indexValue + " adding index failed for " + applicationName);
                            WriteLogs(testScriptName, stepNo, indexValue + " adding index passed for " + applicationName, "PASS", browser);
                        }
                    }
                    else
                    {
                        stepNo++;
                        WriteLogs(testScriptName, stepNo, applicationName + " application exist", "PASS", browser);
                    }
                }

            }
            catch (Exception exception)
            {
                stepNo++;
                WriteLogs(testScriptName, stepNo, "Execution of script terminated. Exception is " + exception.Message, "FAIL", browser);
                Assert.IsTrue(false, "Execution of script terminated.");
            }
            finally
            {

                sessionHandler.StoreBrowserInstance(browser);
                stepNo++;
                // to stop debeg viewer
                applicationLog.StopDebugViewer();
                bool isExceptionFound = applicationLog.VerifyDebugLogFiles(reportFileDirectory, testScriptName);
                if (!isExceptionFound)
                {
                    WriteLogs(testScriptName, stepNo, "Exception/error found in log file", "INFO", browser);
                }
            }
        }
コード例 #9
0
 public GoogleSearchSteps()
 {
     mySearch = new SearchPage();
 }
コード例 #10
0
        private void searchButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult MD = ModernDialog.ShowMessage("Deseja filtrar os resultados de pesquisa com base no escrito nas caixas de texto?", "Pesquisa", MessageBoxButton.YesNo);
            if (MD == MessageBoxResult.Yes)
            {
                try
                {
                    var query =
                        from s in tilapia.TB_BIOMETRIAs.AsEnumerable()
                        join c in tilapia.TB_CAIXAs.AsEnumerable() on s.CAI_CODIGO equals c.CAI_CODIGO
                        select new { Caixa = s.CAI_CODIGO, Data = s.BIO_DATA.Value.ToShortDateString(), Replica = c.CAI_REPLICA, Tratamento = c.CAI_TRATAMENTO, Peso = s.BIO_PESO, Quantidade = s.BIO_QUANTIDADE };
                    if (codBox.Text != "")
                        query = query.Where(x => x.Caixa.Equals(codBox.Text));
                    if (dataBox.Text != "")
                        query = query.Where(x => x.Data.Equals(dataBox.Text));
                    if (pesoBox.Text != "")
                        query = query.Where(x => x.Peso == double.Parse(pesoBox.Text));
                    if (quantidadeBox.Text != "")
                        query = query.Where(x => x.Quantidade == int.Parse(quantidadeBox.Text));
                    DataTable dt = new DataTable();
                    dt.Columns.Add("Caixa", typeof(string));
                    dt.Columns.Add("Data", typeof(string));
                    dt.Columns.Add("Réplica", typeof(int));
                    dt.Columns.Add("Tratamento", typeof(int));
                    dt.Columns.Add("Peso", typeof(double));
                    dt.Columns.Add("Quantidade", typeof(int));
                    foreach (var element in query)
                    {
                        var row = dt.NewRow();
                        row["Caixa"] = element.Caixa;
                        row["Data"] = element.Data;
                        row["Réplica"] = element.Replica;
                        row["Tratamento"] = element.Tratamento;
                        row["Peso"] = element.Peso;
                        row["Quantidade"] = element.Quantidade;
                        dt.Rows.Add(row);
                    }
                    SearchPage page = new SearchPage(query, dt);
                    page.Show();

                }
                catch (Exception error)
                {
                    ModernDialog.ShowMessage("Por favor verifique os dados solicitados.\nCaso não consiga resolver o problema, contate o suporte.", "Erro", MessageBoxButton.OK);
                }
            }
            else
            {
                var query =
                        from s in tilapia.TB_BIOMETRIAs.AsEnumerable()
                        join c in tilapia.TB_CAIXAs.AsEnumerable() on s.CAI_CODIGO equals c.CAI_CODIGO
                        select new { Caixa = s.CAI_CODIGO, Data = s.BIO_DATA.Value.ToShortDateString(), Replica = c.CAI_REPLICA, Tratamento = c.CAI_TRATAMENTO, Peso = s.BIO_PESO, Quantidade = s.BIO_QUANTIDADE };
                DataTable dt = new DataTable();
                dt.Columns.Add("Caixa", typeof(string));
                dt.Columns.Add("Data", typeof(string));
                dt.Columns.Add("Réplica", typeof(int));
                dt.Columns.Add("Tratamento", typeof(int));
                dt.Columns.Add("Peso", typeof(double));
                dt.Columns.Add("Quantidade", typeof(int));
                foreach (var element in query)
                {
                    var row = dt.NewRow();
                    row["Caixa"] = element.Caixa;
                    row["Data"] = element.Data;
                    row["Réplica"] = element.Replica;
                    row["Tratamento"] = element.Tratamento;
                    row["Peso"] = element.Peso;
                    row["Quantidade"] = element.Quantidade;
                    dt.Rows.Add(row);
                }
                SearchPage page = new SearchPage(query, dt);
                page.Show();
            }
        }
コード例 #11
0
        public Application(IApp page)
        {
            __that = this;

            this.yield = message =>
            {
                Native.window.alert("hello! " + new { message });
            };


            //((IHTMLElement)Native.document.body.parentNode).style.borderTop = "1em yellow yellow";

            //IStyleSheet.Default["html"].style.borderTop = "1em yellow yellow";


            IStyleSheet.Default["body"].style.borderLeft = "0em yellow solid";

            // activate all animations?
            IStyleSheet.Default["body"].style.transition = "border-left 300ms linear";
            IStyleSheet.Default["body"].style.borderLeft = "3em yellow solid";

            new IHTMLDiv
            {
                innerHTML = @"
<style>
html {
    transition: border-top 500ms linear;
    border-top: 4em solid cyan;
}

</style>"
            }.With(
           async div =>
           {
               //await Native.window.requestAnimationFrameAsync;

               // wont work for html?
               await Task.Delay(100);

               div.AttachToDocument();
           }
       );

            #region proof we can still find our element by id even if on a sub page
            new IHTMLTextArea { }.AttachTo(Native.document.body.parentNode).With(
                async area =>
                {
                    area.style.position = IStyle.PositionEnum.absolute;
                    area.style.right = "1em";
                    area.style.bottom = "1em";
                    area.style.zIndex = 1000;
                    area.readOnly = true;


                    Action colors = async delegate
                    {
                        for (int i = 0; i < 3; i++)
                        {

                            area.style.backgroundColor = "red";
                            await Task.Delay(200);
                            area.style.backgroundColor = "yellow";
                            await Task.Delay(200);
                        }
                        await Native.window.requestAnimationFrameAsync;
                        area.style.transition = "background-color 10000ms linear";

                        await Native.window.requestAnimationFrameAsync;

                        area.style.backgroundColor = "white";
                    };


                    colors();




                    var st = new Stopwatch();
                    st.Start();

                    while (true)
                    {
                        // proof we can still find our element by id even if on a sub page
                        area.value = page.message.innerText + "\n" + st.ToString();

                        await Task.Delay(500);
                    }
                }
            );
            #endregion





            //page.Location = Native.document.location.hash;

            // #/OtherPage.htm

            Console.WriteLine(new { Native.document.location.pathname });


            #region GoThirdPage
            Action GoThirdPage = delegate
            {
                //IStyleSheet.Default["body"].style.borderLeft = "0em yellow solid";

                //await Task.Delay(300);

                // Console.WriteLine("pushState");
                // Native.window.history.pushState(
                //    null,
                //    null,
                //     //"/thirdpage.htm"
                //    "/third-page"
                //);

                Console.WriteLine("replaceState");
                Native.window.history.pushState(
                    //"/third-page",
                    new { },
                    "/third-page",
                    async scope =>
                    {
                        // did the server prerender our page?
                        Console.WriteLine("at replaceState");

                        var xtitle = Native.document.title;

                        // { nodeName = #text } 
                        var hidden = (IHTMLElement)Native.document.body.querySelectorAll("hidden-body").FirstOrDefault();
                        Console.WriteLine("replaceState " + new { hidden });
                        var layout = default(IThirdPage);

                        if (hidden == null)
                        {
                            hidden = new IHTMLElement("hidden-body");
                            hidden.style.display = IStyle.DisplayEnum.none;

                            layout = new ThirdPage();
                            Native.document.title = layout.title.innerText;

                            var page_body = Native.document.body;

                            layout.body.appendChild(hidden);
                            page_body.parentNode.replaceChild(layout.body, page_body);

                            // we can also keep it memory
                            hidden.appendChild(page_body);
                        }
                        else
                        {
                            //{ nodeName = YDOB } 
                            var page_ydob = (IElement)hidden.querySelectorAll("ydob").FirstOrDefault();
                            if (page_ydob != null)
                            {
                                // chrome will skip body. have to repair on the client

                                var page_body = new IHTMLBody();

                                page_ydob.attributes.ToArray().WithEach(a => { page_ydob.removeAttribute(a.name); page_body.setAttribute(a.name, a.value); });
                                page_ydob.childNodes.ToArray().WithEach(a => { page_ydob.removeChild(a); page_body.appendChild(a); });

                                hidden.replaceChild(page_body, page_ydob);

                            }

                            layout = new ThirdPage.FromDocument();
                        }

                        // ready!

                        // one wait works half time only
                        //await Native.window.requestAnimationFrameAsync;
                        //await Native.window.requestAnimationFrameAsync;

                        //await Task.Delay(11);

                        var xthat = __that;
                        __that = null;
                        var x = new ThirdPageApplication(
                            layout,
                            xthat,
                            "pushState"
                        );

                        await scope;
                        __that = xthat;
                        Console.WriteLine("restore state!"); ;
                        Native.document.title = xtitle;

                        //Native.document.body.parentNode.replaceChild(hidden.querySelectorAll("body")[0], Native.document.body);
                        Native.document.body.parentNode.replaceChild(hidden.querySelectorAll("body").First(), Native.document.body);
                    }
                );
            };
            #endregion



            page.GoThirdPageViaCode.WhenClicked(
                  async button =>
                {
                    GoThirdPage();
                }
            );

            page.GoThirdPageViaLocation.WhenClicked(
                  async button =>
                  {
                      Native.document.location.href = "/third-page";
                  }
              );

            //if (Native.document.location.hash.StartsWith("#/"))
            //{
            //    Native.window.history.replaceState(
            //        new { foo = 1 },
            //        "",
            //        Native.document.location.hash.Substring(1)
            //    );

            //    //Native.window.history.replaceState(
            //    //    new { foo = 1 },
            //    //    scope =>
            //    //    {
            //    //        Native.document.body.style.backgroundColor = "yellow";
            //    //    }
            //    //);
            //}


            #region /third-page
            new[] { "ThirdPage.htm", "third-page" }.WithEach(
                async uri =>
                {
                    await Native.window.requestAnimationFrameAsync;

                    var selector = "a[href='" + uri + "']";


                    IStyleSheet.Default[selector].style.color = "red";


                    Native.document.body.querySelectorAll(IHTMLAnchor.HTMLElementEnum.a).WithEach(
                        xx =>
                        {
                            var x = (IHTMLAnchor)xx;


                            if (Native.document.location.href + uri != x.href)
                                return;

                            //Console.WriteLine(new { a = x.href, uri, Native.document.location.href });
                            // { a = http://192.168.43.252:13445/ThirdPage.htm, uri = ThirdPage.htm, href = http://192.168.43.252:13445/ } 

                            x.onclick +=
                                e =>
                                {
                                    e.preventDefault();
                                    GoThirdPage();
                                };
                        }
                    );

                    if (__that != null)
                        if (Native.document.location.pathname == "/" + uri)
                        {
                            //Native.window.history.replaceState(
                            //     null,
                            //     null,
                            //    //"/thirdpage.htm"
                            //    "/ThirdPage.htm"
                            //    //"/third-page"
                            // );


                            var layout = new ThirdPage.FromDocument();

                            new ThirdPageApplication(layout, __that, ".ctor");
                        }
                }
            );
            #endregion





            #region GoSearchPage
            Action GoSearchPage = delegate
            {
                //IStyleSheet.Default["body"].style.borderLeft = "0em yellow solid";

                //await Task.Delay(300);

                // Console.WriteLine("pushState");
                // Native.window.history.pushState(
                //    null,
                //    null,
                //     //"/thirdpage.htm"
                //    "/third-page"
                //);

                Console.WriteLine("replaceState");
                Native.window.history.pushState(
                    //"/third-page",
                    new { },
                    "/s",
                    async scope =>
                    {
                        // did the server prerender our page?
                        Console.WriteLine("at replaceState");

                        var xtitle = Native.document.title;

                        // { nodeName = #text } 
                        var hidden = (IHTMLElement)Native.document.body.querySelectorAll("hidden-body").FirstOrDefault();
                        Console.WriteLine("replaceState " + new { hidden });
                        var layout = default(ISearchPage);

                        if (hidden == null)
                        {
                            hidden = new IHTMLElement("hidden-body");
                            hidden.style.display = IStyle.DisplayEnum.none;

                            layout = new SearchPage();
                            Native.document.title = layout.title.innerText;

                            var page_body = Native.document.body;

                            layout.body.appendChild(hidden);
                            page_body.parentNode.replaceChild(layout.body, page_body);

                            // we can also keep it memory
                            hidden.appendChild(page_body);
                        }
                        else
                        {
                            //{ nodeName = YDOB } 
                            var page_ydob = (IElement)hidden.querySelectorAll("ydob").FirstOrDefault();
                            if (page_ydob != null)
                            {
                                // chrome will skip body. have to repair on the client

                                var page_body = new IHTMLBody();

                                page_ydob.attributes.ToArray().WithEach(a => { page_ydob.removeAttribute(a.name); page_body.setAttribute(a.name, a.value); });
                                page_ydob.childNodes.ToArray().WithEach(a => { page_ydob.removeChild(a); page_body.appendChild(a); });

                                hidden.replaceChild(page_body, page_ydob);

                            }

                            layout = new SearchPage.FromDocument();
                        }

                        // ready!

                        // one wait works half time only
                        //await Native.window.requestAnimationFrameAsync;
                        //await Native.window.requestAnimationFrameAsync;

                        //await Task.Delay(11);

                        var xthat = __that;
                        __that = null;
                        var x = new SearchPageApplication(
                            layout,
                            xthat
                        );

                        await scope;
                        __that = xthat;
                        Console.WriteLine("restore state!"); ;
                        Native.document.title = xtitle;
                        //Native.document.body.parentNode.replaceChild(hidden.querySelectorAll("body")[0], Native.document.body);
                        Native.document.body.parentNode.replaceChild(hidden.querySelectorAll("body").First(), Native.document.body);
                    }
                );
            };
            #endregion


            #region /s
            new[] { "SearchPage.htm", "s" }.WithEach(
              async uri =>
              {
                  await Native.window.requestAnimationFrameAsync;

                  var selector = "a[href='" + uri + "']";


                  IStyleSheet.Default[selector].style.color = "orange";

                  Native.document.body.querySelectorAll(IHTMLAnchor.HTMLElementEnum.a).WithEach(
                        xx =>
                        {
                            var x = (IHTMLAnchor)xx;


                            if (Native.document.location.href + uri != x.href)
                                return;

                            x.style.borderBottom = "1px dashed blue";

                            x.onclick +=
                                e =>
                                {
                                    e.preventDefault();
                                    GoSearchPage();
                                };
                        }
                  );

                  if (__that != null)
                      if (Native.document.location.pathname == "/" + uri)
                      {
                          var layout = new SearchPage.FromDocument();

                          new SearchPageApplication(layout, this);
                      }
              }
          );
            #endregion

        }
コード例 #12
0
ファイル: PartialHandlers.cs プロジェクト: JacobCWard/People
        public void Register() {
            Handle.GET("/people/partials/organizations", () => {
                OrganizationsPage p = new OrganizationsPage() {
                    Html = "/People/viewmodels/OrganizationsPage.html"
                };

                p.RefreshOrganizations();

                return p;
            });

            Handle.GET("/people/partials/persons", () => {
                PersonsPage p = new PersonsPage() {
                    Html = "/People/viewmodels/PersonsPage.html"
                };

                p.RefreshPersons();

                return p;
            });

            Handle.GET("/people/partials/organizations-add", () => {
                return Db.Scope<OrganizationPage>(() => {
                    OrganizationPage page = new OrganizationPage() {
                        Html = "/People/viewmodels/OrganizationPage.html"
                    };

                    page.RefreshOrganization();

                    return page;
                });
            });

            Handle.GET("/people/partials/organizations/{?}", (string id) => {
                int level = Handle.CallLevel;

                if (level == 1) {
                    return Db.Scope<OrganizationPage>(() => {
                        OrganizationPage page = new OrganizationPage() {
                            Html = "/People/viewmodels/OrganizationPage.html"
                        };

                        page.RefreshOrganization(id);

                        return page;
                    });
                } else {
                    return Db.Scope<OrganizationSmallPage>(() => {
                        OrganizationSmallPage page = new OrganizationSmallPage();

                        //Temporary fix.
                        page.Html = "/People/viewmodels/OrganizationSmallPage.html";
                        page.RefreshOrganization(id);

                        return page;
                    });
                }
            });

            Handle.GET("/people/partials/persons-add", () => {
                return Db.Scope<PersonPage>(() => {
                    PersonPage page = new PersonPage() {
                        Html = "/People/viewmodels/PersonPage.html"
                    };

                    page.RefreshPerson();

                    return page;
                });
            });

            Handle.GET<string>("/people/partials/persons/{?}", (string id) => {
                return Db.Scope<PersonPage>(() => {
                    PersonPage page = new PersonPage() {
                        Html = "/People/viewmodels/PersonPage.html"
                    };

                    page.RefreshPerson(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/organization-persons/{?}", (string id) => {
                return Db.Scope<OrganizationPersonPage>(() => {
                    OrganizationPersonPage page = new OrganizationPersonPage();

                    page.RefreshOrganizationPerson(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/address-relations/{?}", (string id) => {
                return Db.Scope<AddressRelationPage>(() => {
                    AddressRelationPage page = new AddressRelationPage() {
                        Html = "/People/viewmodels/AddressRelationPage.html"
                    };

                    page.RefreshAddressRelation(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/addresses/{?}", (string id) => {
                return Db.Scope<AddressPage>(() => {
                    AddressPage page = new AddressPage() {
                        Html = "/People/viewmodels/AddressPage.html"
                    };

                    page.RefreshAddress(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/email-address-relations/{?}", (string id) => {
                return Db.Scope<EmailAddressRelationPage>(() => {
                    EmailAddressRelationPage page = new EmailAddressRelationPage() {
                        Html = "/People/viewmodels/EmailAddressRelationPage.html"
                    };

                    page.RefreshEmailAddressRelation(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/email-addresses/{?}", (string id) => {
                return Db.Scope<EmailAddressPage>(() => {
                    EmailAddressPage page = new EmailAddressPage() {
                        Html = "/People/viewmodels/EmailAddressPage.html"
                    };

                    page.RefreshAddress(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/phone-number-relations/{?}", (string id) => {
                return Db.Scope<PhoneNumberRelationPage>(() => {
                    PhoneNumberRelationPage page = new PhoneNumberRelationPage() {
                        Html = "/People/viewmodels/PhoneNumberRelationPage.html"
                    };

                    page.RefreshPhoneNumberRelation(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/phone-number/{?}", (string id) => {
                return Db.Scope<PhoneNumberPage>(() => {
                    PhoneNumberPage page = new PhoneNumberPage() {
                        Html = "/People/viewmodels/PhoneNumberPage.html"
                    };

                    page.RefreshPhoneNumber(id);

                    return page;
                });
            });

            Handle.GET("/people/partials/search/{?}", (string query) => {
                SearchPage page = new SearchPage() {
                    Html = "/People/viewmodels/SearchPage.html"
                };

                SearchProvider provider = new SearchProvider();
                int fetch = 5;

                foreach (Organization item in provider.SelectOrganizations(query, fetch)) {
                    page.Organizations.Add(Self.GET<Json>("/people/partials/search-organization/" + item.Key));
                }

                foreach (Person item in provider.SelectPersons(query, fetch)) {
                    page.Persons.Add(Self.GET<Json>("/people/partials/search-person/" + item.Key));
                }

                return page;
            });

            Handle.GET("/people/partials/search-organization/{?}", (string id) => {
                SearchOrganizationPage page = new SearchOrganizationPage() {
                    Html = "/People/viewmodels/SearchOrganizationPage.html"
                };

                page.Data = DbHelper.FromID(DbHelper.Base64DecodeObjectID(id)) as Organization;

                return page;
            });

            Handle.GET("/people/partials/search-person/{?}", (string id) => {
                SearchPersonPage page = new SearchPersonPage() {
                    Html = "/People/viewmodels/SearchPersonPage.html"
                };

                page.Data = DbHelper.FromID(DbHelper.Base64DecodeObjectID(id)) as Person;

                return page;
            });

            Handle.GET("/people/partials/person-preview/{?}", (string id) => {
                PersonPreviewPage page = new PersonPreviewPage();

                page.Data = DbHelper.FromID(DbHelper.Base64DecodeObjectID(id)) as Person;

                return page;
            });

            Handle.GET("/people/partials/organization-preview/{?}", (string id) => {
                OrganizationPreviewPage page = new OrganizationPreviewPage();

                page.Data = DbHelper.FromID(DbHelper.Base64DecodeObjectID(id)) as Organization;

                return page;
            });
        }
コード例 #13
0
 private void searchButton_Click(object sender, RoutedEventArgs e)
 {
     MessageBoxResult MD = ModernDialog.ShowMessage("Deseja filtrar os resultados de pesquisa com base no escrito nas caixas de texto?", "Pesquisa", MessageBoxButton.YesNo);
     if (MD == MessageBoxResult.Yes)
     {
         try
         {
             var query = from s in tilapia.TB_COLETA7s.AsEnumerable()
                         join c in tilapia.TB_CAIXAs.AsEnumerable() on s.CAI_CODIGO equals c.CAI_CODIGO
                         select new { Caixa = s.CAI_CODIGO, Data = s.CL7_DATA.Value.ToShortDateString(), Replica = c.CAI_REPLICA, Tratamento = c.CAI_TRATAMENTO, Alcalinade = s.CL7_ALCALINIDADE, Amônia = s.CL7_AMONIA, Clorofila = s.CL7_CLOROFILA, Dureza = s.CL7_DUREZA, Nitrato = s.CL7_NITRATO, Nitrito = s.CL7_NITRITO, Ortofosfato = s.CL7_ORTOFOSFATO };
             if (codBox.Text != "")
                 query = query.Where(x => x.Caixa.Equals(codBox.Text));
             if (dataBox.Text != "")
                 query = query.Where(x => x.Data.Equals(dataBox.Text));
             if (alacalinidadeBox.Text != "")
                 query = query.Where(x => x.Alcalinade == double.Parse(alacalinidadeBox.Text));
             if (amoniaBox.Text != "")
                 query = query.Where(x => x.Amônia == double.Parse(amoniaBox.Text));
             if (clorofilaBox.Text != "")
                 query = query.Where(x => x.Clorofila == double.Parse(clorofilaBox.Text));
             if (durezaBox.Text != "")
                 query = query.Where(x => x.Dureza == double.Parse(durezaBox.Text));
             if (nitratoBox.Text != "")
                 query = query.Where(x => x.Nitrato == double.Parse(nitratoBox.Text));
             if (nitritoBox.Text != "")
                 query = query.Where(x => x.Nitrito == double.Parse(nitritoBox.Text));
             if (fosfatoBox.Text != "")
                 query = query.Where(x => x.Ortofosfato == double.Parse(fosfatoBox.Text));
             DataTable dt = new DataTable();
             dt.Columns.Add("Caixa", typeof(string));
             dt.Columns.Add("Data", typeof(string));
             dt.Columns.Add("Réplica", typeof(int));
             dt.Columns.Add("Tratamento", typeof(int));
             dt.Columns.Add("Alcalinade", typeof(double));
             dt.Columns.Add("Amônia", typeof(double));
             dt.Columns.Add("Clorofila", typeof(double));
             dt.Columns.Add("Dureza", typeof(double));
             dt.Columns.Add("Nitrato", typeof(double));
             dt.Columns.Add("Nitrito", typeof(double));
             dt.Columns.Add("Ortofosfato", typeof(double));
             foreach (var element in query)
             {
                 var row = dt.NewRow();
                 row["Caixa"] = element.Caixa;
                 row["Data"] = element.Data;
                 row["Réplica"] = element.Replica;
                 row["Tratamento"] = element.Tratamento;
                 row["Alcalinade"] = element.Alcalinade;
                 row["Amônia"] = element.Amônia;
                 row["Clorofila"] = element.Clorofila;
                 row["Dureza"] = element.Dureza;
                 row["Nitrato"] = element.Nitrato;
                 row["Nitrito"] = element.Nitrito;
                 row["Ortofosfato"] = element.Ortofosfato;
                 dt.Rows.Add(row);
             }
             SearchPage page = new SearchPage(query, dt);
             page.Show();
         }
         catch (Exception error)
         {
             ModernDialog.ShowMessage("Por favor verifique os dados solicitados.\nCaso não consiga resolver o problema, contate o suporte.\n", "Erro", MessageBoxButton.OK);
         }
     }
     else
     {
         var query = from s in tilapia.TB_COLETA7s.AsEnumerable()
                     join c in tilapia.TB_CAIXAs.AsEnumerable() on s.CAI_CODIGO equals c.CAI_CODIGO
                     select new { Caixa = s.CAI_CODIGO, Data = s.CL7_DATA.Value.ToShortDateString(), Replica = c.CAI_REPLICA, Tratamento = c.CAI_TRATAMENTO, Alcalinade = s.CL7_ALCALINIDADE, Amônia = s.CL7_AMONIA, Clorofila = s.CL7_CLOROFILA, Dureza = s.CL7_DUREZA, Nitrato = s.CL7_NITRATO, Nitrito = s.CL7_NITRITO, Ortofosfato = s.CL7_ORTOFOSFATO };
         DataTable dt = new DataTable();
         dt.Columns.Add("Caixa", typeof(string));
         dt.Columns.Add("Data", typeof(string));
         dt.Columns.Add("Réplica", typeof(int));
         dt.Columns.Add("Tratamento", typeof(int));
         dt.Columns.Add("Alcalinade", typeof(double));
         dt.Columns.Add("Amônia", typeof(double));
         dt.Columns.Add("Clorofila", typeof(double));
         dt.Columns.Add("Dureza", typeof(double));
         dt.Columns.Add("Nitrato", typeof(double));
         dt.Columns.Add("Nitrito", typeof(double));
         dt.Columns.Add("Ortofosfato", typeof(double));
         foreach (var element in query)
         {
             var row = dt.NewRow();
             row["Caixa"] = element.Caixa;
             row["Data"] = element.Data;
             row["Réplica"] = element.Replica;
             row["Tratamento"] = element.Tratamento;
             row["Alcalinade"] = element.Alcalinade;
             row["Amônia"] = element.Amônia;
             row["Clorofila"] = element.Clorofila;
             row["Dureza"] = element.Dureza;
             row["Nitrato"] = element.Nitrato;
             row["Nitrito"] = element.Nitrito;
             row["Ortofosfato"] = element.Ortofosfato;
             dt.Rows.Add(row);
         }
         SearchPage page = new SearchPage(query, dt);
         page.Show();
     }
 }
コード例 #14
0
ファイル: SearchPageTest.cs プロジェクト: spiffydudex/navbot
 public void TestCaseSetUp()
 {
     page = new SearchPage(TestObjectFactory.CreateMockTradeFinderFactory());
     query = new NameValueCollection();
 }
コード例 #15
0
 public void InitPages()
 {
     loginPage  = new LoginPage(Driver);
     homePage   = new HomePage(Driver);
     searchPage = new SearchPage(Driver);
 }
コード例 #16
0
        public void ChooseRoundTrip()
        {
            SearchPage searchPage = new SearchPage(driver);

            searchPage.SetDirectionRoundTrip();
        }
コード例 #17
0
 public SearchPageViewModel(string query, int currentPageNumber, int pageSize, SearchPage currentPage, SearchResult <IContent> results)
 {
     Query             = query;
     CurrentPage       = currentPage;
     CurrentPageNumber = currentPageNumber;
     TotalPages        = (int)Math.Ceiling((double)results.TotalCount / pageSize);
     Items             = results.Items;
 }
コード例 #18
0
 public void SetUpForAddComputerTest()
 {
     addComputer = new AddComputerPage(commonDriver.driver);
     searchPage  = new SearchPage(commonDriver.driver);
     searchPage.ClickOnAddNewComputerButtonLink();
 }
コード例 #19
0
        private WeatherViewModel()
        {
            SearchCommand = new Command(
                execute: async(object address) =>
            {
                var page            = new SearchPage();
                var model           = new SearchViewModel(address as string);
                page.BindingContext = model;
                await Application.Current.MainPage.Navigation.PushModalAsync(page);
                SearchText = "";
                var search = await Nominatim.GetAddress(address as string);
                model.Update(search);
            },
                canExecute: (object address) => true);

            CurrentLocationCommand = new Command(
                execute: async() =>
            {
                try
                {
                    DateText = DateTime.Now.ToString("d");
                    RefreshFavoritePlaces();
                    var location = await Geolocation.GetLocationAsync();

                    if (location != null)
                    {
                        var placeName = "";
                        var address   = await Nominatim.GetAddress(location.Latitude, location.Longitude);
                        if (!string.IsNullOrEmpty(address.Address.Administrative))
                        {
                            placeName = address.Address.Administrative;
                        }
                        else if (!string.IsNullOrEmpty(address.Address.City))
                        {
                            placeName = address.Address.City;
                        }
                        else if (!string.IsNullOrEmpty(address.Address.Village))
                        {
                            placeName = address.Address.Village;
                        }

                        SetLocation(placeName, location.Latitude, location.Longitude);
                    }
                    else
                    {
                        if (Settings.Settings.Instance.Places.Count == 0)
                        {
                            await Application.Current.MainPage.DisplayAlert(Resources.AppTranslations.MissingLocalizationTitle,
                                                                            Resources.AppTranslations.MissingLocalizationText,
                                                                            Resources.AppTranslations.MissingLocalizationClose);
                        }
                        else
                        {
                            SetLocation(Settings.Settings.Instance.Places.ElementAt(0).Add.PlaceName,
                                        Settings.Settings.Instance.Places.ElementAt(0).Add.Latitude,
                                        Settings.Settings.Instance.Places.ElementAt(0).Add.Longitude);
                        }
                    }
                }
                catch (FeatureNotSupportedException fnsEx)
                {
                    await Application.Current.MainPage.DisplayAlert(Resources.AppTranslations.MissingLocalizationTitle,
                                                                    Resources.AppTranslations.MissingLocalizationText,
                                                                    Resources.AppTranslations.MissingLocalizationClose);
                }
                catch (FeatureNotEnabledException fneEx)
                {
                    await Application.Current.MainPage.DisplayAlert(Resources.AppTranslations.MissingLocalizationTitle,
                                                                    Resources.AppTranslations.MissingLocalizationText,
                                                                    Resources.AppTranslations.MissingLocalizationClose);
                }
                catch (PermissionException pEx)
                {
                    await Application.Current.MainPage.DisplayAlert(Resources.AppTranslations.MissingLocalizationTitle,
                                                                    Resources.AppTranslations.MissingLocalizationText,
                                                                    Resources.AppTranslations.MissingLocalizationClose);
                }
                catch (Exception ex)
                {
                    if (Settings.Settings.Instance.Places.Count == 0)
                    {
                        await Application.Current.MainPage.DisplayAlert(Resources.AppTranslations.NoInternetTitle,
                                                                        Resources.AppTranslations.NoInternetText,
                                                                        Resources.AppTranslations.NoInternetClose);
                    }
                    else
                    {
                        SetLocation(Settings.Settings.Instance.Places.ElementAt(0).Add.PlaceName,
                                    Settings.Settings.Instance.Places.ElementAt(0).Add.Latitude,
                                    Settings.Settings.Instance.Places.ElementAt(0).Add.Longitude);
                    }
                }
                IsLoading = false;
            },
                canExecute: () => true);

            Connectivity.ConnectivityChanged += (sender, args) =>
            {
                Refresh();
            };
        }
コード例 #20
0
ファイル: SearchPageTest.cs プロジェクト: spiffydudex/navbot
        public void EverythingOk()
        {
            page = new SearchPage(TestObjectFactory.CreateMockTradeFinderFactory());
            query["isk"] = "142000";
            query["cargo"] = "412";
            string html = page.Render(system, charName, charId, trustedHeaders, query);
            string lowerCaseText = WebUtils.PlainText(html).ToLower();

            Assert.IsTrue(lowerCaseText.Contains("here's the trades"), "Didn't say the trades are here");
            Assert.IsTrue(html.Contains(ConfigurationSettings.AppSettings["URLPrefix"] + "Reports"), "No reports link");
        }
コード例 #21
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                bool consume = false;

                if (targeted is ScrollClue)
                {
                    ScrollClue scroll = (ScrollClue)targeted;
                    consume = true;
                    from.PlaySound(0xF9);

                    if (scroll.ScrollIntelligence > 0)
                    {
                        from.SendMessage("That parchment hasn't been deciphered yet.");
                    }
                    else
                    {
                        string WillSay = "";

                        switch (Utility.RandomMinMax(0, 3))
                        {
                        case 0: WillSay = "The spirits tell you that this parchment is"; break;

                        case 1: WillSay = "Your mind is showing you that this parchment is"; break;

                        case 2: WillSay = "The voices all speak that this parchment is"; break;

                        case 3: WillSay = "You can see beyond that this parchment is"; break;
                        }

                        if (scroll.ScrollTrue == 1)
                        {
                            from.SendMessage(WillSay + " truthfully written.");
                        }
                        else
                        {
                            from.SendMessage(WillSay + " falsely written.");
                        }
                    }
                }
                ///////////////////////////////////////////////////////////////////////////////////
                else if (targeted is SearchPage)
                {
                    SearchPage scroll = (SearchPage)targeted;
                    consume = true;
                    from.PlaySound(0xF9);

                    string WillSay = "";

                    switch (Utility.RandomMinMax(0, 3))
                    {
                    case 0: WillSay = "The spirits tell you that this legend "; break;

                    case 1: WillSay = "Your mind is showing you that this legend "; break;

                    case 2: WillSay = "The voices all speak that this legend "; break;

                    case 3: WillSay = "You can see beyond that this legend "; break;
                    }

                    if (scroll.LegendReal == 1)
                    {
                        from.SendMessage(WillSay + " really happened.");
                    }
                    else
                    {
                        from.SendMessage(WillSay + " never happened.");
                    }
                }
                ///////////////////////////////////////////////////////////////////////////////////
                else if (targeted is DynamicBook)
                {
                    DynamicBook scroll = (DynamicBook)targeted;
                    consume = true;
                    from.PlaySound(0xF9);

                    string WillSay = "";

                    switch (Utility.RandomMinMax(0, 3))
                    {
                    case 0: WillSay = "The spirits tell you that this book "; break;

                    case 1: WillSay = "Your mind is showing you that this book "; break;

                    case 2: WillSay = "The voices all speak that this book "; break;

                    case 3: WillSay = "You can see beyond that this book "; break;
                    }

                    if (scroll.BookTrue > 0)
                    {
                        from.SendMessage(WillSay + " contains the truth.");
                    }
                    else
                    {
                        from.SendMessage(WillSay + " contains falsehoods.");
                    }
                }
                ///////////////////////////////////////////////////////////////////////////////////
                else if (targeted is SomeRandomNote)
                {
                    SomeRandomNote scroll = (SomeRandomNote)targeted;
                    consume = true;
                    from.PlaySound(0xF9);

                    string WillSay = "";

                    switch (Utility.RandomMinMax(0, 3))
                    {
                    case 0: WillSay = "The spirits tell you that this parchment is"; break;

                    case 1: WillSay = "Your mind is showing you that this parchment is"; break;

                    case 2: WillSay = "The voices all speak that this parchment is"; break;

                    case 3: WillSay = "You can see beyond that this parchment is"; break;
                    }

                    if (scroll.ScrollTrue == 1)
                    {
                        from.SendMessage(WillSay + " truthfully written.");
                    }
                    else
                    {
                        from.SendMessage(WillSay + " falsely written.");
                    }
                }
                ///////////////////////////////////////////////////////////////////////////////////
                else if (targeted is DataPad)
                {
                    consume = true;
                    from.PlaySound(0xF9);
                    string WillSay = "";

                    switch (Utility.RandomMinMax(0, 3))
                    {
                    case 0: WillSay = "The spirits tell you that this glowing book is"; break;

                    case 1: WillSay = "Your mind is showing you that this glowing book is"; break;

                    case 2: WillSay = "The voices all speak that this glowing book is"; break;

                    case 3: WillSay = "You can see beyond that this glowing book is"; break;
                    }

                    from.SendMessage(WillSay + " truthfully written.");
                }
                ///////////////////////////////////////////////////////////////////////////////////
                else
                {
                    from.SendMessage("That is not a book or parchment.");
                }

                if (consume)
                {
                    Server.Misc.Research.ConsumeScroll(from, true, m_SpellIndex, false);
                }
                m_Owner.FinishSequence();
            }
コード例 #22
0
            public void ValidateSigninErrormessage()
            {
                var search = new SearchPage();

                search.ValidateErrorMsg();
            }
コード例 #23
0
        /// <summary>
        /// Get main label for searching after search
        /// </summary>
        /// <param name="search">string for searching</param>
        /// <returns>String content header</returns>
        public string GetSearchHeader(string search)
        {
            SearchPage content = Search(search);

            return(content.GetTextFromSearchLabel());
        }
コード例 #24
0
        public void GivenIClickOnSearchButtonFromSearchResultPage()
        {
            SearchPage mypage = new SearchPage();

            mypage.ClickSearch();
        }
コード例 #25
0
 public SearchSteps(IWebDriver driver)
 {
     this.driver = driver;
     this.page   = new SearchPage(this.driver);
 }
コード例 #26
0
 public SearchResults(SearchResultPage searchResultPage, SearchPage searchPage)
 {
     _searchResultPage = searchResultPage;
     _searchPage       = searchPage;
 }
コード例 #27
0
 private async void ViewSearchPage()
 {
     SearchPage page = new SearchPage();
     await Application.Current.MainPage.Navigation.PushAsync(page);
 }
コード例 #28
0
 protected bool isHaveParsed(SearchPage page)
 {
     return(SearchPage.PASSED_PAGE_LIST.Contains(page.CURRENT_PAGE));
 }
コード例 #29
0
ファイル: GoogleSearchPOM.cs プロジェクト: tedo1111/POM
 public void Init()
 {
     _searchPage = new SearchPage(Driver);
     _resultPage = new ResultPage(Driver);
 }
コード例 #30
0
 public SearchUI(IWebDriver driver)
 {
     SearchPage = new SearchPage(driver);
 }
コード例 #31
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     MainWindowFrame = MainFrame;
     searchPage      = new SearchPage();
 }
コード例 #32
0
        public void OpenSearchPage()
        {
            SearchPage searchPage = new SearchPage(driver);

            searchPage.OpenPage();
        }
コード例 #33
0
        /// <summary>
        /// 搜索进入商品列表
        /// </summary>
        /// <param name="_index"></param>
        public ProductListVM(string _index)
        {
            ProductList     = new ObservableCollection <ProductListItem>();
            ProductNum      = 0;
            TotalProductNum = 0;
            Page            = 1;
            _Size           = 20;
            Sort            = "0";
            Sequence        = 1;
            PriceGt         = "";
            PriceLte        = "";

            SearchString = _index;
            Search(SearchString);

            SearchCommand = new Command(() =>
            {
                SearchPage searchPage = new SearchPage();
                Application.Current.MainPage.Navigation.PushAsync(searchPage);

                /*
                 * if (string.IsNullOrEmpty(SearchString))
                 * {
                 *  CrossToastPopUp.Current.ShowToastWarning("请输入关键词", ToastLength.Short);
                 * }
                 * else
                 * {
                 *  ProductList.Clear();
                 *  ProductNum = 0;
                 *  Search(SearchString);
                 * }*/
            }, () => { return(true); });

            //TappedCommand = new Command<ProductListItem>((productListItem) =>
            //{
            //    //ProductListItem productListItem = ProductList[id];
            //    ProductDetailPage productDetailPage = new ProductDetailPage(productListItem.productId.ToString());
            //    Application.Current.MainPage.Navigation.PushAsync(productDetailPage);
            //}, (productListItem) => { return true; });

            LoadMoreCommand = new Command(() =>
            {
                //CrossToastPopUp.Current.ShowToastWarning(str + "/" + ProductNum, ToastLength.Short);
                Search(_index);
            }, () => { return(true); });

            SortCommand = new Command <string>((str) =>
            {
                switch (str)
                {
                //综合排序,不排序
                case "0": Sort = "0"; break;

                //价格升序
                case "1": Sort = GlobalVariables.IsLogged ? "2" : "1"; break;

                //价格降序
                case "2": Sort = GlobalVariables.IsLogged ? "-2" : "-1"; break;

                //销量
                case "3": Sort = "3"; break;

                //不排序
                default: Sort = "0"; break;
                }

                ProductList.Clear();
                ProductNum = 0;
                Search(SearchString);
            }, (str) => { return(true); });

            PriceRangeCommand = new Command <string>((str) =>
            {
                switch (str)
                {
                //重置
                case "0":
                    {
                        ProductList.Clear();
                        ProductNum      = 0;
                        TotalProductNum = 0;
                        Page            = 1;
                        _Size           = 20;
                        Sort            = "1";
                        Sequence        = 1;
                        PriceGt         = "";
                        PriceLte        = "";

                        Search(_index);
                    }
                    break;

                //按价格区间查询
                case "1":
                    {
                        if (string.IsNullOrWhiteSpace(PriceGt) || string.IsNullOrWhiteSpace(PriceLte))
                        {
                            CrossToastPopUp.Current.ShowToastWarning("最低价或最高价不可为空", ToastLength.Long);
                        }
                        else if (int.Parse(PriceGt) > int.Parse(PriceLte))
                        {
                            CrossToastPopUp.Current.ShowToastWarning("最低价>最高价", ToastLength.Long);
                        }
                        else
                        {
                            ProductList.Clear();
                            ProductNum = 0;
                            Search(_index);
                        }
                    }
                    break;

                default:
                    break;
                }
            }, (str) => { return(true); });
        }
コード例 #34
0
        public string GetBackDepartureDate()
        {
            SearchPage searchPage = new SearchPage(driver);

            return(searchPage.GetBackDepartureDate());
        }
コード例 #35
0
 public void BeforeScenario()
 {
     _searchPage = PageFactory.InitElements <SearchPage>(_driver);
 }
コード例 #36
0
        public void VerifySearchResults_SemanticUITemplate()
        {
            BAT.Macros().NavigateTo().Pages(this.Culture);
            BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(SearchPage);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(SearchBoxWidget);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(SearchResultsWidget);

            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(SearchBoxWidget);
            BATFeather.Wrappers().Backend().Search().SearchBoxWrapper().SelectSearchIndex(SearchIndexName);
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ClickSelectButton();
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().WaitForItemsToAppear(2);
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInFlatSelector(SearchPage);
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().DoneSelecting();
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifySelectedItemsFromFlatSelector(new string[] { SearchPage });
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage();

            BAT.Macros().NavigateTo().CustomPage("~/" + SearchPage.ToLower(), true, this.Culture, new HtmlFindExpression("class=~ui-autocomplete-input"));
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchText(NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchLink(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(0, NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchText(SearchText1);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchLink(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(1, SearchText1);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsList(NewsTitle1);

            BAT.Macros().User().LogOut();
            BAT.Macros().NavigateTo().CustomPage("~/" + SearchPage.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchText(NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchLink(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(0, NoResultsSearchText);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().EnterSearchText(SearchText2);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().ClickSearchLink(SearchPage.ToLower());
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsLabel(1, SearchText2);
            BATFeather.Wrappers().Frontend().Search().SearchWrapper().VerifySearchResultsList(NewsTitle2);
        }
コード例 #37
0
 public SearchViewModel(SearchPage currentPage)
     : base(currentPage)
 {
 }
コード例 #38
0
 public SearchSteps(SearchPage searchPage, ResultsPage resultsPage)
 {
     _searchPage  = searchPage;
     _resultsPage = resultsPage;
 }
コード例 #39
0
        public ActionResult Search(string pKey, int pVendor = 2, int pPage = 1)
        {
            V308CMSEntities   mEntities         = new V308CMSEntities();
            ProductRepository productRepository = new ProductRepository(mEntities);
            MarketRepository  marketRepository  = new MarketRepository(mEntities);
            SearchPage        mSearchPage       = new SearchPage();
            List <Product>    mProductList      = null;
            List <Market>     mMarketList       = null;

            try
            {
                //mList = newsRepository.LayDanhSachTinTheoKey(15, pKey, pPage);
                if (pVendor == 1)/*Tìm theo cửa hàng*/
                {
                    mMarketList = marketRepository.SearchMarketTheoTrangAndType(pPage, 30, pKey);

                    mSearchPage.Code = 1;
                    if (mMarketList.Count > 0)
                    {
                        mSearchPage.MarketList = mMarketList;
                        if (mMarketList.Count < 30)
                        {
                            mSearchPage.IsEnd = true;
                        }
                        mSearchPage.Page = pPage;
                        mSearchPage.Name = pKey;
                    }
                    else
                    {
                        mSearchPage.MarketList = new List <Data.Market>();
                        mSearchPage.Name       = pKey;
                        mSearchPage.Html       = "Không tìm thấy kết quả nào.";
                    }
                }
                else /*Tìm theo sản phẩm*/
                {
                    mProductList     = productRepository.TimSanPhamTheoTen(pPage, 30, pKey.ToLower());
                    mSearchPage.Code = 2;
                    if (mProductList.Count > 0)
                    {
                        mSearchPage.ProductList = mProductList;
                        if (mProductList.Count < 30)
                        {
                            mSearchPage.IsEnd = true;
                        }
                        mSearchPage.Page = pPage;
                        mSearchPage.Name = pKey;
                    }
                    else
                    {
                        mSearchPage.ProductList = new List <Product>();
                        mSearchPage.Name        = pKey;
                        mSearchPage.Html        = "Không tìm thấy kết quả nào.";
                    }
                }

                return(View(mSearchPage));
            }
            catch (Exception ex)
            {
                return(Content("<dx></dx>"));
            }
            finally
            {
                mEntities.Dispose();
                productRepository.Dispose();
            }
        }
コード例 #40
0
        public void TestCase2101()
        {
            int stepNo = 1;

            // Gets scriptname through reflection
            string testScriptName = GetTestScriptName();

            // Loads config data and creates a Singleton object of Configuration and loads data into generic test case variables
            this.GetConfigData();

            // Get process exe file path
            string[] processPath = PrepareProcessFilePath();

            // Get debug viewer exe file path
            string configFilesLocation = PrepareConfigureDataFilePath();

            // Get log directory details from xml file
            PrepareLogDirectoryPath(configFilesLocation);

            // Start debug viewer
            ApplicationLog applicationLog = new ApplicationLog();
            applicationLog.StartDebugViewer(configFilesLocation, reportFileDirectory, testScriptName);

            // Prepare test data file path
            string testDataFilePath = PrepareTestDataFilePath(testScriptName);

            // Loads test case specific data
            TestData testData = new TestData(testDataFilePath);
            string applicationName = (string)testData.TestDataTable["ApplicationName"];
            string[] applicationsName = applicationName.Split(',');
            string pageNumber = (string)testData.TestDataTable["PageNumber"];
            string fileName = (string)testData.TestDataTable["FileName"];

            //file path to upload
            fileName = PrepareDocumentPath(testScriptName, fileName);

            CleanUpTestScripts.CleanUp_2100 cleanUp_2100 = new CleanUpTestScripts.CleanUp_2100();

            SessionHandler sessionHandler = new SessionHandler();
            Browser browser = sessionHandler.GetBrowserInstance();
            try
            {
                // Execute all clean up scripts if marked as true in xml file
                try
                {
                    // store session in session handler
                    sessionHandler.StoreBrowserInstance(browser);
                    // Execute all clean up scripts if marked as true in xml file
                    CleanUpExecution cleanUpExecution = new CleanUpExecution();
                    cleanUpExecution.ExecuteCleanUp(configFilesLocation, this.projectDirectory);
                    // get browser session from session handler
                    browser = sessionHandler.GetBrowserInstance();
                }
                catch (Exception) { }
                //// call clean up script for test script
                //try
                //{
                //    sessionHandler.StoreBrowserInstance(browser);
                //    cleanUp_2100.CleanUp2100();
                //    browser = sessionHandler.GetBrowserInstance();
                //}
                //catch (Exception) { }
                try
                {
                    SearchPage searchPageNew = new SearchPage(browser);
                    bool isMenuSelectedFlag = searchPageNew.SelectMenuItem("Search", null, null);
                    Assert.IsTrue(isMenuSelectedFlag, "Navigation to search page failed.");
                    WriteLogs(testScriptName, stepNo, "Navigation to search page passed.", "PASS", browser);
                }
                catch (Exception)
                {
                    browser = null;
                }
                if (null == browser)
                {

                    browser = BrowserFactory.Instance.GetBrowser(browserId, testScriptName, configFilesLocation);
                    LoginPage loginPage = new LoginPage(browser);
                    SearchPage searchPageNew = loginPage.Login(this.userName, this.password, this.applicationURL, this.timeout, processPath);
                    searchPageNew.LocateControls();
                    Assert.IsNotNull(searchPageNew, "Failed to login in application");
                }

                WriteLogs(testScriptName, stepNo, "Verify ILS has been enabled for the application - in prerequisite", "PASS", browser);

                stepNo++;
                SearchPage searchPage = new SearchPage(browser);
                bool isSelected = searchPage.SelectMenuItem("Admin", "User Configurations", null);
                Assert.IsTrue(isSelected, "Failed to navigate to Search page");
                WriteLogs(testScriptName, stepNo, "Go to admin tab. Select user configuration. all iSynergy users are listed", "PASS", browser);

                stepNo++;
                UserConfigurationPage userConfigurationPage = new UserConfigurationPage(browser);
                UserPermissionPage userPermissionPage = new UserPermissionPage(browser);
                userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(this.userName);
                Assert.IsNotNull(userPermissionPage, "Failed to select the key next to sysadmin user");
                WriteLogs(testScriptName, stepNo, "select the key next to sysadmin user. User permissions screen appears. ", "PASS", browser);

                stepNo++;
                IndexLevelPermissionPage indexLevelPermissionPage = new IndexLevelPermissionPage(browser);
                indexLevelPermissionPage = userPermissionPage.NavigateToIndexLevelPermissionsPage(applicationName);
                Assert.IsNotNull(indexLevelPermissionPage,"Failed to select the Configuration gear icon under ILS configuration for the application "+applicationName);
                WriteLogs(testScriptName,stepNo,"Under application Permissions, select the Configuration gear icon under ILS configuration for the application in which ILS was enabled on An index field. Index Level Permissions configuration screen appears. Each ILS enabled index field for the application should be listed. A view column with check boxes and an edit column with check boxes Should be displayed. ","PASS",browser);

                stepNo++;
                indexLevelPermissionPage = indexLevelPermissionPage.SelectViewOrEditIndexLevelPermissions("View","ST1");
                Assert.IsNotNull(indexLevelPermissionPage, "View ILS options selected");

                userPermissionPage = indexLevelPermissionPage.ClickUpdateButtonAppConfILS();
                Assert.IsNotNull(userPermissionPage, "ILS Permission Update button clicked");

                userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                Assert.IsNotNull(userConfigurationPage, "User Permission Update button clicked");
                WriteLogs(testScriptName,stepNo,"Select the index field. Check the view check box To enable. Leave edit disabled. Click update button. ","PASS",browser);

            }
            catch (Exception exception)
            {
                ExceptionCleanUp(testScriptName, stepNo, exception.Message, browser);
            }
            finally
            {
                sessionHandler.StoreBrowserInstance(browser);
                //cleanUp_2100.CleanUp2100();
                stepNo++;
                // to stop debeg viewer
                applicationLog.StopDebugViewer();
                bool isExceptionFound = applicationLog.VerifyDebugLogFiles(reportFileDirectory, testScriptName);
                if (!isExceptionFound)
                {
                    WriteLogs(testScriptName, stepNo, "Exception/error found in log file", "INFO", browser);
                }
            }
        }
コード例 #41
0
ファイル: SearchPageTest.cs プロジェクト: spiffydudex/navbot
        public void NoLogFiles()
        {
            page = new SearchPage(new MockTradeFinderFactory());
            string html = page.Render(system, charName, charId, trustedHeaders, query);
            string lowerCaseText = WebUtils.PlainText(html).ToLower();

            Assert.IsTrue(lowerCaseText.Contains("export to file"), "No mention of using the export to file button");
            Assert.IsTrue(lowerCaseText.Contains("market data"), "No mention of needing market data");
        }