Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
#20 update documentation generation process, update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Weisgrab committed Oct 15, 2019
1 parent 1bdbb28 commit a50b7f2
Show file tree
Hide file tree
Showing 4 changed files with 428 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@ buildNumber.properties
*/surefire-reports/*

### Drivers ###
*/drivers
*/drivers

.generated
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
# willtest

[![Build Status](https://travis-ci.org/willhaben/willtest.svg?branch=master)](https://travis-ci.org/willhaben/willtest)
[![Maven Central](https://img.shields.io/maven-central/v/at.willhaben.willtest/core)](https://mvnrepository.com/artifact/at.willhaben.willtest)

## Overview
Willtest makes integrating JUnit and Selenium easier with providing a set of
[JUinit Extension](https://github.com/junit-team/junit4/wiki/Rules) and other utility classes which let you complete tasks
like:
[JUnit Extension](https://junit.org/junit5/docs/current/user-guide/#extensions) and other utility classes which let you
complete tasks like:
* Managing lifecycle of WebDriver instances
* Reporting capabilities like saving logs, screenshots and HTML source
* Fetching information from javascript alerts and errors
* Supporting uploading of any file from file system or classpath
* Abstract PageObject with some common functions
* Main browsers are supported (Firefox, Chrome, Edge, InternetExplorer)
* Support for mobile tests with appium (Android, iOS)

## Requirements
* Currently Selenium 3.14.0 is used
* Firefox local and on Selenium Hub is supported. Adding new Browsers is easily possible with implementing the ```SeleniumProvider``` interface.
* Java 8
* Currently Selenium [3.14.0] is used
* JUnit 5 with version [5.5.2] is used

## Getting Started
The code is built up from several small building blocks. There is a default setting we are using, which can be used
is represented by the class ```SeleniumRule```. To utilize that, the following dependencies have to be added to the
maven project:
The code is built up from several small building blocks. Only the ```core``` module is needed to start start
writing browser tests. Nevertheless the ```misc``` module will speed up development with some helper classes
and an abstract ```PageObject``` which can be extended.

```xml
<dependency>
<groupId>at.willhaben.willtest</groupId>
<artifactId>core</artifactId>
<version>${willtest.version}</version>
<version>2.2.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>at.willhaben.willtest</groupId>
<artifactId>misc</artifactId>
<version>${willtest.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>at.willhaben.willtest</groupId>
<artifactId>log4j</artifactId>
<version>${willtest.version}</version>
<version>2.2.2</version>
<scope>compile</scope>
</dependency>
```
Expand Down
52 changes: 51 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.selenium>3.14.0</version.selenium>
<junit-jupiter-engine.version>5.4.0</junit-jupiter-engine.version>
<junit-jupiter-engine.version>5.5.2</junit-jupiter-engine.version>
<log4j-core.version>2.11.1</log4j-core.version>
<version.log4j>1.2.16</version.log4j>
</properties>
Expand Down Expand Up @@ -262,6 +262,56 @@
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>

<!-- used to generate a readme with the actual properties from the pom -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Copy readme from template to normal one</echo>
<copy quiet="true" failonerror="false" overwrite="true"
file="${project.basedir}${file.separator}readme-md-template.md"
tofile="${project.basedir}${file.separator}.generated${file.separator}README.md"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>readme-md</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/.generated</directory>
<includes>
<include>README.md</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<encoding>UTF-8</encoding>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Loading

0 comments on commit a50b7f2

Please sign in to comment.