Package br.com.caelum.seleniumdsl

Source Code of br.com.caelum.seleniumdsl.DefaultBrowserTest

package br.com.caelum.seleniumdsl;

import org.jmock.Expectations;
import org.jmock.Mockery;
import org.junit.Before;
import org.junit.Test;

import br.com.caelum.seleniumdsl.Browser;
import br.com.caelum.seleniumdsl.DefaultBrowser;

import com.thoughtworks.selenium.Selenium;

public class DefaultBrowserTest {
  private Selenium mock;
  private Mockery mockery;
  private Browser browser;

  @Before
  public void setUp() {
    mockery = new Mockery();
    mock = mockery.mock(Selenium.class);
    browser = new DefaultBrowser(mock);
  }

  @Test
  public void testOpen() {
    mockery.checking(new Expectations() {
      {
        exactly(1).of(mock).open(with(any(String.class)));
        exactly(1).of(mock).waitForPageToLoad(with(any(String.class)));
      }
    });
    browser.open("");
    mockery.assertIsSatisfied();
  }
}
TOP

Related Classes of br.com.caelum.seleniumdsl.DefaultBrowserTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.