/// <summary> /// Adding a Reward Adhoc token to customer in Admin. /// </summary> /// Date Created: /// Author: Anand C /// User should be login to Admin application /// <param name="adminBrowser">Browser Instance</param> /// <param name="custName">Customer name for whom the token be added</param> /// <param name="tokenVal">token value to be added</param> public bool AdminDeleteFBlist(ISelenium adminBrowser, string custName) { try { IWebDriver driver = ((WebDriverBackedSelenium)adminBrowser).UnderlyingWebDriver; //Verifying freebet link in customer detail page adminBrowser.Highlight("//table//th/font[contains(text(),'Account information')]//ancestor::table//td[contains(text(),'Free bet tokens (open):')]/following-sibling::td/a"); if (adminBrowser.IsElementPresent("//table//th/font[contains(text(),'Account information')]//ancestor::table//td[contains(text(),'Free bet tokens (open):')]/following-sibling::td/a")) { adminBrowser.Click("//table//th/font[contains(text(),'Account information')]//ancestor::table//td[contains(text(),'Free bet tokens (open):')]/following-sibling::td/a"); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); ReadOnlyCollection<IWebElement> chkBoxs = driver.FindElements(By.XPath("//table//input[@type='checkbox']")); //check all the check box for (int chkBoxCount = 0; chkBoxCount < chkBoxs.Count; chkBoxCount++) { chkBoxs[chkBoxCount].Click(); } //click on the Delete Token button if (!AdminTableObjects(adminBrowser, "Free Token List", "", "Button", "Delete Token", 1)) { Framework.BaseTest.CaptureScreenshot(adminBrowser, ""); Console.WriteLine("Unable click on Find Customer button in Customer Search page"); return false; } Thread.Sleep(3000); if (adminBrowser.IsElementPresent("//table//th[contains(string(),'Account information')]//ancestor::table//td[contains(text(),'" + "Free bet tokens (open):" + "')]/following-sibling::td/a")) { return false; } } Console.WriteLine("Successfully deleted the FreeBets for customer"); return true; } catch (Exception ex) { Console.WriteLine(ex.Message); Framework.BaseTest.CaptureScreenshot(adminBrowser, ""); return false; } }
/// <summary> /// Restricting the customer for placing bets /// </summary> /// Author : Hemalatha /// Date Created : 11-07-2012 /// Pre-conditions : User should logged into the admin /// <param name="adminBrowser">browser instance</param> /// <param name="custName">Customer Name</param> /// <param name="reasonDesc">Reason for restricting the customer</param> /// <returns></returns> public bool AddCustFlag(ISelenium adminBrowser, string custName, string reasonDesc, string flagName) { try { if (AdminSearchCustomer(adminBrowser, custName) == true) { //Click on the Amend Status Flag Button if (!AdminTableObjects(adminBrowser, "Customer attributes", "", "Button", "Amend Status Flags", 1)) { Framework.BaseTest.CaptureScreenshot(adminBrowser, ""); Console.WriteLine("Unable to click on the Amend Status Flags button in Customer detail page"); return false; } //select Customer Status Flag if (!AdminTableObjects(adminBrowser, "Add Customer Status Flag", "Customer Status Flag", "Select Box", flagName, 1)) { Framework.BaseTest.CaptureScreenshot(adminBrowser, ""); Console.WriteLine("Unable to click on the Customer Status Flags button in Customer detail page"); return false; } //Entering reason for adding the flag string reason = "//table[contains(string(),'Add Customer Status Flag')]//tr[contains(string(),'Reason Description')]/td/textarea[@name='reason']"; adminBrowser.Highlight(reason); adminBrowser.Type(reason, reasonDesc); //Clicking the Add Status Flag button string statusFlagButton = "//input[@value='Add Status Flag']"; adminBrowser.Click(statusFlagButton); } Console.WriteLine("Successfully restricted the customer for bets"); return true; } catch (Exception e) { Console.WriteLine(e.Message); Framework.BaseTest.CaptureScreenshot(adminBrowser, ""); return false; } }
/// <Summary> /// Create Horse Racing event of Place Betting Type /// Author: Aswathy /// Created Date: Apr-26-2013 /// </Summary> /// public string CreateEvent(ISelenium adminBrowser, string eventCategory, string eventClass, string eventType, string eventSubType, string eventName) { try { adminBrowser = LogOnToAdmin(); // Click on Event Link in LHN LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, adminBrowser); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); SelectMainFrame(adminBrowser); if (eventCategory != "") { adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, "label=" + eventCategory); } if (eventClass != "") { adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.classNameLstBx, "label=" + eventClass); } if (eventType != "") { adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx, "label=" + eventType); } if (eventSubType != "") { adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.subEventTypeLstBx, "label=" + eventSubType); } adminBrowser.Click(AdminSuite.CommonControls.EventDetailsPage.addEventBtn); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); DateTime date = DateTime.Now.AddHours(24); int appendVal = DateTime.Now.Minute; string eventStartDate = date.ToString("yyyy-MM-dd hh:mm:ss"); adminBrowser.Type(AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, eventName + appendVal + " "); adminBrowser.Type(AdminSuite.CommonControls.EventDetailsPage.StartTimetxtBox, eventStartDate); adminBrowser.Highlight(AdminSuite.CommonControls.EventDetailsPage.addEventBtn); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); adminBrowser.Click(AdminSuite.CommonControls.EventDetailsPage.addEventMarketBtn); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.mktDisplayStatusLstBox, "label=Yes"); adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.marketEWAvailLstBox, "label=Yes"); adminBrowser.Type("//input[@name='MktEWPlaces']", "2"); adminBrowser.Type("//input[@name='MktEWFacNum']", "1"); adminBrowser.Type("//input[@name='MktEWFacNum']", "4"); adminBrowser.Select("//select[@name='MktPLAvail']", "label=Yes"); adminBrowser.Click(AdminSuite.CommonControls.EventDetailsPage.addMarketBtn); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); int i; string[] selectionName = { "S1", "S2", "S3" }; string[] price = { "1.25", "1.50", "1.75" }; for (i = 0; i < 3; i++) { adminBrowser.Click(AdminSuite.CommonControls.EventDetailsPage.addMarketSelectionBtn); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); adminBrowser.Type(AdminSuite.CommonControls.EventDetailsPage.selectionDescTxtBox, selectionName[i]); adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.SelectionDispStatusListBx, "label=Yes"); adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.SelectionStatusLstBx, "label=Active"); adminBrowser.Type(AdminSuite.CommonControls.EventDetailsPage.PriceTxtBx, price[i]); adminBrowser.Click(AdminSuite.CommonControls.EventDetailsPage.addSelectionBtn); adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); } return (eventName + appendVal); } catch (Exception ex) { CaptureScreenshot(adminBrowser, ""); Console.WriteLine(ex); return null; } }