Esempio n. 1
0
        public void buyTicket()
        {
            string[] username = null;
            string[] password = null;
            string[] newusername = null;

            XMLParse oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSetting.xml");
            loginHelper = new AttendeeLoginHelper(GetWebDriver());
            eventHelper = new EventHelper(GetWebDriver());
            ticketHelper = new TicketHelper(GetWebDriver());

            username = oXMLData.getData("settings/credentials", "AttendeeUsername");
            password = oXMLData.getData("settings/credentials", "AttendeePassword");
            newusername = oXMLData.getData("settings/credentials", "Username");

            //Wait for text
            loginHelper.WaitForTextInPage("Use your email to sign in.", 40);

            //Verify Page title
            verifyTitle("Attendee.Events - Log in");

            //Login with email address
            Login(username[0], password[0]);
            Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

            //Click on sigin button
            loginHelper.ClickElement("Signin");

            //Verify Page title
            verifyTitle("Event List");

               // String Eventname = ticketHelper.GetText("FirstEvent");

            //Open first event
            ticketHelper.ClickElement("FirstEvent");

            //wait for text
            ticketHelper.WaitForTextInPage("Total:",30);

            //Click on register tab
            ticketHelper.clickLastElement("RegisterTab");

            //Click on Ticketting
            ticketHelper.ClickElement("Ticketting");

            //Wait for text
            ticketHelper.WaitForTextInPage("New Free Ticket", 30);

            //Click on New Free ticket
            ticketHelper.verifyticket("FreeTicket");

            //Click on home tab
            ticketHelper.ClickElement("HomeTab");

            //Click on user-id
            ticketHelper.ClickElement("LogOff");

            //Wait for text
            ticketHelper.WaitForTextInPage("Log in", 30);

            //Go to registration page
            ticketHelper.ClickElement("Register");

            //Click on Login link
            ticketHelper.ClickElement("Login");

            //Login into the application
            Login(newusername[0],password[0]);

            //Click on sign in button
            loginHelper.ClickElement("Signin");

            //wait for text
            ticketHelper.WaitForTextInPage(newusername[0],30);

            //Go to registration page
            ticketHelper.ClickElement("Register");

            //Enter Quantity of ticket
            ticketHelper.type("QuanTicket", "2");

            //Click on Buy now button
            ticketHelper.performClick("GetRegister");

            //Wait for text
            ticketHelper.WaitForTextInPage("Submit Registration", 20);

            //Click on Submit registration
            ticketHelper.performClick("SubmitRegistration");

            //wait for text
            ticketHelper.WaitForTextInPage("Ticket", 60);

            //verify status
            ticketHelper.WaitForTextInPage("Status:", 20);

            //
            ticketHelper.WaitForTextInPage("approved", 30);

            //Capture screenshot fot the screen
            loginHelper.TakeScreenshot("BuyTicket - Attendee");
        }
        public void myTicketsPage()
        {
            string username = "";
            string[] password = null;

            XMLParse oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSetting.xml");
            loginHelper = new AttendeeLoginHelper(GetWebDriver());
            eventHelper = new EventHelper(GetWebDriver());
            ticketHelper = new TicketHelper(GetWebDriver());

            username = loginHelper.GetFromFile("Register");
            password = oXMLData.getData("settings/credentials", "AttendeePassword");

            String EventName = "Test_Event" + AlwaysRandom();
            String EventURL = URL + "/" + EventName + "/E/";

            int Startdate = GetTodayDate()+1;
            int Enddate = GetTodayDate() + 2;

            //Wait for text
            loginHelper.WaitForTextInPage("Use your email to sign in.", 40);

            //Verify Page title
            verifyTitle("Attendee.Events - Log in");

            //Login with email address
            Login(username, password[0]);
            Console.WriteLine("Logged in as: " + username + " / " + password[0]);

            //Click on sigin button
            loginHelper.ClickElement("Signin");

            //Verify Page title
            verifyTitle("Event List");

            //CLick on Event dropdown.
            eventHelper.ClickElement("EventDropdown");

            //Click on Create new event
            eventHelper.ClickElement("CreateNewEvent");

            //wait for text
            eventHelper.WaitForTextInPage("Event Type", 20);

            //Verify title
            verifyTitle("Create");

            //Select Event type
            eventHelper.SelectValueFilter("EventType", "Conference");

            //Enter Event title
            eventHelper.type("EventTitle", EventName);

            //Click on Manual Location
            eventHelper.ClickElement("ManualLocation");

            //Enter Venue
            eventHelper.type("VenueName", "Noida");

            //Enter Address 1
            eventHelper.type("Address1", "Sector");

            //Enter Adresss 2
            eventHelper.type("Address2", "70");

            //Enter City
            eventHelper.type("City", "Noida");

            //Enter State
            eventHelper.type("State", "UP");

            //Enter Zip
            eventHelper.type("Zip", "201301");

            //Enter Start Date
            eventHelper.SelectDate("StartDate", Startdate.ToString());

            //Enter End Date
            eventHelper.SelectDate("EndDate", Enddate.ToString());

            //Write Description
            eventHelper.typeDescription(0, "This is test description");

            //Click on 'Create Event button.
            eventHelper.ClickElement("Create");

            //wait for text
            eventHelper.WaitForTextInPage("No sales", 30);

            //Verify title
            verifyTitle(EventName + " - Dashboard");

            //click on event info
            eventHelper.ClickElement("eventregistration");

            //click on ticket
            eventHelper.ClickElement("ticketing");

            //verify title
            verifyTitle("Ticketing");

            //click on free ticket
            eventHelper.ClickElement("newfreeticket");

            //wait
            eventHelper.WaitForWorkArround(2000);

            //input name
            eventHelper.typeInLastElement("TicketName", "free1");

            //input quantity
            eventHelper.typeInLastElement("Quantity", "10");

            //click on save
            eventHelper.ClickElement("saveticket");

            //wait
            eventHelper.WaitForWorkArround(3000);

            //Click on home tab
            ticketHelper.ClickElement("HomeTab");

            //wait
            eventHelper.WaitForWorkArround(3000);

            //Go to registration page
            ticketHelper.ClickElement("Register");

            //wait
            eventHelper.WaitForWorkArround(8000);

            //Enter Quantity of ticket
            ticketHelper.type("QuanTicket", "2");

            //Click on Buy now button
            ticketHelper.performClick("GetRegister");

            //Wait for text
            ticketHelper.WaitForTextInPage("Submit Registration", 20);

            //scroll
            ticketHelper.scrollToElement("SubmitRegistration");

            //wait
            ticketHelper.WaitForWorkArround(3000);

            //Click on Submit registration
            ticketHelper.performClick("SubmitRegistration");

            //wait
            eventHelper.WaitForWorkArround(3000);

            //wait for text
            ticketHelper.WaitForTextInPage("Quantity", 60);

            //wait
            eventHelper.WaitForWorkArround(3000);

            //verify status
            ticketHelper.WaitForTextInPage("Status:", 20);

            //
            ticketHelper.WaitForTextInPage("approved", 30);

            //wait
            eventHelper.WaitForWorkArround(3000);

            //click on my tickets
            eventHelper.ClickElement("mytickets");

            //title
            verifyTitle("My Tickets");

            //event name on page
            eventHelper.WaitForTextInPage(EventName, 30);

            //Click on user-id
            loginHelper.ClickElement("ClickId");

            //Logout from the application.
            loginHelper.ClickElement("LogOut");

            //Capture screenshot fot the screen
            loginHelper.TakeScreenshot("CreateEvent - Attendee");
        }