public void TestMethod1() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name).Info("TestMethod1 is running"); try { //Console.WriteLine("test started"); test.Log(Status.Info, "execution start of fbReg"); var fbHome = new FBHomePageObjects(driver); fbHome.EnterFirstName(); test.Log(Status.Info, "registereed"); test.Log(Status.Pass, "my test is passed"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "failed " + e); throw; } }
public void MyFBReg() { test = extent.CreateTest("MyFBReg").Info("Fb Reg start"); try { test.Log(Status.Info, "method started"); var fbHome = new FBHomePageObjects(driver); ///enter firstname fbHome.EnterFirstName(); test.Log(Status.Info, "execution completed"); test.Log(Status.Pass, "details entered"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "test failed"); throw; } }
public void myTestRun() { test = extent.CreateTest("nytestRun").Info("start ned test"); try { test.Log(Status.Info, "start test"); var hfb = new FBHomePageObjects(driver); ///enter firstname hfb.EnterFirstName(); test.Log(Status.Info, "test completed"); test.Log(Status.Pass, "properly executed"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "test failed " + e); throw; } }
public void MyFirstName() { string Cname = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name; test = extent.CreateTest(TestContext.CurrentContext.Test.Name).Info(TestContext.CurrentContext.Test.Name + " Method Start"); try { test.Log(Status.Info, Cname); node = test.CreateNode(TestContext.CurrentContext.Test.Name + " Method Step").Info("method steps are executing"); var fbh = new FBHomePageObjects(driver); Boolean status = fbh.VerifyDisplayedFirstNameOnFBHomePage; if (status) { node.Log(Status.Info, "firstname displayed"); } else { node.Log(Status.Fail, "firstname not displayed"); } status = fbh.VerifyEnabledFirstNameOnFBHomePage; if (status) { node.Log(Status.Info, "firstname enabled"); } else { node.Log(Status.Fail, "firstname not enabled"); } fbh.EnterFirstName(); node.Log(Status.Info, "firstname entered"); test.Log(Status.Pass, "My fristname information"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "My firstname information is different"); throw; } }
public void fbForgotPwd() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name).Info("new test execution start"); try { test.Log(Status.Info, "for got pwd"); Thread.Sleep(5000); var fbHome = new FBHomePageObjects(driver); fbHome.ClickOnforgotPwd(); var recovEmail = new ForgotPwdPageObjects(driver); recovEmail.recoveryEmailProcess(); test.Log(Status.Info, "for got pwd worked"); test.Log(Status.Pass, "test passed"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "test forgot pwd failed " + e); throw; } }
public void MyRetypeEmailOnFBHome() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name).Info(TestContext.CurrentContext.Test.Name + " Method Start"); try { node = test.CreateNode(TestContext.CurrentContext.Test.Name).Info("method steps are executing"); var fbh = new FBHomePageObjects(driver); Boolean status = fbh.VerifyDisplayedRetypeEmailForFbRegFBHomePage; if (status) { node.Log(Status.Info, "Retype Email displayed"); } else { node.Log(Status.Fail, "Retype Email not displayed"); } status = fbh.VerifyEnabledRetypeEmailForFbRegOnFBHomePage; if (status) { node.Log(Status.Info, "Retype Email enabled"); } else { node.Log(Status.Fail, "Retype Email not enabled"); } fbh.EnterRetypeEmailForFBReg(); node.Log(Status.Info, "Retype Email entered"); test.Log(Status.Pass, "My Retype Email information"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "My Retype Email information is different " + e); throw; } }
public void MyLastName() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name).Info(TestContext.CurrentContext.Test.Name + " Method Start"); try { node = test.CreateNode("Method Step").Info("method steps are executing"); var fbh = new FBHomePageObjects(driver); Boolean status = fbh.VerifyDisplayedLastNameOnFBHomePage; if (status) { node.Log(Status.Info, "Lastname displayed"); } else { node.Log(Status.Fail, "lastname not displayed"); } status = fbh.VerifyEnabledFirstNameOnFBHomePage; if (status) { node.Log(Status.Info, "Lastname enabled"); } else { node.Log(Status.Fail, "Lastname not enabled"); } fbh.EnterLastName(); node.Log(Status.Info, "Lastname entered"); test.Log(Status.Pass, "My Lastname information"); } catch (NoSuchElementException e) { test.Log(Status.Fail, "My Lastname information is different"); throw; } }
public void FBObjectsVerification() { string screenshotPath = null; test = extent.CreateTest("FBObjectsVerification").Info("FB Objects Verification"); try { test.Log(Status.Info, "Test Execution Start"); var fbObjects = new FBHomePageObjects(driver); Boolean status = fbObjects.VerifyDisplayedFirstNameOnFBHomePage; if (status) { test.Log(Status.Info, "Firstname should be displayed"); screenshotPath = GetScreenShot(driver, "FN Displayed"); test.AddScreenCaptureFromPath(screenshotPath); } else { test.Log(Status.Info, "Firstname not displayed"); } status = fbObjects.VerifyEnabledFirstNameOnFBHomePage; if (status) { test.Log(Status.Info, "Firstname should be Enabled"); screenshotPath = GetScreenShot(driver, "FN"); test.AddScreenCaptureFromPath(screenshotPath); } else { test.Log(Status.Info, "Firstname not enabled"); } ///enter firstname fbObjects.EnterFirstName(); test.Log(Status.Info, "First Name entered"); screenshotPath = GetScreenShot(driver, "FN Enter"); test.AddScreenCaptureFromPath(screenshotPath); ////------- status = fbObjects.VerifyDisplayedLastNameOnFBHomePage; if (status) { test.Log(Status.Info, "Lastname should be displayed"); screenshotPath = GetScreenShot(driver, "LNDisplayed"); test.AddScreenCaptureFromPath(screenshotPath); } else { test.Log(Status.Info, "Lasstname not displayed"); } status = fbObjects.VerifyEnabledLastNameOnFBHomePage; if (status) { test.Log(Status.Info, "Lastname should be Enabled"); screenshotPath = GetScreenShot(driver, "LNEnabled"); test.AddScreenCaptureFromPath(screenshotPath); } else { test.Log(Status.Info, "Lastname not enabled"); } /////enter Last Name fbObjects.EnterLastName(); test.Log(Status.Info, "Last Name Entered"); screenshotPath = GetScreenShot(driver, "LN Enter"); test.AddScreenCaptureFromPath(screenshotPath); ////----------- status = fbObjects.VerifyDisplayedEmailForFbRegFBHomePage; if (status) { test.Log(Status.Info, "Email should be displayed"); } else { test.Log(Status.Info, "Email not displayed"); } status = fbObjects.VerifyEnabledEmailForFbRegOnFBHomePage; if (status) { test.Log(Status.Info, "Email should be Enabled"); } else { test.Log(Status.Info, "Email not enabled"); } ////enter Email fbObjects.EnterEmailForFBReg(); test.Log(Status.Info, "Email Entered"); /////--------- status = fbObjects.VerifyDisplayedRetypeEmailForFbRegFBHomePage; if (status) { test.Log(Status.Info, "Retype Email should be displayed"); } else { test.Log(Status.Info, "Retype Email not displayed"); } status = fbObjects.VerifyEnabledRetypeEmailForFbRegOnFBHomePage; if (status) { test.Log(Status.Info, "Retype Email should be Enabled"); } else { test.Log(Status.Info, "Retype Email not enabled"); } /////enter retype email fbObjects.EnterRetypeEmailForFBReg(); test.Log(Status.Info, "Retype Email Entered"); ////--------- status = fbObjects.VerifyDisplayedPasswordForFbRegFBHomePage; if (status) { test.Log(Status.Info, "Password should be displayed"); } else { test.Log(Status.Info, "Password not displayed"); } status = fbObjects.VerifyEnabledPasswordForFbRegOnFBHomePage; if (status) { test.Log(Status.Info, "Password should be Enabled"); } else { test.Log(Status.Info, "Password not enabled"); } /////enter Password fbObjects.EnterPasswordForFBReg(); test.Log(Status.Info, "Password Entered"); //////------ status = fbObjects.VerifyDisplayedMonthForFbRegFBHomePage; if (status) { test.Log(Status.Info, "Month should be displayed"); } else { test.Log(Status.Info, "Month not displayed"); } status = fbObjects.VerifyEnabledMonthForFbRegOnFBHomePage; if (status) { test.Log(Status.Info, "Month should be Enabled"); } else { test.Log(Status.Info, "Month not enabled"); } /////Month Selected fbObjects.SelectMonth(); test.Log(Status.Info, "Month Selected"); //////------ status = fbObjects.VerifyDisplayedDayForFbRegFBHomePage; if (status) { test.Log(Status.Info, "Day should be displayed"); } else { test.Log(Status.Info, "Day not displayed"); } status = fbObjects.VerifyEnabledDayForFbRegOnFBHomePage; if (status) { test.Log(Status.Info, "Day should be Enabled"); } else { test.Log(Status.Info, "Day not enabled"); } /////Day Selected fbObjects.SelectDay(); test.Log(Status.Info, "Day Selected"); //////------ status = fbObjects.VerifyDisplayedYearForFbRegFBHomePage; if (status) { test.Log(Status.Info, "Year should be displayed"); } else { test.Log(Status.Info, "Year not displayed"); } status = fbObjects.VerifyEnabledYearForFbRegOnFBHomePage; if (status) { test.Log(Status.Info, "Year should be Enabled"); } else { test.Log(Status.Info, "Year not enabled"); } /////Day Selected fbObjects.SelectYear(); test.Log(Status.Info, "Year Selected"); test.Log(Status.Pass, "Details Entered"); } catch (NoSuchElementException e) { test.Log(Status.Fail, e); throw; } }