public void VerifyTransactionHistory( int? rowIndex, TransactionTypeString typeString, string ccNumber, double amount, int eventId) { string transactionRowLocator = string.Empty; if (rowIndex.HasValue) { transactionRowLocator = string.Format("{0}[{1}]", TransactionRows, rowIndex); } else { // The last row shows the total balance, so locate to the last but one transactionRowLocator = string.Format("{0}[{1}]", TransactionRows, "last()-1"); } string transactionCellInRowLocatorFormat = "{0}/td[{1}]"; string transactionTypeCellInRowLocator = string.Format( transactionCellInRowLocatorFormat, transactionRowLocator, (int)(TransactionCellInRow.Type)); string transactionAmountCellInRowLocator = string.Format( transactionCellInRowLocatorFormat, transactionRowLocator, (int)(TransactionCellInRow.Amount)); string expectedTransactionTypeCellString = StringEnum.GetStringValue(typeString); // If the CC number is specified as null, it will not be verified. if (!string.IsNullOrEmpty(ccNumber)) { expectedTransactionTypeCellString += "\r\n" + Utility.GetEncryptedCCNumber(ccNumber) + " (Details)"; } string actualTransactionTypeCellString = UIUtil.DefaultProvider.GetText(transactionTypeCellInRowLocator, LocateBy.XPath); VerifyTool.VerifyValue(expectedTransactionTypeCellString, actualTransactionTypeCellString, "Transaction type: {0}"); VerifyTool.VerifyValue( MoneyTool.FormatMoney(amount), UIUtil.DefaultProvider.GetText(transactionAmountCellInRowLocator, LocateBy.XPath), "Transaction amount: {0}"); }
public void VerifyTransactionDetails( TransactionTypeString typeString, double amount, PaymentManager.CCType creditCardType, string ccNumber, string holderName, int eventId) { string detailDIVLocator = "//div[@id='pageContent']"; string detailNameLocatorFormat = detailDIVLocator + "//th[text()='{0}']"; string detailResponseLocatorFormat = detailNameLocatorFormat + "/following-sibling::td"; VerifyTool.VerifyValue( StringEnum.GetStringValue(typeString), UIUtil.DefaultProvider.GetText(string.Format(detailResponseLocatorFormat, "Type:"), LocateBy.XPath), "Transaction type: {0}"); VerifyTool.VerifyValue( MoneyTool.FormatMoney(amount), UIUtil.DefaultProvider.GetText(string.Format(detailResponseLocatorFormat, "Amount:"), LocateBy.XPath), "Transaction amount: {0}"); VerifyTool.VerifyValue( creditCardType.ToString(), UIUtil.DefaultProvider.GetText(string.Format(detailResponseLocatorFormat, "Credit Card Type:"), LocateBy.XPath), "Transaction credit card type: {0}"); VerifyTool.VerifyValue( Utility.GetEncryptedCCNumber(ccNumber), UIUtil.DefaultProvider.GetText(string.Format(detailResponseLocatorFormat, "Credit Card Number:"), LocateBy.XPath), "Transaction credit card number: {0}"); VerifyTool.VerifyValue( holderName, UIUtil.DefaultProvider.GetText(string.Format(detailResponseLocatorFormat, "Cardholder Name:"), LocateBy.XPath), "Transaction cardholder name: {0}"); }