本文整理汇总了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));
}
示例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));
}
示例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");
}