Guest User

Untitled

a guest
Jun 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package com.sjl.webdriver;
  2.  
  3. import static junit.framework.Assert.*;
  4. import org.junit.*;
  5.  
  6. public class TestSimpleApp {
  7.  
  8. private ApplicationDriver driver;
  9.  
  10. @Before
  11. public void openBrowser() {
  12. driver = new ApplicationDriver();
  13. }
  14.  
  15. @After
  16. public void closeBrowser() {
  17. driver.quit();
  18. }
  19.  
  20. @Test
  21. public void canDetectALabel() {
  22. assertEquals(1, driver.countLabels());
  23. }
  24.  
  25. @Test
  26. public void pushingTheButtonAddsALabel() {
  27. assertEquals(1, driver.countLabels());
  28. driver.pushTheButton();
  29. assertEquals(2, driver.countLabels());
  30. }
  31.  
  32. @Test
  33. public void pushingTheButtonAgainAddsAnotherLabel() {
  34. assertEquals(1, driver.countLabels());
  35. driver.pushTheButton();
  36. assertEquals(2, driver.countLabels());
  37. driver.pushTheButton();
  38. assertEquals(3, driver.countLabels());
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment