本文整理汇总了C#中Tests.DnaTestURLRequest.RequestNUnitASPPage方法的典型用法代码示例。如果您正苦于以下问题:C# DnaTestURLRequest.RequestNUnitASPPage方法的具体用法?C# DnaTestURLRequest.RequestNUnitASPPage怎么用?C# DnaTestURLRequest.RequestNUnitASPPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tests.DnaTestURLRequest
的用法示例。
在下文中一共展示了DnaTestURLRequest.RequestNUnitASPPage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test01RestrictedUsersListPage
public void Test01RestrictedUsersListPage()
{
try
{
DnaTestURLRequest dnaRequest = new DnaTestURLRequest("h2g2");
Console.WriteLine("Before Test01RestrictedUsersListPage");
dnaRequest.SetCurrentUserEditor();
dnaRequest.UseEditorAuthentication = true;
string relativePath = @"/dna/h2g2/RestrictedUsers";
dnaRequest.RequestNUnitASPPage(relativePath, Browser);
System.Threading.Thread.Sleep(2000);
DropDownListTester siteList = new DropDownListTester("SiteList");
Assert.AreEqual(siteList.Visible, true);
siteList.Items.FindByText("All").Selected = true;
DropDownListTester userStatusTypes = new DropDownListTester("UserStatusTypes");
Assert.AreEqual(userStatusTypes.Visible, true);
userStatusTypes.Items.FindByText("Premoderated").Selected = true;
LabelTester error = new LabelTester("lblError");
string errorText = error.Text;
bool noError = true;
if (errorText == "Insufficient permissions - Editor Status Required")
{
noError = false;
}
Assert.IsTrue(noError, "Error in Restricted User Page.");
Console.WriteLine("After Test01RestrictedUsersListPage");
}
catch (Exception ex)
{
Console.WriteLine("EXCEPTION");
Console.WriteLine(ex.Message);
}
}
示例2: Test02RestrictedUsersListPageWithNormalUserErrorTest
public void Test02RestrictedUsersListPageWithNormalUserErrorTest()
{
try
{
DnaTestURLRequest dnaRequest = new DnaTestURLRequest("h2g2");
Console.WriteLine("Before Test02RestrictedUsersListPageWithNormalUserErrorTest");
dnaRequest.SetCurrentUserNormal();
dnaRequest.UseEditorAuthentication = true;
string relativePath = @"/dna/h2g2/RestrictedUsers";
dnaRequest.RequestNUnitASPPage(relativePath, Browser);
System.Threading.Thread.Sleep(2000);
LabelTester error = new LabelTester("lblError");
string errorText = error.Text;
bool isError = false;
if (errorText == "Insufficient permissions - Editor Status Required")
{
isError = true;
}
Assert.IsTrue(isError, "No Error for Normal user in Restricted User Page.");
Console.WriteLine("After Test02RestrictedUsersListPageWithNormalUserErrorTest");
}
catch (Exception ex)
{
Console.WriteLine("EXCEPTION");
Console.WriteLine(ex.Message);
}
}
示例3: Test05RestrictedUsersListSearchByMostRecentPage
public void Test05RestrictedUsersListSearchByMostRecentPage()
{
try
{
DnaTestURLRequest dnaRequest = new DnaTestURLRequest("haveyoursay");
Console.WriteLine("Before Test05RestrictedUsersListSearchByMostRecentPage");
dnaRequest.SetCurrentUserEditor();
dnaRequest.UseEditorAuthentication = true;
string relativePath = @"/dna/haveyoursay/RestrictedUsers";
dnaRequest.RequestNUnitASPPage(relativePath, Browser);
ButtonTester mostRecent = new ButtonTester("btnMostRecent", CurrentWebForm);
mostRecent.Click();
HtmlTableTester table = new HtmlTableTester("tblResults");
bool isdata = true;
if (table.BodyNoTags != "No data for those details")
{
isdata = false;
}
Assert.IsTrue(isdata, "No data for Most Recent accounts is returned when there should be at least one.");
Console.WriteLine("After Test05RestrictedUsersListSearchByMostRecentPage");
}
catch (Exception ex)
{
Console.WriteLine("EXCEPTION");
Console.WriteLine(ex.Message);
}
}
示例4: Test06RestrictedUsersListNonEditorPage
public void Test06RestrictedUsersListNonEditorPage()
{
try
{
DnaTestURLRequest dnaRequest = new DnaTestURLRequest("haveyoursay");
Console.WriteLine("Before Test06RestrictedUsersListNonEditorPage");
dnaRequest.SetCurrentUserNormal();
dnaRequest.UseEditorAuthentication = true;
string relativePath = @"/dna/haveyoursay/RestrictedUsers";
dnaRequest.RequestNUnitASPPage(relativePath, Browser);
LabelTester error = new LabelTester("lblError");
string errorText = error.Text;
bool isError = false;
if (errorText == "Insufficient permissions - Editor Status Required")
{
isError = true;
}
Assert.IsTrue(isError, "Error in permissions for Restricted User Page.");
Console.WriteLine("After Test06RestrictedUsersListNonEditorPage");
}
catch (Exception ex)
{
Console.WriteLine("EXCEPTION");
Console.WriteLine(ex.Message);
}
}
示例5: Test04RestrictedUserListPageSearchByBeginsWithLetterTest
public void Test04RestrictedUserListPageSearchByBeginsWithLetterTest()
{
try
{
DnaTestURLRequest dnaRequest = new DnaTestURLRequest("h2g2");
Console.WriteLine("Before Test04RestrictedUserListPageSearchByBeginsWithLetterTest");
dnaRequest.SetCurrentUserEditor();
dnaRequest.UseEditorAuthentication = true;
string relativePath = @"/dna/h2g2/RestrictedUsers";
dnaRequest.RequestNUnitASPPage(relativePath, Browser);
System.Threading.Thread.Sleep(2000);
DropDownListTester siteList = new DropDownListTester("SiteList");
Assert.AreEqual(siteList.Visible, true);
siteList.Items.FindByText("All").Selected = true;
DropDownListTester userStatusTypes = new DropDownListTester("UserStatusTypes");
Assert.AreEqual(userStatusTypes.Visible, true);
userStatusTypes.Items.FindByText("Both").Selected = true;
Console.WriteLine("Before Button creation");
ButtonTester btnD = new ButtonTester("btnD", CurrentWebForm);
Console.WriteLine("Before Button click");
btnD.Click();
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Before get table");
HtmlTableTester table = new HtmlTableTester("tblResults");
bool isdata = true;
if (table.BodyNoTags != "No data for those details")
{
isdata = false;
}
Console.WriteLine("After get table");
Assert.IsTrue(isdata, "No data for All accounts is returned when there should be at least one.");
Console.WriteLine("After Test04RestrictedUserListPageSearchByBeginsWithLetterTest");
}
catch (Exception ex)
{
Console.WriteLine("EXCEPTION");
Console.WriteLine(ex.Message);
}
}