public
Created

  • Download Gist
gistfile1.cs
C#
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 43 44 45 46 47 48 49 50 51 52 53 54
[Given(@"I am an admin user and I have logged in")]
public void GivenIAmAnAdminUserAndIHaveLoggedIn()
{
//todo: come back to this
}
 
[Given(@"I have navigated to the manage categories screen")]
public void GivenIHaveNavigatedToTheManageCategoriesScreen()
{
BrowserSession.Visit("http://localhost:4334/admin/categories");
}
 
[Given(@"I click the ""(.*)"" button")]
public void GivenIClickTheButton(string p0)
{
BrowserSession.ClickLink("Register");
}
 
[Given(@"I enter ""(.*)"" into the ""(.*)"" textbox")]
public void GivenIEnterIntoTheTextbox(string p0, string p1)
{
BrowserSession.FillIn(p1).With(p0);
}
 
[Given(@"I ensure the ""(.*)"" checkbox is ""(.*)""")]
public void GivenIEnsureTheCheckboxIs(string p0, bool p1)
{
if (p1)
{
BrowserSession.Check(p0);
}
else
{
BrowserSession.Uncheck(p0);
}
}
 
[When(@"I click the ""(.*)"" button")]
public void WhenIClickTheButton(string p0)
{
BrowserSession.ClickButton(p0);
}
 
[Then(@"I should see ""(.*)"" show up in the list of existing categories")]
public void ThenIShouldSeeShowUpInTheListOfExistingCategories(string p0)
{
BrowserSession.FindSection(p0).Exists().Should().BeTrue();
}
 
[Then(@"it should be enabled")]
public void ThenItShouldBeEnabled()
{
BrowserSession.FindXPath("//tr[@class='category']/td[@class='activated']");
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.