/*
 * (C) Copyright 2019 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 java.lang.invoke.MethodHandles.lookup;
import static java.util.Arrays.asList;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;
import static org.slf4j.LoggerFactory.getLogger;

import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.slf4j.Logger;

import io.github.bonigarcia.wdm.WebDriverManager;

/**
 * Test latest version of edgedriver.
 *
 * @author Boni Garcia (boni.gg@gmail.com)
 * @since 3.6.0
 */
@RunWith(Parameterized.class)
public class LatestAndBetaTest {

    final Logger log = getLogger(lookup().lookupClass());

    @Parameter
    public Class<? extends WebDriver> driverClass;

    @Parameters(name = "{index}: {0}")
    public static Collection<Object[]> data() {
        return asList(new Object[][] { { ChromeDriver.class },
                { EdgeDriver.class } });
    }

    @Test
    public void testLatestAndBetaedgedriver() {
        WebDriverManager.getInstance(driverClass).avoidPreferences()
                .avoidAutoVersion().setup();
        String edgedriverStable = WebDriverManager.getInstance(driverClass)
                .getDownloadedVersion();
        log.debug("edgedriver LATEST version: {}", edgedriverStable);

        WebDriverManager.getInstance(driverClass).avoidPreferences()
                .avoidAutoVersion().useBetaVersions().setup();
        String edgedriverBeta = WebDriverManager.getInstance(driverClass)
                .getDownloadedVersion();
        log.debug("edgedriver BETA version: {}", edgedriverBeta);

        assertThat(edgedriverStable, not(equalTo(edgedriverBeta)));
    }

}

@@ -664,16 +664,76 @@
 .test;%0A%0A
+import static io.github.bonigarcia.wdm.OperatingSystem.WIN;%0A
 import s
@@ -777,16 +777,16 @@
 lookup;%0A
-
 import s
@@ -1380,24 +1380,73 @@
 4j.Logger;%0A%0A
+import io.github.bonigarcia.wdm.OperatingSystem;%0A
 import io.gi
@@ -2143,16 +2143,37 @@
 rsion().
+operatingSystem(WIN).
 setup();
@@ -2422,32 +2422,32 @@
 idPreferences()%0A
-
                 
@@ -2483,16 +2483,54 @@
 rsions()
+.operatingSystem(WIN)%0A                
 .setup()

Set operating system in latest and beta test