当前位置: 首页>>代码示例>>C#>>正文


C# MainPage.WaitForElement方法代码示例

本文整理汇总了C#中MainPage.WaitForElement方法的典型用法代码示例。如果您正苦于以下问题:C# MainPage.WaitForElement方法的具体用法?C# MainPage.WaitForElement怎么用?C# MainPage.WaitForElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainPage的用法示例。


在下文中一共展示了MainPage.WaitForElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test0014_EditContentOfExistingModule

		public void Test0014_EditContentOfExistingModule(string pageName, string moduleContent)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit content to HTML Module'");

			Modules module = new Modules(_driver);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "Find the original module number on 'Home' page");
			string originalModuleNumber = mainPage.WaitForElement(By.XPath(Modules.FooterRightPaneID + "/div[last()]/a")).GetAttribute("name");

			BlankPage blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, pageName);
			blankPage.SetPageToEditMode(pageName);

			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumberOnNewPage = module.WaitForElement(By.XPath(Modules.ContentPaneID + Modules.HtmlProModuleOnPage + "/a")).GetAttribute("name");

			module.AddContentToHTMLProModule(moduleNumberOnNewPage, moduleContent);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content is present on the page");
			Assert.That(moduleContent, Is.EqualTo(module.FindElement(By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumberOnNewPage + "')]//div[contains(@id, 'lblContent')]")).Text));

			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content changed on 'Home' page");
			Assert.That(moduleContent, Is.Not.EqualTo(module.WaitForElement(By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + originalModuleNumber + "')]//div[contains(@id, 'lblContent')]")).Text));
		}
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:29,代码来源:P1Modules.cs

示例2: EditContentOfExistingModuleWithCopy

		public void EditContentOfExistingModuleWithCopy(string assyName, string moduleClassName, Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleContent)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit content to HTML Module'");

			var module = new Modules(_driver);

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

			string moduleNameOnPage = modulesDescription["ContactUsModule"].IdWhenOnPage;
			string locationOnPage = Modules.LocationDescription["ContentPane"].IdWhenOnPage;

			Trace.WriteLine(BasePage.TraceLevelPage + "Find the original module number on 'Home' page");
			string originalModuleNumber =
				mainPage.WaitForElement(By.XPath(Modules.LocationDescription["FooterRightPane"].IdWhenOnPage + "/div[last()]/a")).GetAttribute("name");

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, pageName);
			blankPage.SetPageToEditMode();

			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumberOnNewPage =
				module.WaitForElement(By.XPath(locationOnPage + moduleNameOnPage + "/a")).GetAttribute("name");

			GetHTMLModule(assyName, moduleClassName, moduleNumberOnNewPage, moduleContent);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content is present on the page");
			Assert.That(moduleContent,
			            Is.EqualTo(
				            module.FindElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumberOnNewPage +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));

			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content changed on 'Home' page");
			Assert.That(moduleContent,
			            Is.Not.EqualTo(
				            module.WaitForElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + originalModuleNumber +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));
		
		}
开发者ID:rajeshvar,项目名称:Dnn.Platform,代码行数:43,代码来源:P1Modules.cs

示例3: Test003_RegisteredUserChangesProfile

		public void Test003_RegisteredUserChangesProfile()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Registered User changes Password'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginUsingDirectUrl(_baseUrl, _registeredUserName, _registeredUserPassword);

			var manageUserProfilePage = new ManageUserProfilePage(_driver);
			manageUserProfilePage.OpenUsingLink(_baseUrl);

			manageUserProfilePage.ChangePassword(_registeredUserPassword, _newPassword);

			loginPage.LoginUsingLoginLink(_registeredUserName, _newPassword);

			var mainPage = new MainPage(_driver);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the name of logged User is correct");
			Assert.That(mainPage.WaitForElement(By.XPath(ControlPanelIDs.RegisterLink)).Text,
						Is.EqualTo(_registeredUserDisplayName),
						"The User is not added correctly");
		}
开发者ID:kp-xcess,项目名称:Dnn.Platform,代码行数:21,代码来源:P1UserProfile.cs


注:本文中的MainPage.WaitForElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。