@Test
 public void testSaveScreenshot() {
   runner = new OperaLauncherRunner(settings);
   ScreenShotReply screenshot = runner.saveScreenshot(0);
   assertNotNull(screenshot);
   runner.shutdown();
 }
 @Test(expected = OperaRunnerException.class)
 public void testShutdownLauncher() {
   runner = new OperaLauncherRunner(settings);
   runner.shutdown();
   // Expecting OperaRunnerException as we tried to start Opera when launcher isn't running
   runner.startOpera();
 }
 @Test
 public void testStartAndStopOpera() {
   runner = new OperaLauncherRunner(settings);
   runner.startOpera();
   assertTrue(runner.isOperaRunning());
   runner.stopOpera();
   assertFalse(runner.isOperaRunning());
 }
 @After
 public void afterEach() {
   if (runner != null && runner.isOperaRunning()) {
     runner.stopOpera();
     runner.shutdown();
     assertFalse(runner.isOperaRunning());
   }
 }
 @Test
 // TODO(andreastt): Trigger something which actually generates a crashlog
 public void testGetOperaDefaultCrashlog() {
   runner = new OperaLauncherRunner(settings);
   runner.startOpera();
   String crashlog = runner.getOperaCrashlog();
   assertNull(crashlog);
 }
 @Test
 public void testDoubleShutdown() {
   runner = new OperaLauncherRunner(settings);
   runner.stopOpera();
   runner.shutdown();
   // verify that a second shutdown call doesn't do any harm (shouldn't)
   runner.shutdown();
 }
  @Test
  @Ignore(products = DESKTOP, value = "mzajaczkowski_watir_1_cleaned contains fix for this")
  public void testStartAndStopOperaTenTimes() {
    runner = new OperaLauncherRunner(settings);

    for (int i = 0; i < 10; i++) {
      runner.startOpera();
      assertTrue(runner.isOperaRunning());
      runner.stopOpera();
      assertFalse(runner.isOperaRunning());
    }

    runner.shutdown();
  }
 @Test
 public void launcherReturnsLauncherLocationByDefault() {
   assertNotNull(settings.getLauncher());
   assertEquals(OperaLauncherRunner.launcherDefaultLocation(), settings.getLauncher());
 }
 @Test
 public void testDefaultIsOperaRunning() {
   runner = new OperaLauncherRunner(settings);
   assertFalse(runner.isOperaRunning());
 }
 @Test
 public void testDefaultCrashedState() {
   runner = new OperaLauncherRunner(settings);
   assertFalse(runner.hasOperaCrashed());
 }
 public static Level toLauncherLoggingLevel(Level javaLevel) {
   return OperaLauncherRunner.toLauncherLoggingLevel(javaLevel);
 }
 @Test
 public void testConstructorWithSettingsArguments() {
   runner = new OperaLauncherRunner(settings);
   runner.startOpera();
   assertTrue(runner.isOperaRunning());
 }