コード例 #1
0
        public void removeSpeaker()
        {
            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;

            //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
            eventHelper.WaitForWorkArround(3000);

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

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

            //clcik on event home
            eventHelper.ClickElement("eventhome");

               //verify page text
            eventHelper.WaitForTextInPage(EventName,30);

            //click on instructors
            eventHelper.ClickElement("instructors");

            //verify page text
            eventHelper.WaitForTextInPage(EventName, 30);

            //click on manage abs
            eventHelper.ClickElement("manageabs");

            //verify title
            verifyTitle("Abstracts");

            //click on new
            eventHelper.ClickElement("newabs");

            //verify title
            verifyTitle("Create New Abstract");

            //enter title
            eventHelper.type("inputtitle", "abs1");

            //enter length
               // eventHelper.SelectValueFilter("inputlength", "60 min");

            //enter level
            //eventHelper.SelectValueFilter("inputlevel", "100");

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

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

            //click on submit
            eventHelper.ClickElement("submitabs");

            //wait
            eventHelper.WaitForWorkArround(5000);

            //verify title
            verifyTitle("Abstracts");

            //verify abstract name
            eventHelper.WaitForTextInPage("abs1", 30);

            //click on ins
            eventHelper.ClickElement("instructoradmin");

            //click on submissions
            eventHelper.ClickElement("submissions");

            //verify title
            verifyTitle("Abstracts");

            //verify abstract name
            eventHelper.WaitForTextInPage("abs1", 30);

            //clcick on accept
            eventHelper.ClickElement("accept");

            //verify abstract name
            eventHelper.WaitForTextInPage("abs1", 30);

            //scroll
            eventHelper.scrollToElement("eventscheduling");
            //clcik on event home
            eventHelper.ClickElement("eventscheduling");

            //click on rooms
            eventHelper.ClickElement("Rooms");

            //verify title rooms
            verifyTitle("Rooms");

            //wait
            eventHelper.WaitForWorkArround(3000);

            //click on new button
            eventHelper.ClickElement("newroom");
            //wait
            eventHelper.WaitForWorkArround(3000);

            //enter room name
            eventHelper.type("roomname", "room1");

            //enter room description
            eventHelper.type("roomdescription", "room1");

            //click on create button
            eventHelper.ClickElement("createroom");

            //verify title
            verifyTitle("Rooms");

            //verify room name on page
            eventHelper.WaitForTextInPage("room1", 30);

            //click on schedule
            eventHelper.ClickElement("schedule");

            //verify title
            verifyTitle("Schedule");

            //abs name on page
            eventHelper.WaitForTextInPage("room1", 30);

            string file = GetPathtoUpload() + "Test.exe";

            System.Diagnostics.Process.Start(file);
            Thread.Sleep(3000);
            //scroll
            eventHelper.scrollToElement("saveschedule");

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

            //wait
            eventHelper.WaitForWorkArround(3000);

            //verify title
            verifyTitle("Schedule");

            //clcik on speakers
            eventHelper.ClickElement("instructoradmin");

            //wait
            eventHelper.WaitForWorkArround(3000);

            //clcik on speaker list
            eventHelper.ClickElement("speakerlist");

            //wait
            eventHelper.WaitForWorkArround(2000);

            //verify title
            verifyTitle("Speakers List");

            //click on remove button
            eventHelper.ClickElement("removespeaker");

            //accept alet
            eventHelper.acceptAlert();

            //wait
            eventHelper.WaitForWorkArround(6000);

            //verify title
            verifyTitle("Speakers List");

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

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

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