"Fossies" - the Fresh Open Source Software Archive 
Member "selenium-selenium-4.8.1/dotnet/test/webdriverbackedselenium/TestOpen.cs" (17 Feb 2023, 1755 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C# source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 using NUnit.Framework;
2 using System.Text.RegularExpressions;
3
4 namespace Selenium.Tests
5 {
6 [TestFixture]
7 public class TestOpen : SeleniumTestCaseBase
8 {
9 [Test]
10 public void ShouldBeAbleToOpen()
11 {
12 selenium.Open("../tests/html/test_open.html");
13 Assert.IsTrue(Regex.IsMatch(selenium.GetLocation(), "^[\\s\\S]*/tests/html/test_open\\.html$"));
14 // Should really split these verifications into their own test file.
15 Assert.IsTrue(Regex.IsMatch(selenium.GetLocation(), ".*/tests/html/[Tt]est_open.html"));
16 Assert.IsFalse(Regex.IsMatch(selenium.GetLocation(), "^[\\s\\S]*/foo\\.html$"));
17 Assert.IsTrue(selenium.IsTextPresent("glob:This is a test of the open command."));
18 Assert.IsTrue(selenium.IsTextPresent("This is a test of the open command."));
19 Assert.IsTrue(selenium.IsTextPresent("exact:This is a test of"));
20 Assert.IsTrue(selenium.IsTextPresent("regexp:This is a test of"));
21 Assert.IsTrue(selenium.IsTextPresent("regexp:T*his is a test of"));
22 Assert.IsFalse(selenium.IsTextPresent("exact:XXXXThis is a test of"));
23 Assert.IsFalse(selenium.IsTextPresent("regexp:ThXXXXXXXXXis is a test of"));
24 selenium.Open("../tests/html/test_page.slow.html");
25 Assert.IsTrue(Regex.IsMatch(selenium.GetLocation(), "^[\\s\\S]*/tests/html/test_page\\.slow\\.html$"));
26 Assert.AreEqual(selenium.GetTitle(), "Slow Loading Page");
27 selenium.SetTimeout("5000");
28 selenium.Open("../tests/html/test_open.html");
29 selenium.Open("../tests/html/test_open.html");
30 selenium.Open("../tests/html/test_open.html");
31 }
32 }
33 }