Guest User

Untitled

a guest
Oct 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. [Binding]
  2. public class UserAdminSteps
  3. {
  4. [Given(@"I am a valid user of the site")]
  5. public void GivenIAmAValidUserOfTheSite()
  6. {
  7. }
  8.  
  9. [Given(@"I have navigated to the login page")]
  10. public void GivenIHaveNavigatedToTheLoginPage()
  11. {
  12. var homePage = ScenarioContext.Current.Get<HomePage>();
  13. var loginPage = homePage.ClickLoginLink();
  14. ScenarioContext.Current.Set(loginPage);
  15. }
  16.  
  17. [Given(@"I have entered a username of ""(.*)"" and a password of ""(.*)""")]
  18. public void GivenIHaveEnteredAUsernameOfAndAPasswordOf(string username, string password)
  19. {
  20. var loginPage = ScenarioContext.Current.Get<LoginPage>();
  21. loginPage.EnterUsername(username);
  22. loginPage.EnterPassword(password);
  23. }
  24.  
  25. [When(@"I click the create button")]
  26. public void WhenIClickTheCreateButton()
  27. {
  28. var loginPage = ScenarioContext.Current.Get<LoginPage>();
  29. loginPage.ClickLogin();
  30. }
  31.  
  32. [Then(@"I am logged in to the site")]
  33. public void ThenIAmLoggedInToTheSite()
  34. {
  35. var homePage = ScenarioContext.Current.Get<HomePage>();
  36.  
  37. Assert.IsTrue(homePage.IsLoggedIn());
  38. }
  39. }
Add Comment
Please, Sign In to add comment