public static void Delete_Event_MySQL(String Event_ID) { // Delete event. sqlHelper.delete( Table_Events.Table_Name, new String[] {Table_Events.Event_ID}, new String[] {Event_ID}, new int[] {1}); // Delete event_user. sqlHelper.delete( Table_Events_Users.Table_Name, new String[] {Table_Events_Users.Event_ID}, new String[] {Event_ID}, null); // Delete tasks. sqlHelper.delete( Table_Tasks.Table_Name, new String[] {Table_Tasks.Event_ID}, new String[] {Event_ID}, null); // Delete chat. sqlHelper.Delete_Table(Table_Chat.Table_Name + Helper.Clean_Event_ID(Event_ID)); // Delete vote_date. sqlHelper.delete( Table_Vote_Date.Table_Name, new String[] {Table_Vote_Date.Event_ID}, new String[] {Event_ID}, null); // Delete vote_location. sqlHelper.delete( Table_Vote_Location.Table_Name, new String[] {Table_Vote_Location.Event_ID}, new String[] {Event_ID}, null); }
public void verifyPageText(boolean testType) { if (testType == true) { Helper.compareContains( testConfig, "Success Response text verification", "Congratulations", getSuccessresponseMessage()); Helper.compareTrue(testConfig, "Success response Message", successResponse.isDisplayed()); } else if (testType == false) { Helper.compareContains( testConfig, "Failure Response text verification", "Transaction Failed", getFailresponseMessage()); Helper.compareTrue(testConfig, "Failure response Message", failResponse.isDisplayed()); } }
public static void Delete_Event_ServerSQL(Context context, String Event_ID) { // Delete event. new Event_AsyncTask_delete(context).execute(Event_ID); // Delete event_user. new EventUser_AsyncTask_delete_by_event(context).execute(Event_ID); // Delete tasks. new Task_AsyncTask_deleteByEvent(context).execute(Event_ID); // Delete chat. String Chat_ID = Table_Chat.Table_Name + Helper.Clean_Event_ID(Event_ID); new Chat_AsyncTask_deleteByEvent(context).execute(Chat_ID); // Delete vote_date. new Vote_Date_AsyncTask_deleteByEvent(context).execute(Event_ID); // Delete vote_location. new Vote_Location_AsyncTask_deleteByEvent(context).execute(Event_ID); }
/** * 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")); }
// ----------------------------------------------My SQL // Functions------------------------------------------------ private static void Create_Event_MySQL() { // create event. sqlHelper.insert(Table_Events.Table_Name, Event_Helper.details); // Add My user. sqlHelper.insert( Table_Events_Users.Table_Name, new String[] { Event_Helper.details[Table_Events.Event_ID_num], Constants.MY_User_ID, Constants.Yes, Constants.Owner }); // Add all friends. for (String User_ID : Event_Helper.friends.keySet()) { Friend_Helper friend_helper = Event_Helper.friends.get(User_ID); add_newFriend_MySQL(friend_helper, User_ID); } // Add tasks. for (int task_id : Event_Helper.task.keySet()) { Task_Helper task_helper = Event_Helper.task.get(task_id); add_newTask_MySQL(task_helper, task_id, 0); // Add all subTasks. for (int subTask_id : task_helper.getSubTasks().keySet()) { add_newTask_MySQL(task_helper, task_id, subTask_id); } } // Create Chat table. String Chat_ID = Table_Chat.Table_Name + Helper.Clean_Event_ID(Event_Helper.details[Table_Events.Event_ID_num]); sqlHelper.Create_Table(Chat_ID, Table_Chat.getAllFields(), Table_Chat.getAllSqlParams()); // Add vote_date. for (int vote_id : Event_Helper.vote_date.keySet()) { Vote_Date_Helper vote_date_helper = Event_Helper.vote_date.get(vote_id); add_newVote_Date_Option_MySQL(vote_date_helper, vote_id); } // Add vote_location. for (int vote_id : Event_Helper.vote_location.keySet()) { Vote_Location_Helper vote_location_helper = Event_Helper.vote_location.get(vote_id); add_newVote_Location_Option_MySQL(vote_location_helper, vote_id); } }
/** * Verifies Notification text displayed on the top of page * * @param NotificationText */ public void verifyNotificationText(String NotificationText) { Browser.waitForPageLoad(testConfig, AlertNotification); Helper.compareEquals( testConfig, "Alert Notification", NotificationText, AlertNotification.getText()); Browser.wait(testConfig, 10); }
public void verifyCCValidations(String[] fieldsToValidate) { for (String fieldToValidate : fieldsToValidate) { switch (fieldToValidate) { case "CCNUMBER": Helper.compareEquals( testConfig, "CC invalid card", strTextBoxerrorClass, creditCardNumber.getAttribute("class")); break; case "CCNAME": Helper.compareEquals( testConfig, "CC invalid name on card", strTextBoxerrorClass, creditCardName.getAttribute("class")); break; case "CCCVV": Helper.compareEquals( testConfig, "CC invalid CVV", strTextBoxerrorClass, creditCardCvvNo.getAttribute("class")); break; case "CCEXP": Helper.compareEquals( testConfig, "CC invalid Expiry month", "ExpiryMonth textbox validate error", creditCardExpiryMonth.getAttribute("class")); Helper.compareEquals( testConfig, "CC invalid Expiry year", "ExpiryYear textbox validate error", creditCardExpiryYear.getAttribute("class")); break; default: Helper.compareEquals( testConfig, "CC invalid card", strTextBoxerrorClass, creditCardNumber.getAttribute("class")); Helper.compareEquals( testConfig, "CC invalid name on card", strTextBoxerrorClass, creditCardName.getAttribute("class")); Helper.compareEquals( testConfig, "CC invalid CVV", strTextBoxerrorClass, creditCardCvvNo.getAttribute("class")); Helper.compareEquals( testConfig, "CC invalid Expiry month", "ExpiryMonth textbox validate error", creditCardExpiryMonth.getAttribute("class")); Helper.compareEquals( testConfig, "CC invalid Expiry year", "ExpiryYear textbox validate error", creditCardExpiryYear.getAttribute("class")); break; } } }
// ----------------------------------------------Server SQL // Functions---------------------------------------------- public static void Create_Event_ServerSQL(Context context) { // new Event_AsyncTask_insert(context).execute(Event_ID, Name, Location, Start_Date, Start_Time, // End_Date, End_Time, Description, ImagePath, Update_Time); // create event. new Event_AsyncTask_insert(context).execute(Event_Helper.details); // Add My user. new EventUser_AsyncTask_insert(context) .execute( Event_Helper.details[Table_Events.Event_ID_num], Constants.MY_User_ID, Constants.Yes, Constants.Owner); // Add all friends. for (String User_ID : Event_Helper.friends.keySet()) { Friend_Helper friend_helper = Event_Helper.friends.get(User_ID); new EventUser_AsyncTask_insert(context) .execute( Event_Helper.details[Table_Events.Event_ID_num], User_ID, friend_helper.getAttending(), friend_helper.getPermission()); } // Add tasks for (int task_id : Event_Helper.task.keySet()) { Task_Helper task_helper = Event_Helper.task.get(task_id); new Task_AsyncTask_insert(context) .execute( Event_Helper.details[Table_Events.Event_ID_num], task_id + "", 0 + "", task_helper.getType(), task_helper.getDescription(), task_helper.getUser_ID()); // Add all subTasks. for (int subTask_id : task_helper.getSubTasks().keySet()) { new Task_AsyncTask_insert(context) .execute( Event_Helper.details[Table_Events.Event_ID_num], task_id + "", subTask_id + "", task_helper.getType(), task_helper.getSubTasks().get(subTask_id)[0], task_helper.getUser_ID()); } } // Create Chat table. String Chat_ID = Table_Chat.Table_Name + Helper.Clean_Event_ID(Event_Helper.details[Table_Events.Event_ID_num]); new Chat_AsyncTask_CreateByEvent(context).execute(Chat_ID); // Add vote_dates. for (int vote_id : Event_Helper.vote_date.keySet()) { Vote_Date_Helper vote_date_helper = Event_Helper.vote_date.get(vote_id); new Vote_Date_AsyncTask_insert(context) .execute( Event_Helper.details[Table_Events.Event_ID_num], vote_id + "", vote_date_helper.getStart_Date(), vote_date_helper.getEnd_Date(), vote_date_helper.getAll_Day(), vote_date_helper.getStart_Time(), vote_date_helper.getEnd_Time(), Constants.UnCheck); } // Add vote_dates. for (int vote_id : Event_Helper.vote_location.keySet()) { Vote_Location_Helper vote_location_helper = Event_Helper.vote_location.get(vote_id); new Vote_Location_AsyncTask_insert(context) .execute( Event_Helper.details[Table_Events.Event_ID_num], vote_id + "", vote_location_helper.getDescription(), Constants.UnCheck); } }