示例#1
0
        public void CreditCardAdvanceSearch()
        {
            Initialize();
            var datarows = ExcelReader.ImportSpreadsheet(ExcelFileNames.ARAdvancedSearch);

            foreach (var dataRow in datarows)
            {
                if (dataRow.ItemArray[1].ToString() == "Credit Card")
                {
                    SearchWindow.SelectSearchElements(null, "CreditCard", SearchWindow.SearchTypeConstants.Advanced);
                    ARAdvancedSearchWindow.EnterCreditCardSearchData(dataRow);
                    ARAdvancedSearchWindow.ClickSearchBtn();
                    Playback.Wait(10000);
                    var creditCard = ARAdvancedSearchWindow.SelectCreditCardRecord(dataRow.ItemArray[11].ToString());
                    if (creditCard)
                    {
                        Playback.Wait(5000);
                        MouseActions.ClickButton(SimpleSearchWindow.GetViewCreditCardPaymentWindowProperties(), "_btnClose");
                        ARAdvancedSearchWindow.CloseSearchResultsWindow();
                    }
                    if (ARAdvancedSearchWindow.VerifySearchResultsWindowDisplayed())
                    {
                        ARAdvancedSearchWindow.CloseSearchResultsWindow();
                    }
                }
            }
            Cleanup();
        }
        public void CreditCardSearch()
        {
            try
            {
                var datarows = Initialize();
                foreach (var datarow in datarows.Where(datarow => datarow.ItemArray[4].ToString().Equals("CreditCard")))
                {
                    Debug.WriteLine(datarow.ItemArray[3]);
                    SearchWindow.SelectSearchElements(datarow.ItemArray[5].ToString(), "CreditCard",
                                                      SearchWindow.SearchTypeConstants.Simple);
                    SearchWindow.SelectCardFromResults();

                    Factory.AssertIsTrue(SimpleSearchWindow.VerifyViewCreditCardPaymentWindowDisplayed(datarow.ItemArray[5].ToString()),
                                         "View Credit card payment window is not displayed for the search criteria");

                    TitlebarActions.ClickClose((WinWindow)SimpleSearchWindow.GetViewCreditCardPaymentWindowProperties());
                    SimpleSearchWindow.CloseResultsWindow();
                }
            }
            finally
            {
                Cleanup();
            }
        }