Skip to content

Instantly share code, notes, and snippets.

@wayne-o
Created October 16, 2012 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wayne-o/3898993 to your computer and use it in GitHub Desktop.
Save wayne-o/3898993 to your computer and use it in GitHub Desktop.
[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']");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment