Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.sjl.webdriver;
- import static junit.framework.Assert.*;
- import org.junit.*;
- public class TestSimpleApp {
- private ApplicationDriver driver;
- @Before
- public void openBrowser() {
- driver = new ApplicationDriver();
- }
- @After
- public void closeBrowser() {
- driver.quit();
- }
- @Test
- public void canDetectALabel() {
- assertEquals(1, driver.countLabels());
- }
- @Test
- public void pushingTheButtonAddsALabel() {
- assertEquals(1, driver.countLabels());
- driver.pushTheButton();
- assertEquals(2, driver.countLabels());
- }
- @Test
- public void pushingTheButtonAgainAddsAnotherLabel() {
- assertEquals(1, driver.countLabels());
- driver.pushTheButton();
- assertEquals(2, driver.countLabels());
- driver.pushTheButton();
- assertEquals(3, driver.countLabels());
- }
- }
Add Comment
Please, Sign In to add comment