예제 #1
0
        public string SelectContentMenu(string valIdLanguage)
        {
            string        vResult       = string.Empty;
            ICityData     vCityData     = new CityData();
            ICategoryData vCategoryData = new CategoryData();
            ILanguageData vLanguageData = new LanguageData();
            ICurrencyData vCurrencyData = new CurrencyData();
            ContentMenu   vContenMenu   = new ContentMenu();

            try {
                string          vLanguage            = vLanguageData.SelectAll();
                List <Language> vDeserializeLaguages = JsonConvert.DeserializeObject <List <Language> >(vLanguage);
                string          vCities              = vCityData.SelectByLanguage(valIdLanguage);
                List <City>     vDeserializeCities   = JsonConvert.DeserializeObject <List <City> >(vCities);
                string          vTours               = vCategoryData.SelectAllByLanguage(valIdLanguage);
                List <Category> vDeserializeCategory = JsonConvert.DeserializeObject <List <Category> >(vTours);
                string          vCurrency            = vCurrencyData.SelectAll();
                List <Currency> vDeserializeCurrency = JsonConvert.DeserializeObject <List <Currency> >(vCurrency);
                vContenMenu.Cities     = vDeserializeCities;
                vContenMenu.Categories = vDeserializeCategory;
                vContenMenu.Languages  = vDeserializeLaguages;
                vContenMenu.Currencies = vDeserializeCurrency;
                if (vContenMenu != null)
                {
                    vResult = JsonConvert.SerializeObject(vContenMenu, Formatting.Indented);
                }
            } catch (Exception vEx) {
                string vMessage = vEx.Message;
                vResult = string.Empty;
            }
            //var vDes = JsonConvert.DeserializeObject<List<City>>(vResult);
            return(vResult);
        }
        void ReleaseDesignerOutlets()
        {
            if (ContentMenu != null)
            {
                ContentMenu.Dispose();
                ContentMenu = null;
            }

            if (ContentWebView != null)
            {
                ContentWebView.Dispose();
                ContentWebView = null;
            }

            if (CustomView != null)
            {
                CustomView.Dispose();
                CustomView = null;
            }

            if (InfoLabel != null)
            {
                InfoLabel.Dispose();
                InfoLabel = null;
            }
        }
예제 #3
0
    private bool IsTopContentMenuDisplay()
    {
        string id = DataAccessContext.Configurations.GetValue("TopContentMenu");

        ContentMenu contentMenu = DataAccessContext.ContentMenuRepository.GetOne(id);

        return(contentMenu.IsEnabled);
    }
예제 #4
0
    protected void uxTopContentMenuGrid_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            GridViewRow rowGrid = uxTopContentMenuGrid.Rows[e.RowIndex];

            string contentmenuID = ((Label)rowGrid.FindControl("uxContentMenuIDLabel")).Text;

            ContentMenu contentMenu = DataAccessContext.ContentMenuRepository.GetOne(contentmenuID);
            contentMenu.IsEnabled = ((CheckBox)rowGrid.FindControl("uxContentEnabledCheck")).Checked;

            ContentMenuItem contentMenuItem = GetReferringContentMenuItem(DataAccessContext.CultureRepository.GetOne(
                                                                              DataAccessContext.CultureRepository.GetIDByName(SystemConst.USCultureName)), contentmenuID);
            contentMenuItem.IsEnabled = contentMenu.IsEnabled;

            DataAccessContext.ContentMenuItemRepository.Save(contentMenuItem);

            string menuType = ((DropDownList)rowGrid.FindControl("uxContentMenuTypeDrop")).SelectedValue;

            DataAccessContext.ContentMenuRepository.Save(contentMenu);

            Store store = DataAccessContext.StoreRepository.GetOne(uxStoreFilterDrop.SelectedValue);

            if (contentmenuID == DataAccessContext.Configurations.GetValue("TopContentMenu", CurrentStore))
            {
                DataAccessContext.ConfigurationRepository.UpdateValue(
                    DataAccessContext.Configurations["TopContentMenuType"], menuType, CurrentStore);
            }
            else if (contentmenuID == DataAccessContext.Configurations.GetValue("LeftContentMenu", CurrentStore))
            {
                DataAccessContext.ConfigurationRepository.UpdateValue(
                    DataAccessContext.Configurations["LeftContentMenuType"], menuType, CurrentStore);
            }
            else if (contentmenuID == DataAccessContext.Configurations.GetValue("RightContentMenu", CurrentStore))
            {
                DataAccessContext.ConfigurationRepository.UpdateValue(
                    DataAccessContext.Configurations["RightContentMenuType"], menuType, CurrentStore);
            }


            AdminUtilities.LoadSystemConfig();

            uxTopContentMenuGrid.EditIndex = -1;
            RefreshGrid();

            uxMessage.DisplayMessage(Resources.ContentMenuItemMessages.ItemUpdateSuccess);
        }
        finally
        {
            // Avoid calling Update() automatically by GridView
            e.Cancel = true;
        }
    }
예제 #5
0
    private void PopulateControls()
    {
        switch (Position)
        {
        case "top":
            _rootID   = DataAccessContext.Configurations.GetValue("TopContentMenu");
            _menuType = DataAccessContext.Configurations.GetValue("TopContentMenuType");

            break;

        case "left":
            uxContentMenuNavTitle.Visible = true;
            _rootID   = DataAccessContext.Configurations.GetValue("LeftContentMenu");
            _menuType = DataAccessContext.Configurations.GetValue("LeftContentMenuType");
            break;

        case "right":
            uxContentMenuNavTitle.Visible = true;
            _rootID   = DataAccessContext.Configurations.GetValue("RightContentMenu");
            _menuType = DataAccessContext.Configurations.GetValue("RightContentMenuType");
            break;
        }


        ContentMenu contentMenu = DataAccessContext.ContentMenuRepository.GetOne(_rootID);

        if (!contentMenu.IsEnabled)
        {
            this.Visible = false;
        }
        else
        {
            switch (_menuType)
            {
            case "cascade":
                uxMenuList.MaxNode      = DataAccessContext.Configurations.GetIntValue("CategoryMenuLevel");
                uxMenuList.RootID       = _rootID;
                uxMenuList.RootMenuName = _rootMenuName;
                uxMenuList.Visible      = true;
                uxNormalList.Visible    = false;
                break;

            default:
                uxNormalList.RootID       = _rootID;
                uxNormalList.RootMenuName = _rootMenuName;
                uxNormalList.Visible      = true;
                uxMenuList.Visible        = false;
                break;
            }
        }
    }
예제 #6
0
 private void SetUpNewReferring(ContentMenuItem item)
 {
     if (uxContentMenuItemTypeDrop.SelectedValue == "0")
     {
         ContentMenu newContentMenu = new ContentMenu();
         newContentMenu.IsEnabled = item.IsEnabled;
         newContentMenu           = DataAccessContext.ContentMenuRepository.Save(newContentMenu);
         item.ReferringMenuID     = newContentMenu.ContentMenuID;
     }
     else
     {
         item.ReferringMenuID = "0";
     }
 }
 public Guid AddContentMenu(AddContentMenuCommand command)
 {
   var contentMenu = new ContentMenu()
   {
     ContentMenuId = Guid.NewGuid(),
     Description = command.Description,
     Image = command.Image,
     Title = command.Title,
     MetaDescription = command.MetaDescription,
     MetaKeywork = command.MetaKeywork
   };
   _contentMenuService.Insert(contentMenu);
   _unitOfWork.SaveChanges();
   return contentMenu.ContentMenuId;
 }
예제 #8
0
        public static void RoadNetworkToWayPointPath()
        {
            var roadNetworkDescription = ContentMenu.GetSelectedRoadNetwork();

            if (roadNetworkDescription == null)
            {
                Debug.LogError("Select an OpenDrive road network description asset in the project window " +
                               "before selecting this menu item to generate a way point path.");
                return;
            }

            var root = new GameObject($"{roadNetworkDescription.name}");

            ContentMenu.AddRoadNetworkReference(root, roadNetworkDescription);
            root.AddComponent(typeof(RoadNetworkWayPointGenerator));
        }
        public Guid AddContentMenu(AddContentMenuCommand command)
        {
            var contentMenu = new ContentMenu()
            {
                ContentMenuId   = Guid.NewGuid(),
                Description     = command.Description,
                Image           = command.Image,
                Title           = command.Title,
                MetaDescription = command.MetaDescription,
                MetaKeywork     = command.MetaKeywork
            };

            _contentMenuService.Insert(contentMenu);
            _unitOfWork.SaveChanges();
            return(contentMenu.ContentMenuId);
        }
예제 #10
0
    private IList <ContentMenuItem> CreateLeafContentMenu(IList <ContentMenuItem> list)
    {
        IList <ContentMenuItem> _leafContentMenuList = new List <ContentMenuItem>();

        foreach (ContentMenuItem item in list)
        {
            if (!item.LinksToContent())
            {
                IList <ContentMenuItem> item_list = DataAccessContext.ContentMenuItemRepository.GetByContentMenuID(
                    StoreContext.Culture, item.ReferringMenuID, "SortOrder", BoolFilter.ShowTrue, BoolFilter.ShowTrue);

                if (ContainContent(item_list))
                {
                    _leafContentMenuList.Add(item);
                }
            }
            else if (item.LinksToContent() && ContentMenu.IsRootMenuID(item.ContentMenuID))
            {
                ContentMenuItem parentItem = DataAccessContext.ContentMenuItemRepository.GetOne(
                    StoreContext.Culture, item.ContentMenuID);

                Vevo.Domain.Contents.Content content = DataAccessContext.ContentRepository.GetOne(
                    StoreContext.Culture, item.ContentID);
                if (content.IsShowInSiteMap)
                {
                    if (content.IsEnabled)
                    {
                        _leafContentMenuList.Add(item);
                        shownContentList.Add(item.ContentID);
                    }
                }
            }
        }

        return(_leafContentMenuList);
    }
예제 #11
0
        public void CreateOfficeFund()
        {
            var browserWindow = AuthHelper.KMTLogin();

            ContentMenu.AccessMenu(browserWindow);

            //select offices section
            HtmlHyperlink offices = new HtmlHyperlink(browserWindow);

            offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2");
            offices.WaitForControlReady();
            Mouse.Click(offices);

            //Verify office directory
            HtmlDiv officeDirect = new HtmlDiv(browserWindow);

            officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV");
            officeDirect.WaitForControlReady();
            Assert.AreEqual(true, officeDirect.Exists);

            //search field
            HtmlEdit offSearch = new HtmlEdit(browserWindow);

            offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1");
            offSearch.WaitForControlReady();
            Assert.AreEqual(true, offSearch.Exists);

            //execute search
            Mouse.Click(offSearch);
            offSearch.Text = "Cultural Heritage Center";

            //verify office in results "Cultural Heritage Center"
            HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow);

            chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17");
            chcOffice.WaitForControlReady();
            Assert.AreEqual(true, chcOffice.Exists);

            //select chcOffice
            Mouse.Click(chcOffice);

            //select Funding Tab
            HtmlHyperlink offFund = new HtmlHyperlink(browserWindow);

            offFund.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Funding", HtmlHyperlink.PropertyNames.TagName, "A", HtmlHyperlink.PropertyNames.TagInstance, "22");
            offFund.WaitForControlReady();
            Assert.AreEqual(true, offFund.Exists);
            Mouse.Click(offFund);

            //Add Outgoing Funding Item***
            //
            //TestPropertyAttribute?
            var config = new AddFundConfig();

            config.FiscalYear = DateTime.Now.Year;
            config.SourceRecipientTypeName = MoneyFlowSourceRecipientType.Project.Value;
            config.SearchRecipient         = "Cultural Heritage Center";
            OutgoingFund.AddFundOut(browserWindow, config);


            IncomingFund.AddFundIn(browserWindow);
        }
        public void CustomMouseUp(string message)
        {
            //Console.WriteLine ("message:{0}", message);
            var domRange = ContentWebView.SelectedDomRange;

            if (domRange == null)
            {
                return;
            }

            string selectText = domRange.Text;

            if (selectText == null || selectText.Length <= 0)
            {
                return;
            }

            var    aobject = JsonConvert.DeserializeObject <Dictionary <string, object> > (message);
            var    values  = aobject.Values;
            nfloat x       = Int32.Parse(values.ElementAt(0).ToString());
            nfloat y       = View.Frame.Height + 50 - Int32.Parse(values.ElementAt(1).ToString());


            CGPoint location = new CGPoint(x, y);

            menuLocation = new CGPoint(x, y);

            location = View.ConvertPointToView(location, null);

            bool islegal = Utility.IsValidDictionary();

            //islegal = false;
            ContentMenu.ItemAt(2).Hidden = !islegal;

            bool isHighlight = false;

            ContentMenu.ItemAt(4).Hidden = isHighlight;
            ContentMenu.ItemAt(5).Hidden = !isHighlight;
            ContentMenu.ItemAt(6).Hidden = !isHighlight;

            bool isNote = false;

            ContentMenu.ItemAt(7).Hidden = isNote;
            ContentMenu.ItemAt(8).Hidden = !isNote;
            ContentMenu.ItemAt(9).Hidden = !isNote;

            NSWindow window = NSApplication.SharedApplication.KeyWindow;

            if (window == null)
            {
                window = NSApplication.SharedApplication.MainWindow;
            }
            nint windowNumber = 1;

            if (window != null)
            {
                windowNumber = window.WindowNumber;
            }
            else
            {
                return;
            }
            NSEvent fakeMouseEvent =
                NSEvent.MouseEvent(NSEventType.LeftMouseUp,
                                   location,
                                   (NSEventModifierMask)NSEventMask.LeftMouseUp,
                                   0,
                                   windowNumber,
                                   window.GraphicsContext, 0, 1, 1);

            NSMenu.PopUpContextMenu(ContentMenu, fakeMouseEvent, View);
        }
예제 #13
0
        public void ViewHomepage()
        {
            //KMT Login with ECATest1 user and pw

            var browserWindow = AuthHelper.KMTLogin();

            //check content menu
            ContentMenu.AccessMenu(browserWindow);

            //check hyperlinks for Your Shortcuts, Notifications and Timeline, and News

            //shortcuts
            HtmlHyperlink yourShortcuts = new HtmlHyperlink(browserWindow);

            yourShortcuts.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Your Shortcuts", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "13");
            yourShortcuts.WaitForControlReady();
            Assert.AreEqual(true, yourShortcuts.Exists);

            //notifications and timeline
            HtmlHyperlink notifications = new HtmlHyperlink(browserWindow);

            notifications.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Notifications & Timeline", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "14");
            notifications.WaitForControlReady();
            Assert.AreEqual(true, notifications.Exists);

            //news
            HtmlHyperlink news = new HtmlHyperlink(browserWindow);

            news.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "News (3)", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "15");
            news.WaitForControlReady();
            Assert.AreEqual(true, news.Exists);

            //Verify bookmarks section of Your Shortcuts tab
            HtmlDiv bookmarks = new HtmlDiv(browserWindow);

            bookmarks.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "star Bookmarks");
            bookmarks.WaitForControlReady();
            Assert.AreEqual(true, bookmarks.Exists);

            //Verify bookmark display - Taylor Test (Person)
            HtmlDiv bookDiv1 = new HtmlDiv(browserWindow);

            bookDiv1.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "delete Person Taylor Test Unknown 09 / 28 / 2015 Added: ", HtmlDiv.PropertyNames.TagInstance, "23");
            bookDiv1.WaitForControlReady();
            Assert.AreEqual(true, bookDiv1.Exists);

            HtmlHyperlink bookHyp = new HtmlHyperlink(browserWindow);

            bookHyp.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Taylor Test", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink");
            bookHyp.WaitForControlReady();
            Assert.AreEqual(true, bookHyp.Exists);

            //old code

            /*this.UIMap.LogintoQA_ExistingUser();
             * this.UIMap.OpenBrowserEnterCreds();
             * this.UIMap.SignInButton();
             * this.UIMap.SignIn();
             * this.UIMap.Notifications_ActivityLink();
             * this.UIMap.SelectNotifications_ActivityLink();
             * this.UIMap.NewsLink();
             * this.UIMap.SelectNewsLink();
             * this.UIMap.YourShortcutsLink();
             * this.UIMap.SelectYourShortcutsLink();
             * this.UIMap.CloseBrowserButton();
             * this.UIMap.CloseBrowser();*/
            //end old code
        }
        public void ViewOffices_ProgramsandBranches()
        {
            var browserWindow = AuthHelper.KMTLogin();

            ContentMenu.AccessMenu(browserWindow);

            //select offices section
            HtmlHyperlink offices = new HtmlHyperlink(browserWindow);

            offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2");
            offices.WaitForControlReady();
            Mouse.Click(offices);

            //Verify office directory
            HtmlDiv officeDirect = new HtmlDiv(browserWindow);

            officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV");
            officeDirect.WaitForControlReady();
            Assert.AreEqual(true, officeDirect.Exists);

            //search field
            HtmlEdit offSearch = new HtmlEdit(browserWindow);

            offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1");
            offSearch.WaitForControlReady();
            Assert.AreEqual(true, offSearch.Exists);

            //execute search
            Mouse.Click(offSearch);
            offSearch.Text = "Cultural Heritage Center";

            //verify office in results "Cultural Heritage Center"
            HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow);

            chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17");
            chcOffice.WaitForControlReady();
            Assert.AreEqual(true, chcOffice.Exists);

            //select chcOffice
            Mouse.Click(chcOffice);

            //verify chcOffice overview
            HtmlDiv chcOffHeader = new HtmlDiv(browserWindow);

            chcOffHeader.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "OFFICE Cultural Heritage Center ECA/P/C Permalink: http://localhost:5556/#/offices/1036/overview#top", HtmlDiv.PropertyNames.TagInstance, "15");
            chcOffHeader.WaitForControlReady();
            Assert.AreEqual(true, chcOffHeader.Exists);

            //verify description
            HtmlDiv chcOffDescription = new HtmlDiv(browserWindow);

            chcOffDescription.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "The Cultural Heritage Center supports the protection and preservation of cultural heritage and serves as a center of expertise on global cultural heritage protection issues. The Center administers U.S. responsibilities related to the 1970 UNESCO Convention on the Means of Prohibiting and Preventing the Illicit Import, Export, and Transfer of Ownership of Cultural Property, including the Cultural Property Advisory Committee and bilateral agreements; the U.S. Ambassadors Fund for Cultural Preservation (AFCP); the Cultural Antiquities Task Force; and efforts to coordinate protection and preservation of cultural heritage in disaster situations.", HtmlDiv.PropertyNames.TagInstance, "31");
            chcOffDescription.WaitForControlReady();
            Assert.AreEqual(true, chcOffDescription.Exists);

            //verify themes
            HtmlDiv chcOffThemes = new HtmlDiv(browserWindow);

            chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Civilian Security Conflict Prevention, Mitigation, and Response Democracy/Good Governance/Rule of Law Diversity Entrepreneurship/Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well-Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35", HtmlControl.PropertyNames.ControlType, "Pane");
            chcOffThemes.WaitForControlReady();
            Assert.AreEqual(true, chcOffThemes.Exists);

            //Html chcOffThemes = new HtmlPane(browserWindow);
            //chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Civilian Security Conflict Prevention, Mitigation, and Response Democracy/Good Governance/Rule of Law Diversity Entrepreneurship/Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well-Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35", HtmlControl.PropertyNames.ControlType, "Pane");
            //chcOffThemes.WaitForControlReady();
            //Assert.AreEqual(true, chcOffThemes.Exists);

            //verify goals
            HtmlDiv chcOffGoals = new HtmlDiv(browserWindow);

            chcOffGoals.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Goals Democracy and Human Rights", HtmlDiv.PropertyNames.TagInstance, "38", HtmlControl.PropertyNames.ControlType, "Pane");
            chcOffGoals.WaitForControlReady();
            Assert.AreEqual(true, chcOffGoals.Exists);

            //verify POC(s)
            HtmlDiv chcOffPoc = new HtmlDiv(browserWindow);

            chcOffPoc.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Points of Contact Cultural Heritage Center Main Line Maria Kouroupas", HtmlDiv.PropertyNames.TagInstance, "45", HtmlControl.PropertyNames.ControlType, "Pane");
            chcOffPoc.WaitForControlReady();
            Assert.AreEqual(true, chcOffPoc.Exists);

            //select branches and programs tab
            HtmlHyperlink chcBranchProgTab = new HtmlHyperlink(browserWindow);

            chcBranchProgTab.SearchProperties.Add(HtmlHyperlink.PropertyNames.TagName, "A", HtmlHyperlink.PropertyNames.InnerText, "Branches & Programs", HtmlHyperlink.PropertyNames.TagInstance, "19");
            chcBranchProgTab.WaitForControlReady();
            Assert.AreEqual(true, chcBranchProgTab.Exists);
            Mouse.Click(chcBranchProgTab);

            //Identify Showing # - # of ##
            //HtmlDiv showBPList = new HtmlDiv(browserWindow);
            //showBPList.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Showing 1 -", PropertyExpressionOperator.Contains, HtmlDiv.PropertyNames.TagInstance, "33");
            //showBPList.WaitForControlReady();
            //Assert.AreEqual(true, showBPList.Exists);

            //verify branches and programs tab section
            var connectionString = "Data Source=(local);User Id=ECA;Password=wisconsin-89;Database=ECA_Local;Pooling=False";

            using (var context = new EcaContext(connectionString))
                using (var service = new OfficeService(context))
                {
                    var start = 0;
                    var limit = 10;

                    //var officeId = 1036;

                    var defaultSorter  = new ExpressionSorter <OrganizationProgramDTO>(x => x.Name, SortDirection.Ascending);
                    var queryOperator  = new QueryableOperator <OrganizationProgramDTO>(start, limit, defaultSorter);
                    var results        = service.GetPrograms(1036, queryOperator);
                    var expectedString = String.Format("Showing {0} - {1} of {2} programs", start + 1, limit, results.Total);
                    //Identify Showing # - # of ##
                    HtmlDiv showBPList = new HtmlDiv(browserWindow);
                    showBPList.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, expectedString, HtmlDiv.PropertyNames.TagInstance, "33");
                    showBPList.WaitForControlReady();
                    Assert.AreEqual(true, showBPList.Exists);
                    Assert.AreEqual(expectedString, showBPList.InnerText);
                }
        }
예제 #15
0
        public void ViewOfficesPage()
        {
            /* var defaultSorter = new ExpressionSorter<SimpleOfficeDTO>(x => x.Name, SortDirection.Ascending);
             * var nameFilter = new ExpressionFilter<SimpleOfficeDTO>(x => x.Name, ComparisonType.Like, "Cultural Heritage");
             * var queryOperator = new QueryableOperator<SimpleOfficeDTO>(0, 100, defaultSorter, new List<IFilter> { nameFilter }, null);
             *
             * var dtos = officeService.GetOffices(queryOperator);
             * var testOffice = dtos.Results.First();
             * var searchText = testOffice.Name;
             * var linkText = testOffice.Name;
             * var total = dtos.Total; */

            var browserWindow = AuthHelper.KMTLogin();

            ContentMenu.AccessMenu(browserWindow);

            //select offices section
            HtmlHyperlink offices = new HtmlHyperlink(browserWindow);

            offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2");
            offices.WaitForControlReady();
            Mouse.Click(offices);

            //Verify office directory
            HtmlDiv officeDirect = new HtmlDiv(browserWindow);

            officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV");
            officeDirect.WaitForControlReady();
            Assert.AreEqual(true, officeDirect.Exists);

            //search field
            HtmlEdit offSearch = new HtmlEdit(browserWindow);

            offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1");
            offSearch.WaitForControlReady();
            Assert.AreEqual(true, offSearch.Exists);



            //showingOff DB Verify-- use sql connection for verifying the office count
            var connectionString = "Data Source=(local);User Id=ECA;Password=wisconsin-89;Database=ECA_Local;Pooling=False";

            using (var context = new EcaContext(connectionString))
                using (var service = new OfficeService(context))
                {
                    var start = 0;
                    var limit = 25;

                    var defaultSorter  = new ExpressionSorter <SimpleOfficeDTO>(x => x.OfficeSymbol, SortDirection.Ascending);
                    var queryOperator  = new QueryableOperator <SimpleOfficeDTO>(0, 25, defaultSorter);
                    var results        = service.GetOffices(queryOperator);
                    var expectedString = String.Format("Showing {0} - {1} of {2} offices", start + 1, limit, results.Total);
                    //showing count
                    HtmlDiv showingOff = new HtmlDiv(browserWindow);
                    showingOff.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Showing 1 - 25 of 56 offices");
                    showingOff.WaitForControlReady();
                    Assert.AreEqual(true, showingOff.Exists);
                    Assert.AreEqual(expectedString, showingOff.InnerText);
                }

            //verify the view count of Offices with Cultural in the name
            using (var context = new EcaContext(connectionString))
                using (var service = new OfficeService(context))
                {
                    var defaultSorter = new ExpressionSorter <SimpleOfficeDTO>(x => x.OfficeSymbol, SortDirection.Ascending);
                    var set           = new HashSet <string>();
                    set.Add("Cultural");
                    var keywordfilter = new SimpleKeywordFilter <SimpleOfficeDTO>(set, x => x.Name, x => x.Description, x => x.OfficeSymbol);
                    var queryOperator = new QueryableOperator <SimpleOfficeDTO>(0, 10, defaultSorter, new List <IFilter> {
                        keywordfilter
                    });
                    var results = service.GetOffices(queryOperator);
                    Assert.AreEqual(results.Total, 9);
                }



            //old code

            /* this.UIMap.LogintoQA_ExistingUser();
             * //this.UIMap.LogintoQA();
             * this.UIMap.AssertContentMenuButton();
             * this.UIMap.SelectContentMenuButton();
             * this.UIMap.AssertOfficesContentMenuLink();
             * this.UIMap.SelectOfficesContentMenuLink();
             * this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage();
             * this.UIMap.SelectContentMenuButton();
             * this.UIMap.SelectOfficesContentMenu_Link();
             * //this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage();
             * this.UIMap.AssertECAOfficeDirectoryPage();
             * this.UIMap.AssertSearchOffices();
             * this.UIMap.InputSearchOfficeText();
             * this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage();
             * this.UIMap.InputSearchOfficeText();
             * this.UIMap.AssertSearchOfficesTextResults();
             * this.UIMap.AssertAvailableOfficeinList();
             * //this.UIMap.AssertOfficeAvailableinList();
             * this.UIMap.CloseBrowserWindow(); */
            //end old code
        }
        public void ViewOfficesOverviewCodedUITestMethod1()
        {
            var browserWindow = AuthHelper.KMTLogin();

            ContentMenu.AccessMenu(browserWindow);

            //select offices section
            HtmlHyperlink offices = new HtmlHyperlink(browserWindow);

            offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2");
            offices.WaitForControlReady();
            Mouse.Click(offices);

            //Verify office directory
            HtmlDiv officeDirect = new HtmlDiv(browserWindow);

            officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV");
            officeDirect.WaitForControlReady();
            Assert.AreEqual(true, officeDirect.Exists);

            //search field
            HtmlEdit offSearch = new HtmlEdit(browserWindow);

            offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1");
            offSearch.WaitForControlReady();
            Assert.AreEqual(true, offSearch.Exists);

            //execute search
            Mouse.Click(offSearch);
            offSearch.Text = "Cultural Heritage Center";

            //verify office in results "Cultural Heritage Center"
            HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow);

            chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17");
            chcOffice.WaitForControlReady();
            Assert.AreEqual(true, chcOffice.Exists);

            //select chcOffice
            Mouse.Click(chcOffice);

            //verify chcOffice overview
            HtmlDiv chcOffHeader = new HtmlDiv(browserWindow);

            chcOffHeader.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "OFFICE Cultural Heritage Center ECA/P/C Permalink: http://localhost:5556/#/offices/1036/overview#top", HtmlDiv.PropertyNames.TagInstance, "15");
            chcOffHeader.WaitForControlReady();
            Assert.AreEqual(true, chcOffHeader.Exists);

            //verify description
            HtmlDiv chcOffDescription = new HtmlDiv(browserWindow);

            chcOffDescription.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "The Cultural Heritage Center supports the protection and preservation of cultural heritage and serves as a center of expertise on global cultural heritage protection issues. The Center administers U.S. responsibilities related to the 1970 UNESCO Convention on the Means of Prohibiting and Preventing the Illicit Import, Export, and Transfer of Ownership of Cultural Property, including the Cultural Property Advisory Committee and bilateral agreements; the U.S. Ambassadors Fund for Cultural Preservation (AFCP); the Cultural Antiquities Task Force; and efforts to coordinate protection and preservation of cultural heritage in disaster situations.", HtmlDiv.PropertyNames.TagInstance, "31");
            chcOffDescription.WaitForControlReady();
            Assert.AreEqual(true, chcOffDescription.Exists);

            //verify themes
            HtmlDiv chcOffThemes = new HtmlDiv(browserWindow);

            chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Arts Arts & Culture Civilian Security Conflict Prevention, Mitigation, and Response Democracy / Good Governance / Rule of Law Diversity Entrepreneurship / Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well - Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35");
            chcOffThemes.WaitForControlReady();
            Assert.AreEqual(true, chcOffThemes.Exists);

            //verify goals
            HtmlDiv chcOffGoals = new HtmlDiv(browserWindow);

            chcOffGoals.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Goals Democracy and Human Rights Economic Development Global Economic Growth", HtmlDiv.PropertyNames.TagInstance, "38");
            chcOffGoals.WaitForControlReady();
            Assert.AreEqual(true, chcOffGoals.Exists);

            //verify POC(s)
            HtmlDiv chcOffPoc = new HtmlDiv(browserWindow);

            chcOffPoc.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Points of Contact Cultural Heritage Center Main Line Maria Kouroupas", HtmlDiv.PropertyNames.TagInstance, "45");
            chcOffPoc.WaitForControlReady();
            Assert.AreEqual(true, chcOffPoc.Exists);


            //old code
            //this.UIMap.LogintoQA_existing();
            //this.UIMap.NavigatetoECAOfficeDirectory_viaContentMenu();
            ////this.UIMap.NavigatetoECAOfficeDirectory();
            //this.UIMap.RefreshBrowser();
            //this.UIMap.NavigatetoECAOfficeDirectory_viaContentMenu();
            //this.UIMap.AssertAllOfficesBanner();
            //this.UIMap.AssertSearchOfficesTextBox();
            //this.UIMap.SearchBox_textinput();
            //this.UIMap.RefreshBrowser();
            //this.UIMap.SearchBox_textinput();
            //this.UIMap.AssertSearchShowingResults();
            //this.UIMap.AssertSearchResultTopList();
            //this.UIMap.CloseBrowserWindow();
            //// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
        }