public static void DesktopAssertAddRepeatedFundsToCustomer()
        {
            int numberOfAddClicks = 3;

            //Add Default fund to default customer repeatedly.
            EventAggregationPage <TApp> .CustomerComboBox.Expand();

            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .CustomerComboItems[1].Select();
            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .FundComboItems[1].Select();
            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .AddButton.Click();

            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .AddButton.Click();

            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .AddButton.Click();

            Assert.AreEqual(EventAggregationPage <TApp> .ActivityLabel.Current.Name, GetDataFromTestDataFile("Customer1ActivityLabelText"));

            //For every Add button click, Check if the selected fund is added to the selected customer repeatedly.
            Assert.AreEqual(EventAggregationPage <TApp> .GetAllFundsLabels("DefaultFund").Count - 1, numberOfAddClicks, "Funds is not added for all button clicks");
        }
        public static void DesktopAssertAddMultipleFundsToCustomer()
        {
            //Add Default fund to default customer
            AutomationElementCollection aeCustItems = EventAggregationPage <TApp> .CustomerComboItems;

            aeCustItems[1].Select();

            Thread.Sleep(TIMEWAIT);
            AutomationElementCollection aeFundItems = EventAggregationPage <TApp> .FundComboItems;

            aeFundItems[1].Select();
            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .AddButton.Click();

            //Select another fund to default customer
            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .FundComboItems[2].Select();
            Thread.Sleep(TIMEWAIT);
            EventAggregationPage <TApp> .AddButton.Click();

            //Assert Activity View
            Assert.AreEqual(EventAggregationPage <TApp> .ActivityLabel.Current.Name, GetDataFromTestDataFile("Customer1ActivityLabelText"));

            Assert.IsNotNull(EventAggregationPage <TApp> .GetFundsLabel("DefaultFund"));
            Assert.IsNotNull(EventAggregationPage <TApp> .GetFundsLabel("AnotherFund"));
        }
示例#3
0
 public static void DesktopAssertEachCustomerShouldHaveAnActivityView()
 {
     //For every customer in the customer combo box,check if a corresponding article view is displayed
     for (int count = 0; count < EventAggregationPage <TApp> .CustomerComboBox.Items.Count - 1; count++)
     {
         Assert.IsNotNull(EventAggregationPage <TApp> .GetFundsLabelByAutomationId(GetDataFromResourceFile("ActivityLabelTextValue") + " " + EventAggregationPage <TApp> .CustomerComboBox.Items[count].Text, GetDataFromResourceFile("ActivityLabel")));
     }
 }
        public void TestInitialize()
        {
            string currentOutputPath = (new System.IO.DirectoryInfo(Assembly.GetExecutingAssembly().Location)).Parent.FullName;

            EventAggregationPage <WpfAppLauncher> .LaunchApplication(currentOutputPath + GetDesktopApplication(), GetDesktopApplicationTitle());

            Thread.Sleep(5000);
        }
示例#5
0
        public static void DesktopAssertAddMultipleFundsToCustomer()
        {
            //Add Default fund to default customer
            EventAggregationPage <TApp> .CustomerComboBox.Select(GetDataFromTestDataFile("DefaultCustomer"));

            EventAggregationPage <TApp> .FundComboBox.Select(GetDataFromTestDataFile("DefaultFund"));

            EventAggregationPage <TApp> .AddButton.Click();

            //Select another fund to default customer
            EventAggregationPage <TApp> .FundComboBox.Select(GetDataFromTestDataFile("AnotherFund"));

            EventAggregationPage <TApp> .AddButton.Click();

            //Assert Activity View
            Assert.AreEqual(EventAggregationPage <TApp> .ActivityLabel.Text, GetDataFromTestDataFile("Customer1ActivityLabelText"));

            Assert.IsNotNull(EventAggregationPage <TApp> .GetFundsLabel(GetDataFromTestDataFile("DefaultFund")));
            Assert.IsNotNull(EventAggregationPage <TApp> .GetFundsLabel(GetDataFromTestDataFile("AnotherFund")));
        }
示例#6
0
        public static void DesktopAssertAddRepeatedFundsToCustomer()
        {
            int numberOfAddClicks = 3;

            //Add Default fund to default customer repeatedly.
            EventAggregationPage <TApp> .CustomerComboBox.Select(GetDataFromTestDataFile("DefaultCustomer"));

            EventAggregationPage <TApp> .FundComboBox.Select(GetDataFromTestDataFile("DefaultFund"));

            EventAggregationPage <TApp> .AddButton.Click();

            EventAggregationPage <TApp> .AddButton.Click();

            EventAggregationPage <TApp> .AddButton.Click();

            Assert.AreEqual(EventAggregationPage <TApp> .ActivityLabel.Text, GetDataFromTestDataFile("Customer1ActivityLabelText"));

            //For every Add button click, Check if the selected fund is added to the selected customer repeatedly.
            for (int count = 0; count < numberOfAddClicks; count++)
            {
                Assert.IsNotNull(EventAggregationPage <TApp> .GetFundsLabel(GetDataFromResourceFile("DefaultFund")));
            }
        }
 public void MyTestCleanup()
 {
     EventAggregationPage <WpfAppLauncher> .DisposeApplication();
 }