예제 #1
0
파일: Smoke.cs 프로젝트: rrsc/Dnn.Platform
		public void LoginToSite()
		{
			var doc = XDocument.Load(@"SmokeTest\" + Settings.Default.SmokeDataFile);

			XElement settings = doc.Document.Element("Tests").Element("settings");

			_driver = StartBrowser(settings.Attribute("browser").Value);
			_baseUrl = settings.Attribute("baseURL").Value;

			_siteAlias = settings.Attribute("siteAlias").Value;
			_siteName = settings.Attribute("siteName").Value;
			_pageName = settings.Attribute("pageName").Value;
			_userName = settings.Attribute("userName").Value;

			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			var installerPage = new InstallerPage(_driver);
			installerPage.OpenUsingUrl(_baseUrl);
			//installerPage.WelcomeScreen();

			LoginPage loginPage = new LoginPage(_driver);

			loginPage.WaitForElement(By.XPath("//*[@id='" + LoginPage.LoginLink + "' and not(contains(@href, 'Logoff'))]"), 20).WaitTillVisible(20).Click();

			loginPage.WaitAndSwitchToFrame(30);

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

			loginPage.WaitAndSwitchToWindow(30);

			AdminSiteSettingsPage adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);
			adminSiteSettingsPage.DisablePopups();
		}
예제 #2
0
		public void Test001_VerifyPublicRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Public' registration option'");

			AdminSiteSettingsPage adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.PublicRadioButton);

			_loginPage.LetMeOut();
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' link is NOT present on the screen");
			Assert.IsFalse(_loginPage.ElementPresent(By.Id(BasePage.RegisteredUserLink)),
					"The Register link is present on the screen");

			_loginPage.OpenUsingUrl(_baseUrl);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' button is NOT present on the screen");
			Assert.IsFalse(_loginPage.ElementPresent(By.XPath(LoginPage.RegisterFrameButton)),
					"The Register button is present on the screen");
		}
예제 #3
0
		public void RunBeforeBVTTests()
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "BVT Setup");

			var doc = XDocument.Load(@"BVT\" + Settings.Default.BVTDataFile);

			XElement settings = doc.Document.Element("Tests").Element("settings");

			string testName = settings.Attribute("name").Value;
			string installerLanguage = settings.Attribute("InstallerLanguage").Value;

			IWebDriver driver = TestBase.StartDriver(settings.Attribute("browser").Value);
			string baseUrl = settings.Attribute("baseURL").Value;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			var installerPage = new InstallerPage(driver);

			installerPage.OpenUsingUrl(baseUrl);

			installerPage.SetInstallerLanguage(installerLanguage);
			installerPage.SetDictionary(installerLanguage);

			installerPage.FillAccountInfo(settings);

			installerPage.ClickOnContinueButton();

			installerPage.WaitForInstallationProcessToFinish();

			installerPage.ClickOnVisitWebsiteButton();

			installerPage.WelcomeScreen();

			AdminSiteSettingsPage adminSiteSettingsPage = new AdminSiteSettingsPage(driver);
			adminSiteSettingsPage.OpenUsingButtons(baseUrl);

			adminSiteSettingsPage.DisablePopups();

			driver.Quit();
		}