Ejemplo n.º 1
0
        public void editEvent()
        {
            string username = "";
            string[] password = null;

            XMLParse oXMLData = new XMLParse();
            oXMLData.LoadXML("../../Config/ApplicationSetting.xml");
            loginHelper = new AttendeeLoginHelper(GetWebDriver());
            eventHelper = new EventHelper(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;

            int Startdate1 = GetTodayDate() + 3;
            int Enddate1 = GetTodayDate() + 5;

            String StartDate = Int16.Parse(GetCurrentMonth()) + "/" + Startdate.ToString() + "/" + GetCurrentYear();
            Console.WriteLine("StartDate");

            //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("Eventinfo");

            //scroll to element
            //eventHelper.ScrollDown("Eventdetails");

            //click on event details
            eventHelper.ClickElement("Eventdetails");

            //verify title
            verifyTitle("Edit");

            //wait
            eventHelper.WaitForWorkArround(5000);

            //verify previous title
            eventHelper.verifyfieldText("EventTitle", EventName);

            //verify address
            eventHelper.verifyfieldText("VenueName", "Noida");

            //verify address
            eventHelper.verifyfieldText("Address1", "Sector");

            //verify address
            eventHelper.verifyfieldText("Address2", "70");

            //verify city
            eventHelper.verifyfieldText("City", "Noida");

            //verify starting date
            eventHelper.verifyfieldText("StartDate", StartDate);

            string Editevent = "Edit" + GetRandomNumber();

            //enter new event title
            eventHelper.type("EventTitle", Editevent);

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

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

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

            //Enter New City
            eventHelper.type("City", "Noida1");

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

            //Enter New Zip
            eventHelper.type("Zip", "201906");

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

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

            //scroll to element
            eventHelper.scrollToElement("Editsave");

            //click on save
            eventHelper.performClick("Editsave");

            //verify page title
            verifyTitle("Event List");

            //wait
            eventHelper.WaitForWorkArround(5000);

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

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

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

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