Ejemplo n.º 1
0
        public void ProcessMultipleOrdersByClickingToolBarSaveAll()
        {
            int count = 0;
            //Get the hanlde of the Order list view
            ListBox orderView  = Window.Get <ListBox>(TestDataInfrastructure.GetControlId("OrderListView"));
            int     orderCount = orderView.Items.Count;

            //Select the orders in the list view one by one and POpulate valid order details for every order
            while (count < orderCount)
            {
                orderView.Items[count].Select();
                Label orderNameLabel = (Label)Window.Get(SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("OrderNameLabel"))
                                                         .AndByText(TestDataInfrastructure.GetTestInputData("Order") + (count + 1))
                                                         .AndControlType(typeof(Label)));
                Assert.IsNotNull(orderNameLabel);
                PopulateOrderDetailsWithData();
                count++;
            }

            //Get the hanlde of the toolbar Save all button
            Button saveAllButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("SaveAllToolBarButton"));

            //check if the toolbar save all button is enabled
            Assert.IsTrue(saveAllButton.Enabled);
            //click on the tollbar save all button
            saveAllButton.Click();

            //check if all the orders are saved and removed from the listview
            Assert.AreEqual(orderView.Items.Count.ToString(CultureInfo.InvariantCulture), TestDataInfrastructure.GetTestInputData("DefaultData"));
        }
Ejemplo n.º 2
0
        private void LaunchBuySellPanelFromPositionTable(BuySellEnum buySell, string symbol)
        {
            //first select the Position Tab
            Tab positionBuySellTab = Window.Get <Tab>("PositionBuySellTab");

            positionBuySellTab.Pages.Find(p => p.NameMatches("POSITION")).Select();

            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));

            switch (buySell)
            {
            case BuySellEnum.Buy:
                //right click on the added symbol in the Position Table and click Buy
                list.Rows.Find(r => r.Cells[0].Text.Equals(symbol)).RightClick();
                System.Threading.Thread.Sleep(1000);
                Window.PopupMenu("Buy").Click();
                break;

            case BuySellEnum.Sell:
                //TODO: validate if Symbol can be sold

                //right click on the added symbol in the Position Table and click sell
                list.Rows.Find(r => r.Cells[0].Text.Equals(symbol)).RightClick();
                System.Threading.Thread.Sleep(1000);
                Window.PopupMenu("Sell").Click();
                break;
            }
        }
Ejemplo n.º 3
0
        public void ApplicationLaunch()
        {
            SearchCriteria searchCriteria      = SearchCriteria.ByText(TestDataInfrastructure.GetTestInputData("SelectEmployeeLabelText")).AndControlType(typeof(Label));
            Label          selectEmployeeLabel = Window.Get <Label>(searchCriteria);

            Assert.IsNotNull(selectEmployeeLabel);

            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("EmployeesList"));

            Assert.IsNotNull(list, TestDataInfrastructure.GetTestInputData("EmployeeListNotFound"));

            Assert.AreEqual(2, list.Rows.Count, TestDataInfrastructure.GetTestInputData("EmployeeListIncorrectRowCount"));
            Assert.AreEqual(2, list.Header.Columns.Count, TestDataInfrastructure.GetTestInputData("EmployeeListIncorrectColumnCount"));

            /* Buttons have been removed
             * searchCriteria = SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("SendEmailButton")).AndControlType(typeof(Button));
             * Button sendEmailButton = window.Get<Button>(searchCriteria);
             * Assert.IsNotNull(sendEmailButton, TestDataInfrastructure.GetTestInputData("SendMailButtonNotFound"));
             *
             * searchCriteria = SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("CallButton")).AndControlType(typeof(Button));
             * Button callButton = window.Get<Button>(searchCriteria);
             * Assert.IsNotNull(callButton, TestDataInfrastructure.GetTestInputData("CallButtonNotFound"));
             *
             * searchCriteria = SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("PastProjectsButton")).AndControlType(typeof(Button));
             * Button pastProjectsButton = window.Get<Button>(searchCriteria);
             * Assert.IsNotNull(callButton, TestDataInfrastructure.GetTestInputData("PastProjectsButtonNotfound"));
             */
        }
Ejemplo n.º 4
0
        public void SelectedSymbolRepeatedPositionRowClick()
        {
            //get handle of the Position Table
            ListView    list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));
            string      symbol;
            List <News> news;
            ListBox     articlesView;

            //click the particular symbol of the Position table
            ListViewRow symbolRow = list.Rows.Find(row => row.Cells[TestDataInfrastructure.GetTestInputData("PositionTableSymbol")].Text.Equals(TestDataInfrastructure.GetTestInputData("Symbol")));

            symbolRow.Click();

            //Get the news item for a particular symbol
            symbol = TestDataInfrastructure.GetTestInputData("Symbol");
            news   = TestDataInfrastructure.GetDataForId <NewsDataProvider, News>(symbol);

            //Get the handler of the News Article View displayed
            articlesView = Window.Get <ListBox>(TestDataInfrastructure.GetControlId("NewsArticlesView"));

            //Get the number of news items for the particular symbol
            int newsCount = news.Count;

            Assert.AreEqual(newsCount, articlesView.Items.Count);

            //click the particular symbol of the Position table
            symbolRow.Click();

            //Get the handler of the News Article View displayed
            articlesView = Window.Get <ListBox>(TestDataInfrastructure.GetControlId("NewsArticlesView"));

            Assert.AreEqual(newsCount, articlesView.Items.Count);
        }
Ejemplo n.º 5
0
        public void ApplicationLaunch()
        {
            //check if the controls expected to be loaded on the Shell window is loaded properly, as expected
            ComboBox customerCombobox = Window.Get <ComboBox>(TestDataInfrastructure.GetControlId("CustomerCombobox"));

            Assert.IsNotNull(customerCombobox);

            ComboBox fundCombobox = Window.Get <ComboBox>(TestDataInfrastructure.GetControlId("FundCombobox"));

            Assert.IsNotNull(fundCombobox);

            Button addButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("AddButton"));

            Assert.IsNotNull(addButton);

            Label activity1Label = (Label)Window.Get(SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("ActivityLabel"))
                                                     .AndByText(TestDataInfrastructure.GetTestInputData("Customer1ActivityLabelText"))
                                                     .AndControlType(typeof(Label)));

            Assert.IsNotNull(activity1Label);

            Label activity2Label = (Label)Window.Get(SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("ActivityLabel"))
                                                     .AndByText(TestDataInfrastructure.GetTestInputData("Customer2ActivityLabelText"))
                                                     .AndControlType(typeof(Label)));

            Assert.IsNotNull(activity2Label);
        }
Ejemplo n.º 6
0
        public void AttemptToolBarSaveAllForMultipleValidOrdersAndOneInvalidOrder()
        {
            int count = 0;

            //Get the hanlde of the order list view
            ListBox orderView  = Window.Get <ListBox>(TestDataInfrastructure.GetControlId("OrderListView"));
            int     orderCount = orderView.Items.Count;

            //Select the orders in the list view one by one and POpulate valid order details for every order
            while (count < orderCount)
            {
                orderView.Items[count].Select();
                Label orderNameLabel = (Label)Window.Get(SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("OrderNameLabel"))
                                                         .AndByText(TestDataInfrastructure.GetTestInputData("Order") + (count + 1))
                                                         .AndControlType(typeof(Label)));
                Assert.IsNotNull(orderNameLabel);
                PopulateOrderDetailsWithData();
                count++;
            }

            //Get the hanlde of te toolbar save all button
            Button saveAllButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("SaveAllToolBarButton"));

            //check if the toolbar save all button is enabled
            Assert.IsTrue(saveAllButton.Enabled);

            //POpulate the selected ordere details with invalid data
            PopulateOrderDetailsWithInvalidData();

            //check if the toolbar save all button is disabled
            Assert.IsFalse(saveAllButton.Enabled);
        }
Ejemplo n.º 7
0
        public void DisplayedNewsDoubleClick()
        {
            //Get the handle of the Position table
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));

            //Click on the particular symbol row
            list.Rows.Find(row => row.Cells[TestDataInfrastructure.GetTestInputData("PositionTableSymbol")].Text.Equals(TestDataInfrastructure.GetTestInputData("Symbol"))).Click();

            //Get the news item for the particular symbol row
            List <News> news = TestDataInfrastructure.GetDataForId <NewsDataProvider, News>(TestDataInfrastructure.GetTestInputData("Symbol"));

            //Get the handle of the articles view
            ListBox articlesView = Window.Get <ListBox>(TestDataInfrastructure.GetControlId("NewsArticlesView"));

            //Double click the first news article item
            articlesView.Items[0].DoubleClick();

            //Get the handle of the News Reader window
            Window newsWindow = App.GetWindows().Find(newsArticleWindow => newsArticleWindow.Title.Equals("News Reader"));

            Assert.IsNotNull(newsWindow);

            //Geth the Body,Title and Published Date from the News Reader window
            string   body          = newsWindow.Get <TextBox>(TestDataInfrastructure.GetControlId("ArticleBody")).Text;
            string   title         = newsWindow.Get <Label>(TestDataInfrastructure.GetControlId("ArticleTitle")).Text;
            DateTime publishedDate = Convert.ToDateTime(newsWindow.Get <Label>(TestDataInfrastructure.GetControlId("ArticlePublishedDate")).Text, CultureInfo.CurrentCulture);

            Assert.AreEqual(body, news[0].Body);
            Assert.AreEqual(title, news[0].Title);
            Assert.AreEqual(publishedDate, news[0].PublishedDate);
        }
        public void SellMultipleStocksFromPositionTableByClickingSubmitAll()
        {
            string symbol;
            string anotherSymbol;

            symbol        = TestDataInfrastructure.GetTestInputData("Symbol");
            anotherSymbol = TestDataInfrastructure.GetTestInputData("PositionSymbol");

            /////////////////////////////////
            //Enter Share 1 Details
            LaunchBuySellPanelFromPositionTable(BuySellEnum.Sell, symbol);
            Order model = new Order(
                symbol,
                Decimal.Parse(TestDataInfrastructure.GetTestInputData("BuySellLimitPrice"), CultureInfo.InvariantCulture),
                TestDataInfrastructure.GetTestInputData("BuySellOrderType"),
                int.Parse(TestDataInfrastructure.GetTestInputData("BuySellNumberOfShares"), CultureInfo.InvariantCulture),
                TestDataInfrastructure.GetTestInputData("TimeInForceEndOfDay"),
                BuySellEnum.Sell.ToString()
                );

            PopulateBuySellPanelWithData(model);
            /////////////////////////////////

            /////////////////////////////////
            //Enter Share 2 Details
            LaunchBuySellPanelFromPositionTable(BuySellEnum.Sell, anotherSymbol);
            Order anotherModel = new Order(
                anotherSymbol,
                Decimal.Parse(TestDataInfrastructure.GetTestInputData("BuySellLimitPrice"), CultureInfo.InvariantCulture),
                TestDataInfrastructure.GetTestInputData("BuySellOrderType"),
                int.Parse(TestDataInfrastructure.GetTestInputData("BuySellNumberOfShares"), CultureInfo.InvariantCulture),
                TestDataInfrastructure.GetTestInputData("TimeInForceEndOfDay"),
                BuySellEnum.Sell.ToString()
                );

            PopulateBuySellPanelWithData(anotherModel);

            Button submitAllButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("BuySellSubmitAllButton"));

            submitAllButton.Click();

            //give time for submit processing
            System.Threading.Thread.Sleep(2000);

            // Validate if expander Buy/Sell Panels disappear.
            // AND
            // Validate if the sell transactions were successful
            GroupBox buySellSymbolGroup = Window.Get <GroupBox>(SearchCriteria.ByAutomationId("CompositeExpander")
                                                                .AndControlType(typeof(GroupBox)));

            Assert.IsNull(buySellSymbolGroup);

            List <Order> orders = TestDataInfrastructure.GetData <OrderDataProvider, Order>();

            Assert.IsNotNull(orders.Find(o => o.Symbol.Equals(symbol) || o.Symbol.Equals(anotherSymbol)));

            // Validate the correctness of data.
            Assert.IsTrue(orders.Find(o => o.Symbol.Equals(symbol)).Equals(model));
            Assert.IsTrue(orders.Find(o => o.Symbol.Equals(anotherSymbol)).Equals(anotherModel));
        }
Ejemplo n.º 9
0
        public void ClickingAlreadyShownSymbolDisplaysNewsArticlesCorrespondingly()
        {
            //get handle of the Position Table
            ListView    list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));
            string      symbol;
            List <News> news;
            ListBox     articlesView;

            //click the particular symbol of the Position table STOCK0
            ListViewRow symbolRow = list.Rows.Find(row => row.Cells[TestDataInfrastructure.GetTestInputData("PositionTableSymbol")].Text.Equals(TestDataInfrastructure.GetTestInputData("Symbol")));

            symbolRow.Click();

            //click on the position symbol STOCK6
            ListViewRow secondSymbolRow = list.Rows.Find(row => row.Cells[TestDataInfrastructure.GetTestInputData("PositionTableSymbol")].Text.Equals(TestDataInfrastructure.GetTestInputData("PositionSymbol")));

            secondSymbolRow.Click();

            //click the particular symbol of the Position table STOCK0
            symbolRow.Click();

            //Get the news item for a particular symbol
            symbol = TestDataInfrastructure.GetTestInputData("Symbol");
            news   = TestDataInfrastructure.GetDataForId <NewsDataProvider, News>(symbol);

            //Get the handler of the News Article View displayed
            articlesView = Window.Get <ListBox>(TestDataInfrastructure.GetControlId("NewsArticlesView"));

            Assert.AreEqual(news.Count, articlesView.Items.Count);
        }
Ejemplo n.º 10
0
        private static void SelectItemInComboBox(AutomationElement element, String selectedItemName)
        {
            // Get the mapped item name.
            String itemName = TestDataInfrastructure.GetControlId(selectedItemName);

            // Set focus to ensure that the object is selected.
            element.SetFocus();

            // Expand the ComboBox using ExpandCollapsePattern.
            ExpandCollapsePattern expandPattern = element.GetCurrentPattern(ExpandCollapsePattern.Pattern) as ExpandCollapsePattern;

            expandPattern.Expand();

            // get the desired automation element
            PropertyCondition itemNameCondition = new PropertyCondition(AutomationElement.NameProperty, itemName);
            PropertyCondition itemTypeCondition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.ListItem);
            AndCondition      itemCondition     = new AndCondition(itemNameCondition, itemTypeCondition);

            AutomationElement item = element.FindFirst(TreeScope.Descendants, itemCondition);

            if (item != null)
            {
                // select combo box item
                ((SelectionItemPattern)item.GetCurrentPattern(SelectionItemPattern.Pattern)).Select();
            }
        }
Ejemplo n.º 11
0
        public void WatchListPin()
        {
            ListView watchList          = Window.Get <ListView>(TestDataInfrastructure.GetControlId("WatchListView"));
            UIItem   watchListTabHeader = Window.GetWatchListRegionHeader();

            watchListTabHeader.Click();
            watchList = Window.Get <ListView>(TestDataInfrastructure.GetControlId("WatchListView"));

            //pin the watch list panel
            //Button pinImage = window.Get<Button>(TestDataInfrastructure.GetControlId("WatchListHideButton"));
            Button pinImage = Window.Get <Button>("HeaderAutoHideButton");

            pinImage.Click();

            Assert.IsFalse(IsWatchListWindowCollapsed(watchList));
            Assert.IsFalse(watchListTabHeader.Visible);

            //to lose focus on the WatchList button, click somewhere on the Account Position List
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));

            list.Click();

            Assert.IsFalse(IsWatchListWindowCollapsed(watchList));

            //unpin the watch list panel (by clicking on the pin again)
            pinImage.Click();

            Assert.IsTrue(watchListTabHeader.Visible);
            Assert.IsTrue(IsWatchListWindowCollapsed(watchList));
        }
Ejemplo n.º 12
0
        public void ValidateEmployeeSelection()
        {
            //select first row (employee)
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("EmployeesList"));

            list.SelectEmployee(0);

            //validate details view
            Tab empDetailsTab = Window.Get <Tab>(TestDataInfrastructure.GetControlId("DetailsTabControl"));

            Assert.IsNotNull(empDetailsTab, TestDataInfrastructure.GetTestInputData("EmpDetailsTabNotFound"));

            //validate tab has three tab items, and their names are "General", "Location" and "Current Projects"
            Assert.AreEqual(3, empDetailsTab.Pages.Count, TestDataInfrastructure.GetTestInputData("EmpDetailsTabPagesCount"));
            Assert.IsTrue(
                (empDetailsTab.Pages[0].NameMatches(TestDataInfrastructure.GetTestInputData("EmpDetailsTabGeneral")) &&
                 empDetailsTab.Pages[1].NameMatches(TestDataInfrastructure.GetTestInputData("EmpDetailsTabLocation")) &&
                 empDetailsTab.Pages[2].NameMatches(TestDataInfrastructure.GetTestInputData("EmpDetailsTabCurrentProjects"))),
                TestDataInfrastructure.GetTestInputData("EmpDetailsTabPagesIncorrect"));

            //validate controls in each of the tabs
            ValidateGeneralTabControls();
            ValidateLocationTabControls();
            ValidateCurrentProjectsTabControls();
        }
Ejemplo n.º 13
0
        // TODO: Required a single method to toggle between tabs.
        private void SelectPositionTabPage()
        {
            Tab positionBuySellTab = Window.Get <Tab>(SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("PositionBuySellTab"))
                                                      .AndControlType(typeof(Tab)));

            positionBuySellTab.Pages.Find(p => p.NameMatches(TestDataInfrastructure.GetTestInputData("PositionTab"))).Select();
        }
Ejemplo n.º 14
0
        public static UIItem GetCollapsibleRegionHeader(this UIItemContainer rootElement, string controlId)
        {
            Tab    tab          = rootElement.Get <Tab>(TestDataInfrastructure.GetControlId("CollapsibleRegion"));
            UIItem watchListTab = tab.Pages.Find(x => x.NameMatches(TestDataInfrastructure.GetControlId(controlId))) as UIItem;

            return(watchListTab);
        }
Ejemplo n.º 15
0
        public void AddFundToCustomer()
        {
            WPFComboBox customer;
            WPFComboBox fund;
            Button      addButton;
            Label       activityLabel;

            //Get the handle of the Customer combo box and select Customer1
            customer = Window.Get <WPFComboBox>(TestDataInfrastructure.GetControlId("CustomerCombobox"));
            customer.Select(TestDataInfrastructure.GetTestInputData("DefaultCustomer").ToString());

            //Get the handle of the Fund combo box and select FundA
            fund = Window.Get <WPFComboBox>(TestDataInfrastructure.GetControlId("FundCombobox"));
            fund.Select(TestDataInfrastructure.GetTestInputData("DefaultFund"));

            //Get the handle of the Add button and click on it
            addButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("AddButton"));
            addButton.Click();

            //Get the handle of the Activity Label
            activityLabel = Window.Get <Label>(TestDataInfrastructure.GetControlId("ActivityLabel"));

            //Check if the selected fund is added to the Activity View of the selected customer.
            Assert.AreEqual(activityLabel.Text, TestDataInfrastructure.GetTestInputData("Customer1ActivityLabelText"));
            Assert.IsNotNull((Label)Window.Get(SearchCriteria.ByText(TestDataInfrastructure.GetTestInputData("DefaultFund"))
                                               .AndControlType(typeof(Label))));
        }
Ejemplo n.º 16
0
        public void ValidateEmployeeDetailsCurrentProjectsSection()
        {
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("EmployeesList"));

            list.SelectEmployee(TestDataInfrastructure.GetTestInputData("Emp_1_FirstName"));

            ValidateEmployeeDetailsCurrentProjectsTabData();
        }
Ejemplo n.º 17
0
        public void AccountPositionTableRowCount()
        {
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));
            //read number of account positions from the AccountPosition.xml data file
            int positionRowCount = TestDataInfrastructure.GetCount <AccountPositionDataProvider, AccountPosition>();

            Assert.AreEqual(positionRowCount, list.Rows.Count);
        }
Ejemplo n.º 18
0
        private void ValidateEmployeeDetailsLocationTabData()
        {
            Tab empDetailsTab = Window.Get <Tab>(TestDataInfrastructure.GetControlId("DetailsTabControl"));

            empDetailsTab.Pages[1].Select();

            //TODO: get handle of the frame in location taband validate
        }
Ejemplo n.º 19
0
        private void ValidateLocationTabControls()
        {
            //select the Location tab
            Tab empDetailsTab = Window.Get <Tab>(TestDataInfrastructure.GetControlId("DetailsTabControl"));

            empDetailsTab.Pages[1].Select();

            //TODO: validate display of frame
        }
Ejemplo n.º 20
0
        public void ValidateEmployeeDetailsGeneralSection()
        {
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("EmployeesList"));

            list.SelectEmployee(TestDataInfrastructure.GetTestInputData("Emp_1_FirstName"));

            Employee emp = GetEmployeeId();

            ValidateEmployeeDetailsGeneralTabData(emp);
        }
Ejemplo n.º 21
0
        private void ValidateEmployeeDetailsCurrentProjectsTabData()
        {
            Tab empDetailsTab = Window.Get <Tab>(TestDataInfrastructure.GetControlId("DetailsTabControl"));

            empDetailsTab.Pages[2].Select();

            ListView projectsList = Window.Get <ListView>(TestDataInfrastructure.GetControlId("CurrentProjectsList"));

            //check if the list has two columns
            Assert.AreEqual(2, projectsList.Header.Columns.Count);

            //check if the list has two rows
            Assert.AreEqual(2, projectsList.Rows.Count);
        }
Ejemplo n.º 22
0
        public void EachCustomerShouldHaveAnActivityView()
        {
            WPFComboBox customer;

            //Get the handle of the customer combo box
            customer = Window.Get <WPFComboBox>(TestDataInfrastructure.GetControlId("CustomerCombobox"));

            //For every customer in the customer combo box,check if a corresponding article view is displayed
            for (int count = 0; count < customer.Items.Count - 1; count++)
            {
                Assert.IsNotNull((Label)Window.Get(SearchCriteria.ByAutomationId(TestDataInfrastructure.GetControlId("ActivityLabel")).
                                                   AndByText(TestDataInfrastructure.GetTestInputData("ActivityLabelText") + customer.Items[count].Text)
                                                   .AndControlType(typeof(Label))));
            }
        }
Ejemplo n.º 23
0
        public void WatchListClickShow()
        {
            ListView watchList    = Window.Get <ListView>(TestDataInfrastructure.GetControlId("WatchListView"));
            UIItem   watchListTab = Window.GetWatchListRegionHeader();

            watchListTab.Click();
            watchList = Window.Get <ListView>(TestDataInfrastructure.GetControlId("WatchListView"));

            Assert.IsFalse(IsWatchListWindowCollapsed(watchList));

            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));

            list.Click();

            Assert.IsTrue(IsWatchListWindowCollapsed(watchList));
        }
Ejemplo n.º 24
0
        private void ValidateCurrentProjectsTabControls()
        {
            //select the "Current Projects" tab
            Tab empDetailsTab = Window.Get <Tab>(TestDataInfrastructure.GetControlId("DetailsTabControl"));

            empDetailsTab.Pages[2].Select();

            SearchCriteria searchCriteria = SearchCriteria.ByText(TestDataInfrastructure.GetTestInputData("PartOfFollowingProjectsLabel")).AndControlType(typeof(Label));
            Label          projectsLabel  = Window.Get <Label>(searchCriteria);

            Assert.IsNotNull(projectsLabel);

            ListView projectsList = Window.Get <ListView>(TestDataInfrastructure.GetControlId("CurrentProjectsList"));

            Assert.IsNotNull(projectsList);
        }
Ejemplo n.º 25
0
        public void AddingWatchListItemFromToolBarAddsRowToListAndExpandsWatchList()
        {
            Window.GetWatchListRegionHeader().Click();
            ListView watchList           = Window.Get <ListView>(TestDataInfrastructure.GetControlId("WatchListView"));
            int      oldCount            = watchList.Rows.Count;
            TextBox  addWatchListTextBox = Window.Get <TextBox>(TestDataInfrastructure.GetControlId("WatchListAddTextBox"));

            addWatchListTextBox.Text = TestDataInfrastructure.GetTestInputData("WatchListSymbol");

            Button addWatchListButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("WatchListAddButton"));

            addWatchListButton.Click();

            Window.GetWatchListRegionHeader().Click();
            Assert.AreEqual(oldCount + 1, watchList.Rows.Count);
            Assert.IsFalse(IsWatchListWindowCollapsed(watchList));
        }
Ejemplo n.º 26
0
        public void AttemptSaveAfterMakingAnOrderInvalid()
        {
            //Populate the order details fileds with valid data
            PopulateOrderDetailsWithData();

            //Get the hanlde of the save button
            Button saveButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("SaveButton"));

            //check if the save button is enabled
            Assert.IsTrue(saveButton.Enabled);

            //Populate the order details fileds with invalid data
            PopulateOrderDetailsWithInvalidData();

            //check if the save button is disabled
            Assert.IsFalse(saveButton.Enabled);
        }
Ejemplo n.º 27
0
        public void SelectedFundIsAddedOnlyToTheSelectedCustomer()
        {
            string[] selectedCustomer = new string[2];
            string[] selectedFund     = new string[2];

            const int CUSTOMERS_IN_DROPDOWN = 2;

            for (int i = 0; i < CUSTOMERS_IN_DROPDOWN; i++)
            {
                //Get the handle of the Customer combo box and select customer.
                WPFComboBox customer = Window.Get <WPFComboBox>(TestDataInfrastructure.GetControlId("CustomerCombobox"));
                customer.Select(TestDataInfrastructure.GetTestInputData("Customer" + i.ToString(CultureInfo.InvariantCulture)).ToString());
                selectedCustomer[i] = customer.Items[i].Text;

                //Get the handle of the Fund combo box and select fund.
                WPFComboBox fund = Window.Get <WPFComboBox>(TestDataInfrastructure.GetControlId("FundCombobox"));
                fund.Select(TestDataInfrastructure.GetTestInputData("Fund" + i.ToString(CultureInfo.InvariantCulture)));
                selectedFund[i] = fund.Items[i].Text;

                //Get the handle of the Add button and click on it.
                Button addButton = Window.Get <Button>(TestDataInfrastructure.GetControlId("AddButton"));
                addButton.Click();
            }

            // Now validate whether the fund has been added correctly.
            List <AutomationElement> elements = Window.AutomationElement.FindSiblingsInTreeByName("ActivityView");
            int counter = 0;

            foreach (AutomationElement element in elements)
            {
                if (counter < CUSTOMERS_IN_DROPDOWN)
                {
                    // Find the text box and the fund text associated.
                    AutomationElement textBox       = element.SearchInRawTreeByName("ActivityLabel");
                    string            textBoxValue  = textBox.Current.Name;
                    string            expectedValue = TestDataInfrastructure.GetTestInputData("ActivityLabelText") + selectedCustomer[counter].ToString();
                    Assert.AreEqual(expectedValue, textBoxValue);

                    // Find the fund values
                    AutomationElement fund = element.SearchInRawTreeByName(selectedFund[counter].ToString());
                    Assert.AreEqual(fund.Current.Name, selectedFund[counter].ToString());
                    counter++;
                }
            }
        }
Ejemplo n.º 28
0
        public void AccountPositionTableColumns()
        {
            ListView       list       = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));
            ListViewHeader listHeader = list.Header;

            Assert.AreEqual(6, listHeader.Columns.Count);

            //The Columns in the Position Table are partly coming from two different XML files and
            //the rest are computed columns. the only place where the column names are defined is the
            //PositionView XAML file, hence the hard-coding.

            Assert.AreEqual(TestDataInfrastructure.GetTestInputData("PositionTableSymbol"), listHeader.Columns[0].Name);
            Assert.AreEqual(TestDataInfrastructure.GetTestInputData("PositionTableShares"), listHeader.Columns[1].Name);
            Assert.AreEqual(TestDataInfrastructure.GetTestInputData("PositionTableLast"), listHeader.Columns[2].Name);
            Assert.AreEqual(TestDataInfrastructure.GetTestInputData("PositionTableCost"), listHeader.Columns[3].Name);
            Assert.AreEqual(TestDataInfrastructure.GetTestInputData("PositionTableMarketValue"), listHeader.Columns[4].Name);
            Assert.AreEqual(TestDataInfrastructure.GetTestInputData("PositionTableGainLoss"), listHeader.Columns[5].Name);
        }
Ejemplo n.º 29
0
        public void ApplicationLaunch()
        {
            ListView list = Window.Get <ListView>(TestDataInfrastructure.GetControlId("PositionTableId"));

            Assert.IsNotNull(list);

            //read number of account positions from the AccountPosition.xml data file
            int positionRowCount = TestDataInfrastructure.GetCount <AccountPositionDataProvider, AccountPosition>();

            Assert.AreEqual(positionRowCount, list.Rows.Count);

            // News button is no longer on grid
            //SearchCriteria searchCriteria = SearchCriteria.ByText(TestDataInfrastructure.GetControlId("NewsButtonName")).AndControlType(typeof(Button));
            //Button button = window.Get<Button>(searchCriteria);
            //Assert.IsNotNull(button);

            //pie chart and line chart could not be automated
        }
        public void ClickLoadModuleCButton()
        {
            Button button = Window.Get <Button>(
                SearchCriteria
                .ByText(TestDataInfrastructure.GetControlId("LoadModuleCButtonText"))
                .AndControlType(typeof(Button)));

            Assert.IsNotNull(button);

            button.Click();

            Label moduleCContent = Window.Get <Label>(
                SearchCriteria
                .ByText(TestDataInfrastructure.GetTestInputData("ModuleCContent"))
                .AndControlType(typeof(Label)));

            Assert.IsNotNull(moduleCContent);
        }