using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
namespace SeleniumTests
{
[TestFixture]
public class MyFirstVCTest
{
private ISelenium selenium;
private StringBuilder verificationErrors;
[Test]
public void TheNewTest()
{
selenium.Open("/");
}
[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome","http://demo.volunteercampaigns.com/");
selenium.Start();
verificationErrors = new StringBuilder();
}
[TearDown]
public void TeardownTest()
{
try
{
selenium.Stop();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
Assert.AreEqual("", verificationErrors.ToString());
}
[Test]
public void TheMyFirstVCTest()
{
selenium.Open("/?AspxAutoDetectCookieSupport=1");
selenium.Click("link=Login");
selenium.WaitForPageToLoad("30000");
selenium.Type("id=ctl00_ContentPlaceHolder1_txtEmailAddress", "[email protected]");
selenium.Type("id=ctl00_ContentPlaceHolder1_txtPassword", "orbs123");
selenium.Click("id=ctl00_ContentPlaceHolder1_btnlogin");
selenium.WaitForPageToLoad("30000");
selenium.Click("id=ctl00_lblUserName");
selenium.Click("id=ctl00_lnkSignOut");
selenium.WaitForPageToLoad("30000");
}
}
}