Ejemplo n.º 1
0
        public void CheckTitleOfallPages()
        {
            CustomLogs.startTestCase(System.Reflection.MethodBase.GetCurrentMethod().Name);

            try
            {
                HomePage homePage = new HomePage(chrome, "home");
                Assert.IsTrue(homePage.checkPageName());

                homePage.ClickOnUITestingBtn();
                Assert.IsTrue(homePage.checkPageName());

                FormPage formPage = homePage.ClickOnFormBtn();
                Assert.IsTrue(formPage.checkPageName());

                homePage = formPage.ClickOnHomeBtn();
                Assert.IsTrue(homePage.checkPageName());
            }
            catch (AssertFailedException afe)
            {
                CustomLogs.warn(afe.Message);
                throw new AssertFailedException(afe.Message);
            }
            catch (NoSuchElementException nsee)
            {
                CustomLogs.error(nsee.Message);
                throw new NoSuchElementException(nsee.Message);
            }
            catch (Exception exc)
            {
                CustomLogs.error(exc.Message + exc.StackTrace);
                throw new Exception(exc.Message);
            }
            finally
            {
                CustomLogs.endTestCase(System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }