本文整理匯總了C#中WatiN.Core.IE.ContainsText方法的典型用法代碼示例。如果您正苦於以下問題:C# IE.ContainsText方法的具體用法?C# IE.ContainsText怎麽用?C# IE.ContainsText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WatiN.Core.IE
的用法示例。
在下文中一共展示了IE.ContainsText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Should_save_a_visit
public void Should_save_a_visit()
{
new DatabaseTester().Clean();
var url = "http://localhost:1234/";
using (var ie = new IE(url))
{
ie.TextField("PathAndQuerystring").TypeText("/MyUrl");
ie.TextField("LoginName").TypeText("SomeComputer\\ThisUser");
ie.Button("submit").Click();
ie.ContainsText("/MyUrl");
ie.ContainsText("SomeComputer\\ThisUser").ShouldBeTrue();
}
}
示例2: Page_With_An_Action
public void Page_With_An_Action()
{
using (var browser = new IE("http://www.google.com")) {
browser.Page<GoogleSearchPage>().SearchFor("Robby");
Assert.IsTrue(browser.ContainsText("Robby"));
}
}
示例3: Verify_WebsiteUp
public void Verify_WebsiteUp()
{
using (var browser = new IE("http://localhost/Sample.Web_deploy"))
{
var hasText = browser.ContainsText("Getting started");
Assert.IsTrue(hasText);
}
}
示例4: Home_HasMvcStoreHasTitle_True
public void Home_HasMvcStoreHasTitle_True()
{
var browser = new IE("http://localhost:1100/");
browser.BringToFront();
Assert.IsTrue(browser.ContainsText("ASP.NET MVC MUSIC STORE"));
browser.Close();
}
示例5: GenerateNummericSequenceUITest
public void GenerateNummericSequenceUITest()
{
using (var browser = new IE("http://localhost:10827/"))
{
browser.TextField(Find.ByName("txtNumber")).TypeText("15");
browser.Button(Find.ByName("btnGenerate")).Click();
Assert.IsTrue(browser.ContainsText("All Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 "));
Assert.IsTrue(browser.ContainsText("All Odd Numbers: 1, 3, 5, 7, 9, 11, 13, 15 "));
Assert.IsTrue(browser.ContainsText("All Even Numbers: 0, 2, 4, 6, 8, 10, 12, 14 "));
Assert.IsTrue(browser.ContainsText("All Extended FizzBuzzs: Z, 1, 2, C, 4, E, C, 7, 8, C, E, 11, C, 13, 14, Z "));
Assert.IsTrue(browser.ContainsText("All Fibonacci Numbers: 0, 1, 1, 2, 3, 5, 8, 13 "));
System.Threading.Thread.Sleep(5000);
}
}
示例6: AddPost_ShouldRenderAddForm_AndConfirmPostSaved
public void AddPost_ShouldRenderAddForm_AndConfirmPostSaved()
{
using(IE browser = new IE(BuildTestUrl("post/add.aspx")))
{
Assert.IsTrue(browser.ContainsText("Ben Lovell's Blog"),
"No header text found");
Assert.IsTrue(browser.ContainsText("Add Post"),
"Add Post not found");
browser.TextField(Find.ByName("post.Title")).TypeText("Title");
browser.TextField(Find.ByName("post.Description")).TypeText("Description");
browser.TextField(Find.ByName("post.Content")).TypeText("Content");
browser.Button(Find.ByValue("Submit")).Click();
Assert.IsTrue(browser.ContainsText(@"The post titled: 'Title' was created!"),
"Correct confirmation was not displayed");
}
}
示例7: Save_should_fail_when_GET_attempted
public void Save_should_fail_when_GET_attempted()
{
using (IE browser = new IE(BuildTestUrl("post/save.aspx")))
{
Assert.IsTrue(browser.ContainsText(
@"Access to the action [save] on controller [post] is not allowed to the http verb [GET]."),
"Action accessible via GET");
}
}
示例8: SearchForWatiNOnGoogle
public void SearchForWatiNOnGoogle()
{
using (var browser = new IE("http://www.google.com")) {
browser.TextField(Find.ByName("q")).TypeText("WatiN");
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText("WatiN"));
}
}
示例9: HelloWatin
public void HelloWatin(string search)
{
using (var browser = new IE("http://www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText(search);
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText(search));
}
}
示例10: RunSmokeTest
public void RunSmokeTest()
{
using (var browser = new IE("http://www.google.com"))
{
const string search = "WatiN";
browser.TextField(Find.ByName("q")).TypeText(search);
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText(search));
}
}
示例11: Demonstrate_speed
public void Demonstrate_speed()
{
new DatabaseTester().Clean();
var url = "http://localhost:1234/";
using (var ie = new IE(url))
{
for (int i = 0; i < 50; i++)
{
ie.GoTo("http://localhost:1234/");
ie.TextField("PathAndQuerystring").Value = "/MyUrl";
ie.TextField("LoginName").Value = "SomeComputer\\ThisUser";
ie.Button("submit").Click();
ie.ContainsText("/MyUrl");
ie.ContainsText("SomeComputer\\ThisUser").ShouldBeTrue();
}
}
}
示例12: Search_for_watin_on_google_using_page_class
public void Search_for_watin_on_google_using_page_class()
{
using (var browser = new IE("http://www.google.com"))
{
var searchPage = browser.Page<GoogleSearchPage>();
searchPage.SearchCriteria.TypeText("WatiN");
searchPage.SearchButton.Click();
Assert.IsTrue(browser.ContainsText("WatiN"));
}
}
示例13: Home_ClickOnRockContainsRockAlbumText_True
public void Home_ClickOnRockContainsRockAlbumText_True()
{
using (var browser = new IE("http://localhost:1100/"))
{
browser.BringToFront();
browser.Link(Find.ByText("Rockssss")).Click();
Assert.IsTrue(browser.ContainsText("Rock Albums"));
}
}
示例14: StressThread
void StressThread()
{
//Settings.WaitForCompleteTimeOut = 3600;
//Settings.WaitUntilExistsTimeOut = 3600;
using (IE ie = new IE("http://localhost:8888/"))
{
//ie.Frame(Find.ById("uploadManager")).FileUpload(Find.ById("test")).Set("e:\\downloads\\VS7.1sp1-KB918007-X86.exe");
//ie.Frame(Find.ById("uploadManager")).FileUpload(Find.ById("test")).Set("e:\\downloads\\Sandcastle.msi");
SetFileUpload(ie, "slickUpload_selector_html_file0", @"C:\Users\Chris\Downloads\Firefox Setup 7.0.exe");
//_waitEvent.WaitOne();
ie.Link(Find.ById("uploadButton")).Click();
while (!ie.ContainsText("Upload Result"))
{
Thread.Sleep(1000);
//ie.WaitForComplete();
}
Assert.True(ie.ContainsText("Complete"));
ie.Link(Find.ById("newUploadButton")).Click();
ie.WaitForComplete();
SetFileUpload(ie, "slickUpload_selector_html_file0", @"C:\Users\Chris\Downloads\SlickUpload-6.1-S3MetadataFix.zip");
SetFileUpload(ie, "slickUpload_selector_html_file1", @"C:\Users\Chris\Downloads\MSBuild Extension Pack April 2011 (All Files) (1).zip");
ie.Link(Find.ById("uploadButton")).Click();
while (!ie.ContainsText("Upload Result"))
{
Thread.Sleep(1000);
//ie.WaitForComplete();
}
Assert.True(ie.ContainsText("Complete"));
//Thread.Sleep(10000);
}
}
示例15: WpLoadingTest
public void WpLoadingTest()
{
using (var browser = new IE("http://www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("WatiN");
browser.Button(Find.ByName("btnG")).Click();
var waitForWithAssert = new WaitForPage(() =>
{
Assert.IsTrue(browser.ContainsText("WatiN"));
});
}
}