<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>at.willhaben.willtest</groupId>
        <artifactId>willtest</artifactId>
        <version>2.2.2</version>
    </parent>

    <artifactId>examples</artifactId>
    <version>2.2.2</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Practical examples</description>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>misc</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>log4j</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>browserstack</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <driver.platform/>
        <driver.arch/>
        <driver.chrome.arch/>
        <driver.folder>${project.basedir}${file.separator}drivers${file.separator}</driver.folder>
        <geckodriver.version>0.24.0</geckodriver.version>
        <chromedriver.version>2.46</chromedriver.version>
        <driver.extension/>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <systemPropertyVariables>
                        <buildDirectory>${project.build.directory}</buildDirectory>
                        <webdriver.gecko.driver>
                            ${driver.folder}geckodriver-${driver.platform}-${driver.arch}bit${driver.extension}
                        </webdriver.gecko.driver>
                        <webdriver.chrome.driver>
                            ${driver.folder}chromedriver-${driver.platform}-${driver.chrome.arch}bit${driver.extension}
                        </webdriver.chrome.driver>
                    </systemPropertyVariables>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <driver.platform>mac</driver.platform>
                <driver.arch>64</driver.arch>
                <driver.chrome.arch>64</driver.chrome.arch>
            </properties>
        </profile>
        <profile>
            <id>linux</id>
            <activation>
                <os>
                    <family>unix</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <properties>
                <driver.platform>linux</driver.platform>
                <driver.arch>64</driver.arch>
                <driver.chrome.arch>64</driver.chrome.arch>
            </properties>
        </profile>
        <profile>
            <id>win32</id>
            <activation>
                <os>
                    <family>windows</family>
                    <arch>x86</arch>
                </os>
            </activation>
            <properties>
                <driver.platform>windows</driver.platform>
                <driver.arch>32</driver.arch>
                <driver.chrome.arch>32</driver.chrome.arch>
                <driver.extension>.exe</driver.extension>
            </properties>
        </profile>
        <profile>
            <id>win64</id>
            <activation>
                <os>
                    <family>windows</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <properties>
                <driver.platform>windows</driver.platform>
                <driver.arch>64</driver.arch>
                <driver.chrome.arch>32</driver.chrome.arch>
                <driver.extension>.exe</driver.extension>
            </properties>
        </profile>
        <profile>
            <id>download-drivers</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.webdriverextensions</groupId>
                        <artifactId>webdriverextensions-maven-plugin</artifactId>
                        <version>3.1.3</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>install-drivers</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <installationDirectory>${project.basedir}${file.separator}drivers</installationDirectory>
                            <drivers>
                                <driver>
                                    <name>geckodriver</name>
                                    <platform>${driver.platform}</platform>
                                    <bit>${driver.arch}</bit>
                                    <version>${geckodriver.version}</version>
                                </driver>
                                <driver>
                                    <name>chromedriver</name>
                                    <platform>${driver.platform}</platform>
                                    <bit>${driver.chrome.arch}</bit>
                                    <version>${chromedriver.version}</version>
                                </driver>
                            </drivers>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
