Skip to content

Instantly share code, notes, and snippets.

@margusmartsepp
Created September 2, 2016 11:28
Show Gist options
  • Save margusmartsepp/077b7af171882b7b2293360da7876c45 to your computer and use it in GitHub Desktop.
Save margusmartsepp/077b7af171882b7b2293360da7876c45 to your computer and use it in GitHub Desktop.
Selenium acceptance test example
private static string _homepage = "http://rkr.devel.aedes.ee/";
[Test]
[TestCase("xxxx?-*", "Teie otsingul ei olnud tulemusi.")]
public void ReadPivot(string searchItem, string expectedResult)
{
using (var d = new ChromeDriver())
{
// Arrange
d.Navigate().GoToUrl(_homepage);
d.FindElement(By.Id("search")).SendKeys(searchItem);
d.FindElement(By.Id("search")).Submit();
// Act
var result = By.Class("note-msg")).Text;
// Assert
Assert.That(result, Is.EqualTo(expectedResult))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment