<?xml version="1.0" encoding="UTF-8"?>
<!-- JBoss, Home of Professional Open Source Copyright 2014, Red Hat, Inc.
    and/or its affiliates, and individual contributors by the @authors tag. See
    the copyright.txt in the distribution for a full listing of individual contributors.
    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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss.arquillian.graphene</groupId>
        <artifactId>graphene-parent</artifactId>
        <version>3.0.0-alpha.4</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>arquillian-browser-screenshooter</artifactId>
    <name>Graphene Screenshooter</name>
    <description>An extension to make screenshots during testing</description>

    <!-- Properties -->
    <properties>
        <version.recorder.screenshooter>1.1.6.Final</version.recorder.screenshooter>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <browser>chromeHeadless</browser>
        <remote>false</remote>
        <remoteReusable>false</remoteReusable>
        <remoteAddress>http://localhost:4444/wd/hub/</remoteAddress>

        <platform>ANY</platform>
        <browser.version>undefined</browser.version>

        <tomcat.version>7.0.55</tomcat.version>
        <tomcat.home>target/apache-tomcat-${tomcat.version}</tomcat.home>
        <arquillian.tomcat.version>1.1.0.Final</arquillian.tomcat.version>
        <version.jakarta.xml.bind>2.3.3</version.jakarta.xml.bind>
        <version.fest-assert>1.4</version.fest-assert>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.arquillian.extension</groupId>
            <artifactId>arquillian-recorder-screenshooter-impl-base</artifactId>
            <version>${version.recorder.screenshooter}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.arquillian.extension</groupId>
            <artifactId>arquillian-recorder-screenshooter-spi</artifactId>
            <version>${version.recorder.screenshooter}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.graphene</groupId>
            <artifactId>graphene-webdriver</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-webdriver</artifactId>
        </dependency>

        <!-- Arquillian JUnit -->
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- JUnit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <version>${version.fest-assert}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-tomcat-managed-7</artifactId>
            <version>${arquillian.tomcat.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>${version.jakarta.xml.bind}</version>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <excludes>
                                <exclude>**/when/*.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>when</id>
                        <configuration>
                            <excludes>
                                <exclude>**/ftest/*.java</exclude>
                            </excludes>
                            <systemPropertyVariables>
                                <browser>${browser}</browser>
                            </systemPropertyVariables>
                        </configuration>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.tomcat</groupId>
                                    <artifactId>tomcat</artifactId>
                                    <version>${tomcat.version}</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-tomcat-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${tomcat.home}/conf</outputDirectory>
                            <overwrite>true</overwrite>
                            <resources>
                                <resource>
                                    <directory>${basedir}/src/test/resources/tomcat</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>webdriver-chrome</id>
            <properties>
                <browser>chrome</browser>
            </properties>
        </profile>

        <profile>
            <id>webdriver-htmlUnit</id>
            <properties>
                <browser>htmlUnit</browser>
            </properties>
        </profile>

        <profile>
            <id>webdriver-firefox</id>
            <properties>
                <browser>firefox</browser>
            </properties>
        </profile>

        <profile>
            <id>webdriver-opera</id>
            <properties>
                <browser>opera</browser>
            </properties>
        </profile>

        <profile>
            <id>webdriver-remote-reusable</id>
            <properties>
                <remoteReusable>true</remoteReusable>
                <remote>true</remote>
            </properties>
        </profile>

    </profiles>

</project>
