コード例 #1
0
ファイル: Common.cs プロジェクト: hemap/PhoenixAutomationRepo
        /// <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 AgeVerification(ISelenium adminBrowser, string cardNum, string issueNum, string CustomerName)
        {
            try
            {
                Framework.Common.Common FrameWKCommon = new Framework.Common.Common();
                //Click on Customer Verification button
                if (!AdminTableObjects(adminBrowser, "Customer attributes", "", "Button", "Customer Verification", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to click on Customer Verification button in Customer attributes table");
                    return false;
                }

                Assert.IsTrue(adminBrowser.IsElementPresent(AdminSuite.CommonControls.AdminHomePage.custVerifyCountry), "Unable to find country select box in customer verify page");
                Assert.IsTrue(adminBrowser.IsElementPresent("//input[@type='radio' and @value = 'A']"), "Unable to find country select box in customer verify page");

                adminBrowser.Click("//input[@type='radio' and @value = 'A']");

                //Entering value in OVS Score: Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "OVS Score", "Text Box", "100", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in OVS Score Text box in Manually Verify Customer page");
                    return false;
                }

                //Entering value in Reference: Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "Reference", "Text Box", "100", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Reference Text box in Manually Verify Customer page");
                    return false;
                }

                //Entering value in Notes Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "Notes", "Text Box", "Notes", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Notes Text box in Manually Verify Customer page");
                    return false;
                }

                Assert.IsTrue(adminBrowser.IsElementPresent("//input[@type='radio' and @value = 'A']"), "Unable to find country select box in customer verify page");
                adminBrowser.Click("//input[@type='radio' and @value = 'A']");

                //Entering value in Driving Licence No Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "Driving Licence No", "Text Box", "Notes", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Driving Licence No Text box in Manually Verify Customer page");
                    return false;
                }

                //Click on Add Payment Method button
                if (!AdminTableObjects(adminBrowser, "Add payment method", "", "Button", "Add Payment Method", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable click on Add Payment Method button in New Payment Method page");
                    return false;
                }

                adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                Thread.Sleep(5000);
                Console.WriteLine("Successfully added payment method for customer");
                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                return false;
            }
        }
コード例 #2
0
ファイル: Common.cs プロジェクト: hemap/PhoenixAutomationRepo
        /// <summary>
        /// To suspend/ Activate the Events
        /// </summary>
        /// <param name="browser">Selenium browser instance</param>
        /// <param name="catName">Category Name</param>
        /// <param name="eventClsName">Event ClassName</param>
        /// <param name="eventTypeName">Event TypeName</param>
        /// <param name="eventSubType">Event SubType</param>
        /// <param name="eventName">Event Name</param>
        /// <param name="eventStatus">Event Status</param>
        public void UpdateEvents(ISelenium browser, string catName, string eventClsName, string eventTypeName, string eventSubType, string eventName, string eventStatus)
        {
            string errorMessage = "";
            bool eventUpdationStatus = false;
            bool finalEventStatus = true;
            Framework.Common.Common frameworkcommon = new Framework.Common.Common();
            AdminSuite.Common com = new AdminSuite.Common();
            Framework.Common.Common Fcommon = new Framework.Common.Common();

            TimeSpan ts = new TimeSpan(0, 1, 0);
            IWebDriver driver = ((WebDriverBackedSelenium)browser).UnderlyingWebDriver;

            //Clicking on Event Link in LHN
            LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
            //Selecting TopFrame
            System.Threading.Thread.Sleep(10000);
            SelectMainFrame(browser);

            frameworkcommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, "60");
            catName = catName.Replace("|", "").Trim();
            if (catName != "")
            {
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx))
                {
                    Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, catName), "Category Name does not present in DropdownList");
                    browser.Select(AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, "label=" + catName);
                }
            }
            eventClsName = eventClsName.Replace("|", "").Trim();

            if (eventClsName != "")
            {
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.classNameLstBx))
                {
                    Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.classNameLstBx, eventClsName), "EventClass Name does not present");
                    browser.Select(AdminSuite.CommonControls.EventDetailsPage.classNameLstBx, "label=" + eventClsName);
                }
            }
            if (eventTypeName != "")
            {
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx))
                {
                    Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx, eventTypeName), "EventClass Name does not present");
                    browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx, "label=" + eventTypeName);
                }
            }
            if (eventSubType != "")
            {
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.subEventTypeLstBx))
                {
                    Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.subEventTypeLstBx, eventSubType), "EventSubType Name does not present");
                    browser.Select(AdminSuite.CommonControls.EventDetailsPage.subEventTypeLstBx, "label=" + eventSubType);
                }
            }
            Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.dateRangeLstBx, "--"), "Date range dropdown missing");

            // Selecting Daterange
            if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.dateRangeLstBx))
            {
                browser.Select(AdminSuite.CommonControls.EventDetailsPage.dateRangeLstBx, "label=--");
            }
            //Clicking on Seach button
            browser.Click(AdminSuite.CommonControls.EventDetailsPage.eventSearchBtn);
            _frameworkCommon.WaitUntilAllElementsLoad(browser);
            browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
            //Thread.Sleep(2000);
            // Wait for Element to present

            if (frameworkcommon.WaitUntilElementPresent(browser, "link=" + eventName + "", "60") == true)
            {
                browser.Click("link=" + eventName);
                browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                if (eventStatus == "Taginfo" || eventStatus == "Taginfoundo")
                {
                    browser.Click("//a[contains(string(),'Race Winner')]");
                    Thread.Sleep(10000);
                    browser.Click("//tr[@class='active']//a[contains(string(),'Horse1')]");
                    Thread.Sleep(10000);
                    if (eventStatus == "Taginfoundo")
                        browser.Select("name=OcFlag", "label=Named runner");
                    else
                        browser.Select("name=OcFlag", "label=Unnamed favourite");

                    browser.Click("//input[@value='Modify Selection']");
                }
                else
                {
                    //Wait Untill the EventDetails Page loads
                    if (frameworkcommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "60") == true)
                    {
                        if (eventStatus == "Suspend")
                        {
                            browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventStatusListBox, "label=Suspended");
                            eventUpdationStatus = false;
                            browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                        }
                        else
                        {
                            browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventStatusListBox, "label=Active");
                        }

                        //Updating the Event
                        if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn))
                        {
                            if (eventUpdationStatus == false)
                            {
                                browser.Click(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn);
                                browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                                Assert.IsTrue(frameworkcommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "120"), "Event Updation is not Successfull");
                            }

                        }
                    }
                }
            }

            else
            {
                finalEventStatus = false;
                errorMessage = errorMessage + eventName;
                errorMessage = errorMessage + Environment.NewLine;
            }

            //Finally checking whether all the Events are Suspended or not
            if (finalEventStatus == false)
            {
                Console.WriteLine("Following Events are not Suspended, Please verify Manually" + Environment.NewLine + errorMessage);
                Framework.BaseTest.Fail("Event suspending Process is Failed");
            }
        }
コード例 #3
0
ファイル: Common.cs プロジェクト: hemap/PhoenixAutomationRepo
        /// <summary>
        /// To Update Markt  Status
        /// </summary>
        /// <param name="browser">Selenium browser instance</param>
        /// <param name="catName">Category Name</param>
        /// <param name="eventClsName">Event ClassName</param>
        /// <param name="eventTypeName">Event TypeName</param>
        /// <param name="eventSubType">Event SubType</param>
        /// <param name="eventName">Event Name</param>
        /// <param name="eventStatus">Event Display Status</param>
        public void UpdateMarketStatus(ISelenium browser, string catName, string eventClsName, string eventTypeName, string eventSubType, string eventName, string mktName, string marketStatus)
        {
            string errorMessage = "";
            bool eventUpdationStatus = false;
            bool finalEventStatus = true;
            Framework.Common.Common frameworkcommon = new Framework.Common.Common();
            AdminSuite.Common com = new AdminSuite.Common();
            Framework.Common.Common Fcommon = new Framework.Common.Common();

            TimeSpan ts = new TimeSpan(0, 1, 0);
            IWebDriver driver = ((WebDriverBackedSelenium)browser).UnderlyingWebDriver;

            //Clicking on Event Link in LHN
            LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
            //Selecting TopFrame
            SelectMainFrame(browser);
            System.Threading.Thread.Sleep(10000);

            frameworkcommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, "60");
            catName = catName.Replace("|", "").Trim();
            if (catName != "")
            {
                Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, catName), "Category Name does not present in DropdownList");
                browser.Select(AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, "label=" + catName);
            }
            eventClsName = eventClsName.Replace("|", "").Trim();

            if (eventClsName != "")
            {
                Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.classNameLstBx, eventClsName), "EventClass Name does not present");
                browser.Select(AdminSuite.CommonControls.EventDetailsPage.classNameLstBx, "label=" + eventClsName);
            }
            if (eventTypeName != "")
            {
                Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx, eventTypeName), "EventClass Name does not present");
                browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx, "label=" + eventTypeName);
            }
            Assert.IsTrue(frameworkcommon.CheckItemPresentInDropDownList(browser, AdminSuite.CommonControls.EventDetailsPage.dateRangeLstBx, "--"), "Date range dropdown missing");

            // Selecting Daterange
            browser.Select(AdminSuite.CommonControls.EventDetailsPage.dateRangeLstBx, "label=--");

            //Clicking on Seach button
            browser.Click(AdminSuite.CommonControls.EventDetailsPage.eventSearchBtn);
            _frameworkCommon.WaitUntilAllElementsLoad(browser);
            browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);

            // Wait for Element to present
            if (frameworkcommon.WaitUntilElementPresent(browser, "link=" + eventName + "", "60") == true)
            {
                browser.Click("link=" + eventName);
                browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                Thread.Sleep(10000);
                //Wait Untill the EventDetails Page loads
                if (frameworkcommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "60") == true)
                {

                    if (frameworkcommon.WaitUntilElementPresent(browser, "link=" + "|" + mktName + "|" + "", "60") == true)
                    {
                        //browser.Click("link=" + mktName);
                        browser.Click("link=" + "|" + mktName + "|");
                        browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);

                        if (marketStatus == "Suspend")
                        {
                            browser.Select(AdminSuite.CommonControls.EventDetailsPage.marketStatusListBox, "label=Suspended");
                            eventUpdationStatus = false;
                            browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                        }
                        else
                        {
                            browser.Select(AdminSuite.CommonControls.EventDetailsPage.marketStatusListBox, "label=Active");
                        }

                        //Updating the Event
                        if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton))
                        {
                            if (eventUpdationStatus == false)
                            {
                                browser.Click(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton);
                                browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                                Assert.IsTrue(frameworkcommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "120"), "markrt display status Updation is not Successfull");
                                browser.Click(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn);
                                browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                            }
                        }
                    }
                }
            }
            else
            {
                finalEventStatus = false;
                errorMessage = errorMessage + eventName;
                errorMessage = errorMessage + Environment.NewLine;
            }

            //Finally checking whether all the Events are Suspended or not
            if (finalEventStatus == false)
            {
                Framework.BaseTest.Fail("market display status updation Process is Failed");
            }
        }
コード例 #4
0
ファイル: Common.cs プロジェクト: hemap/PhoenixAutomationRepo
 /// <Summary>
 /// Show all Horse Racing Events that starts "Tomorrow"
 /// Author: Aswathy 
 /// Created Date: Apr-19-2013
 /// </Summary>
 public void ShowTomoHorseRacingEvents(ISelenium adminBrowser)
 {
     Framework.Common.Common frameworkcommon = new Framework.Common.Common();
     //Clicking on Event Link in LHN
     LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, adminBrowser);
     //Selecting TopFrame
     SelectMainFrame(adminBrowser);
     System.Threading.Thread.Sleep(10000);
     adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.categoryNameLstBx, "label=RACING");
     adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.classNameLstBx, "label=Horse Racing");
     // adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.eventTypeLstBx, "label=" + eventTypeName);
     // adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.subEventTypeLstBx, "label=" + eventSubType);
     adminBrowser.Select(AdminSuite.CommonControls.EventDetailsPage.dateRangeLstBx, "label=Tomorrow");
     adminBrowser.Select("name=status", "label=Active");
     adminBrowser.Click(AdminSuite.CommonControls.EventDetailsPage.showEventBtn);
     adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
 }