forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestPause.cs
30 lines (29 loc) · 1.06 KB
/
TestPause.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
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Text.RegularExpressions;
using System.Threading;
namespace Selenium.Tests
{
[TestFixture]
public class TestPause : SeleniumTestCaseBase
{
[Test]
public void ShouldBeAbleToPause()
{
selenium.Open("../tests/html/test_reload_onchange_page.html");
// Make sure we can pause even when the page doesn't change
Thread.Sleep(100);
Assert.AreEqual(selenium.GetTitle(), "Reload Page");
Assert.IsTrue(selenium.IsElementPresent("theSelect"));
selenium.Select("theSelect", "Second Option");
// Make sure we can pause to wait for a page reload
// Must pause longer than the slow-loading page takes (500ms)
Thread.Sleep(5000);
Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
Assert.IsFalse(selenium.IsElementPresent("theSelect"));
Assert.IsTrue(selenium.IsElementPresent("theSpan"));
}
}
}