Пример #1
0
		public void NavigationToLoginPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To Login Page'");

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			LoginPage loginPage = new LoginPage(_driver);
			loginPage.LetMeOut();
			loginPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Page Title for '" + LoginPage.PageTitleLabel + "' page:");
			StringAssert.Contains(LoginPage.PageTitleLabel, loginPage.WaitForElement(By.XPath("//span[contains(@id, '" + BasePage.PageTitle + "')]")).Text,
				"The wrong page is opened or The title of " + LoginPage.PageTitleLabel + " page is changed");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Box is present'");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(BasePage.SearchBox)),
						"The Search Box is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present'");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(BasePage.SearchButton)),
						"The Search Button is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present'");
			Utilities.SoftAssert(() => StringAssert.Contains(BasePage.CopyrightText, loginPage.FindElement(By.Id(BasePage.CopyrightNotice)).Text,
				"Copyright notice is not present or contains wrong text message"));

			loginPage.DoLoginUsingLoginLink("host", "dnnhost");
		}