Ejemplo n.º 1
0
        private string CreateIdea(DataModel firstRow)
        {
            loginPage = new LoginPage(this.Driver, this.CurrentTest);
            string loginPageTitle = loginPage.GetLoginTitle();

            //Verify login page title
            Assert.AreEqual(loginPageTitle.ToLower(), firstRow.P3);

            //login to application
            loginPage.LoginToHome(firstRow.P1, firstRow.P2);

            loginPage.CheckForHome();

            // go the next page
            homePage = new HomePage(this.Driver, this.CurrentTest);

            homePage.ClickIdeasMenu();
            homePage.CheckforViewPage();

            ideasPage = new ViewIdeasPage(this.Driver, this.CurrentTest);
            Assert.AreEqual(firstRow.P5, ideasPage.GetIdeasPageHeader());

            ideasPage.ClickSubmitIdea();
            ideasPage.CheckforSubmitPage();

            submitIdeaPage = new SubmitIdeaPage(this.Driver, this.CurrentTest);
            Assert.AreEqual(firstRow.P6, submitIdeaPage.GetIdeasPageHeader().ToLower());

            ///set idea
            Idea idea = new Idea();

            idea.IdeaTitle          = firstRow.P7;
            idea.IdeaDesc           = firstRow.P8;
            idea.IdeaTags           = firstRow.P9;
            idea.IdeaTeammembers    = firstRow.P10;
            idea.AssistanceRequired = true;
            idea.IdeaCategory       = IdeaCategory.CSR;
            idea.IdeaBusiness       = IdeaBusiness.Gas;
            idea.ActionPlan         = firstRow.P14;
            idea.Benefits           = firstRow.P15;
            idea.Objective          = firstRow.P13;
            submitIdeaPage.SubmitIdea(idea);
            Assert.AreEqual(firstRow.P11, submitIdeaPage.GetConfirmationMesg().ToLower());

            submitIdeaPage.SubmitIdeaYesClick();

            var ideaId = submitIdeaPage.GetIdeaId();

            homePage.GetUserLoggedOut();
            homePage.CheckForLoginPage();

            return(ideaId);
        }
Ejemplo n.º 2
0
        public void Check_HomePage_ViewIdeasClick_Correct()
        {
            try
            {
                var models = this.GetCurrentData();
                if (models.Count > 0)
                {
                    var firstRow = models[0];
                    //Create Login Page object
                    loginPage = new LoginPage(this.Driver, this.CurrentTest);

                    //Verify login page title
                    string loginPageTitle = loginPage.GetLoginTitle();

                    Assert.AreEqual(firstRow.P3, loginPageTitle.ToLower());

                    //login to application
                    loginPage.LoginToHome(firstRow.P1, firstRow.P2);

                    loginPage.CheckForHome();

                    // go the next page
                    homePage = new HomePage(this.Driver, this.CurrentTest);

                    //Verify home page
                    Assert.AreEqual(firstRow.P4, homePage.GetHomePageDashboardUserName());

                    homePage.ClickIdeasMenu();

                    homePage.CheckforViewPage();

                    ideasPage = new ViewIdeasPage(this.Driver, this.CurrentTest);
                    Assert.AreEqual(firstRow.P5, ideasPage.GetIdeasPageHeader());
                    ideasPage.ClickSubmitIdea();
                    ideasPage.CheckforSubmitPage();

                    submitIdeaPage = new SubmitIdeaPage(this.Driver, this.CurrentTest);
                    Assert.AreEqual(firstRow.P6, submitIdeaPage.GetIdeasPageHeader().ToLower());
                    this.TestPassed("Test passed");
                }
            }
            catch (Exception ex)
            {
                this.LogException(ex);
                throw;
            }
        }
        public void Check_HomePage_SaveDraftIdeaClick_Correct()
        {
            try
            {
                var models = this.GetCurrentData();
                if (models.Count > 0)
                {
                    var firstRow = models[0];
                    //Create Login Page object
                    loginPage = new LoginPage(this.Driver, this.CurrentTest);

                    //Verify login page title
                    string loginPageTitle = loginPage.GetLoginTitle();

                    Assert.AreEqual(firstRow.P3, loginPageTitle.ToLower());

                    //login to application
                    loginPage.LoginToHome(firstRow.P1, firstRow.P2);

                    loginPage.CheckForHome();

                    // go the next page
                    homePage = new HomePage(this.Driver, this.CurrentTest);

                    //Verify home page
                    //Assert.AreEqual(firstRow.P4, homePage.GetHomePageDashboardUserName());

                    homePage.ClickIdeasMenu();
                    homePage.CheckforViewPage();

                    ideasPage = new ViewIdeasPage(this.Driver, this.CurrentTest);
                    Assert.AreEqual(firstRow.P5, ideasPage.GetIdeasPageHeader());

                    ideasPage.ClickSubmitIdea();
                    ideasPage.CheckforSubmitPage();

                    submitIdeaPage = new SubmitIdeaPage(this.Driver, this.CurrentTest);
                    Assert.AreEqual(firstRow.P6, submitIdeaPage.GetIdeasPageHeader().ToLower());

                    ///set idea
                    Idea idea = new Idea();
                    idea.IdeaTitle          = firstRow.P7;
                    idea.IdeaDesc           = firstRow.P8;
                    idea.IdeaTags           = firstRow.P9;
                    idea.IdeaTeammembers    = firstRow.P10;
                    idea.AssistanceRequired = true;
                    idea.IdeaCategory       = IdeaCategory.CSR;
                    idea.IdeaBusiness       = IdeaBusiness.Gas;
                    //idea.IdeaCountry = IdeaCountry.India;
                    //idea.IdeaState = IdeaState.Gujarat;
                    //idea.IdeaCity = IdeaCity.Ahmedabad;
                    idea.ActionPlan = firstRow.P14;
                    idea.Benefits   = firstRow.P15;
                    idea.Objective  = firstRow.P13;
                    submitIdeaPage.SaveDraftIdea(idea);

                    StringAssert.StartsWith(submitIdeaPage.GetIdeaSubmittedMesg().ToLower(), firstRow.P12);
                }
            }
            catch (Exception ex)
            {
                this.LogException(ex);
                throw;
            }
        }