Package com.opera.core.systems.testing.drivers

Examples of com.opera.core.systems.testing.drivers.TestOperaDesktopDriver


  @BeforeClass
  public static void setupDriver() throws IOException {
    profileDirectory = new TemporaryFolder().newFolder();
    capabilities.setCapability(PROFILE.getCapability(), profileDirectory.getPath());
    driver = new TestOperaDesktopDriver(capabilities);
  }
View Full Code Here


    environment.set(OPERA_PATH_ENV_VAR, OLD_OPERA_PATH);
  }

  @Test
  public void specificProfile() throws IOException {
    driver = new TestOperaDesktopDriver(capabilities);

    assertTrue(driver.isRunning());
    assertEquals(profileDirectory.getCanonicalPath(),
                 driver.getSettings().profile().getDirectory().getCanonicalPath());
  }
View Full Code Here

  }

  @Test
  public void startAndQuitOperaFourTimes() {
    for (int i = 0; i < 5; i++) {
      driver = new TestOperaDesktopDriver();
      assertTrue("Opera should be running", driver.isRunning());

      // TODO: What does this do?  Why is it here?
      driver.resetOperaPrefs("");
      assertTrue("Opera should be running", driver.isRunning());
View Full Code Here

  public void autostartDisabled() {
    OperaSettings settings = new OperaSettings();
    settings.autostart(false);

    try {
      new TestOperaDesktopDriver(settings);
      fail("Expected exception");
    } catch (WebDriverException e) {
      assertThat(e.getCause(), instanceOf(ResponseNotReceivedException.class));
      assertThat(e.getMessage(), containsString("No response in a timely fashion"));
    }
View Full Code Here

  @Test
  public void environmentalBinaryPathIsRespected() {
    environment.set(OperaBinary.OPERA_PATH_ENV_VAR, resources.executableBinary().getPath());

    try {
      new TestOperaDesktopDriver();
      fail("Expected exception");
    } catch (WebDriverException e) {
      assertThat(e.getCause(), instanceOf(OperaRunnerException.class));
      assertThat(e.getMessage(), containsString("Could not start Opera"));
    }
View Full Code Here

  @Ignore(platforms = LINUX)
  public void environmentalBinaryPathWorks() throws IOException {
    File binary = new OperaBinary(OperaProduct.DESKTOP).getFile();
    environment.set(OperaBinary.OPERA_PATH_ENV_VAR, binary.getPath());

    driver = new TestOperaDesktopDriver();
    assertEquals(binary.getCanonicalPath(), driver.getSettings().getBinary().getCanonicalPath());
    assertEquals(binary.getCanonicalPath(), new File(driver.getOperaPath()).getCanonicalPath());
    assertEquals(binary.getCanonicalPath(), driver.utils().getBinaryPath());
  }
View Full Code Here

  @Test
  public void capabilitiesForDesktopAreCorrect() {
    capabilities.setCapability(NO_QUIT.getCapability(), true);

    driver = new TestOperaDesktopDriver(capabilities);

    Capabilities actual = driver.getSettings().toCapabilities();
    assertEquals(actual.getCapability(AUTOSTART.getCapability()), true);
    assertEquals(actual.getCapability(PRODUCT.getCapability()), OperaProduct.DESKTOP);
    assertEquals(actual.getCapability(NO_QUIT.getCapability()), true);
View Full Code Here

  @NeedsLocalEnvironment
  public void browserDoesNotQuit() {
    OperaSettings settings = new OperaSettings();
    settings.setDetach(true);

    driver = new TestOperaDesktopDriver(settings);
    int processID = driver.utils().getPID();
    driver.quit();

    // Driver should be shut down, and there should be no connection to browser
    assertFalse(driver.getServices().isConnected());
View Full Code Here

TOP

Related Classes of com.opera.core.systems.testing.drivers.TestOperaDesktopDriver

Copyright © 2018 www.massapicom. 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.