forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestWait.cs
42 lines (41 loc) · 1.63 KB
/
TestWait.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Text.RegularExpressions;
namespace Selenium.Tests
{
[TestFixture]
public class TestWait : SeleniumTestCaseBase
{
[Test]
public void ShouldBeAbleToWait()
{
// Link click
selenium.Open("../tests/html/test_reload_onchange_page.html");
selenium.Click("theLink");
selenium.WaitForPageToLoad("30000");
// Page should reload
Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
selenium.Open("../tests/html/test_reload_onchange_page.html");
selenium.Select("theSelect", "Second Option");
selenium.WaitForPageToLoad("30000");
// Page should reload
Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
// Textbox with onblur
selenium.Open("../tests/html/test_reload_onchange_page.html");
selenium.Type("theTextbox", "new value");
selenium.FireEvent("theTextbox", "blur");
selenium.WaitForPageToLoad("30000");
Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
// Submit button
selenium.Open("../tests/html/test_reload_onchange_page.html");
selenium.Click("theSubmit");
selenium.WaitForPageToLoad("30000");
Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
selenium.Click("slowPage_reload");
selenium.WaitForPageToLoad("30000");
Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
}
}
}