/*
 * (C) Copyright 2015 Boni Garcia (http://bonigarcia.github.io/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package io.github.bonigarcia.wdm.test;

import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
import static org.junit.Assume.assumeTrue;

import java.io.File;

import org.junit.Before;
import org.openqa.selenium.opera.OperaDriver;
import org.openqa.selenium.opera.OperaOptions;

import io.github.bonigarcia.wdm.WebDriverManager;
import io.github.bonigarcia.wdm.base.BrowserTestParent;

/**
 * Test with Opera browser.
 *
 * @author Boni Garcia (boni.gg@gmail.com)
 * @since 1.0.0
 */
public class OperaTest extends BrowserTestParent {

    @Before
    public void setupTest() {
        File operaBinary = IS_OS_WINDOWS
                ? new File("C:\\Program Files\\Opera\\launcher.exe")
                : new File("/usr/bin/opera");
        assumeTrue(operaBinary.exists());

        WebDriverManager.operadriver().setup();
        OperaOptions options = new OperaOptions();
        options.setBinary(operaBinary);
        driver = new OperaDriver(options);
    }

}

@@ -749,16 +749,79 @@
 NDOWS;%0D%0A
+import static org.apache.commons.lang3.SystemUtils.IS_OS_MAC;%0D%0A
 import s
@@ -1325,20 +1325,22 @@
         
-File
+String
  operaBi
@@ -1379,25 +1379,16 @@
       ? 
-new File(
 %22C:%5C%5CPro
@@ -1419,17 +1419,16 @@
 her.exe%22
-)
 %0D%0A      
@@ -1443,33 +1443,154 @@
   : 
-new File(%22/usr/bin/opera%22
+IS_OS_MAC ? %22/Applications/Opera.app/Contents/MacOS/Opera%22%0D%0A                        : %22/usr/bin/opera%22;%0D%0A        File opera = new File(operaBinary
 );%0D%0A
@@ -1613,22 +1613,16 @@
 ue(opera
-Binary
 .exists(

Set Opera binary name also in Mac OS X