/** * Reads the "CardDetails" sheet of Test Data excel and fill the credit card details * * @param cardRow Row number of excel sheet to be filled in * @return Returns the Excel sheet data which was filled */ public TestDataReader FillCardDetails(int cardRow) { TestDataReader data = new TestDataReader(testConfig, "CardDetails"); String value = ""; value = data.GetData(cardRow, "CC"); Element.enterData(testConfig, creditCardNumber, value, "Card Number"); value = data.GetData(cardRow, "Name"); Element.enterData(testConfig, creditCardName, value, "Name on Card"); value = data.GetData(cardRow, "CVV"); Element.enterData(testConfig, creditCardCvvNo, value, "CVV"); value = data.GetData(cardRow, "Mon"); Element.selectValue(testConfig, creditCardExpiryMonth, value, "Expiry month"); value = data.GetData(cardRow, "Year"); Element.selectValue(testConfig, creditCardExpiryYear, value, "Expiry year"); return data; }
/** * Verifies Alias input as follows Stores current alias for future Checks error message for more * than 20 characters Alias Checks error message for special characters Alias Checks confirm * button disabled for blank/current alias Reverts alias to previous value * * @param validationMessage */ public void verifyAliasInputFieldValidations(HashMap<String, String> validationMessage) { clickChangeAliasButton(); // Store the current Alias String currentAlias = OldAliasInput.getAttribute("value"); // Enter a new alias String NewAlias = Helper.generateRandomAlphabetsString(6); Element.enterData(testConfig, NewAliasInput, NewAlias, "New Alias Input"); Element.click(testConfig, uploadAndProcess, "Submit Alias Changes"); verifyNotificationText(validationMessage.get("AliasChangeSuccessful")); clickChangeAliasButton(); // Verify alias was changed Helper.compareEquals( testConfig, "Old Alias Value", NewAlias, OldAliasInput.getAttribute("value")); // More than 20 characters Element.enterData( testConfig, NewAliasInput, Helper.generateRandomAlphaNumericString(30), "New Alias Input"); Element.click(testConfig, uploadAndProcess, "Submit Alias Changes"); Element.waitForElementDisplay(testConfig, ErrorMessageOnPopUp); Helper.compareEquals( testConfig, "Error Message", validationMessage.get("LongAliasErrorMessage"), ErrorMessageOnPopUp.getText()); // Special Characters Element.enterData(testConfig, NewAliasInput, "!@##$$$$", "New Alias Input"); Element.click(testConfig, uploadAndProcess, "Submit Alias Changes"); Helper.compareEquals( testConfig, "Error Message", validationMessage.get("SpecialCharacterInAliasErrorMessage"), ErrorMessageOnPopUp.getText()); // Existing Alias String ExistingAlias = OldAliasInput.getAttribute("value"); Element.enterData(testConfig, NewAliasInput, ExistingAlias, "New Alias Input"); Helper.compareTrue(testConfig, "Confirm button is disabled", (!uploadAndProcess.isEnabled())); // Blank Value Element.enterData(testConfig, NewAliasInput, "", "New Alias Input"); Helper.compareTrue(testConfig, "Confirm button is disabled", (!uploadAndProcess.isEnabled())); // Enter Older value of alias and save changes Element.enterData(testConfig, NewAliasInput, currentAlias, "New Alias Input"); Element.click(testConfig, uploadAndProcess, "Submit Alias Changes"); verifyNotificationText(validationMessage.get("AliasChangeSuccessful")); }
public void enterCCNumber(String strCCNumber) { Element.enterData(testConfig, creditCardNumber, strCCNumber, "Card Number"); }