Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Schneck committed Apr 11, 2018
2 parents 1caf615 + ee1ac8c commit b4def80
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 48 deletions.
78 changes: 43 additions & 35 deletions docs/manual/execution/maven/java-DSL.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,47 @@ git-link:{page-path}{git-view} | git-link:{page-path}{git-edit}

Sakuli provides a Java DSL for writing test cases in pure Java. The DSL is designed as fluent API and provides the exact same capabilities as the Javascript API. The Sakuli Java API enables users to write Sakuli tests in pure Java unit tests using JUnit or TestNG. The good news about that is that you are able to access any native application UI with screen related actions as easy as in JavaScript API.


===== Installation


====== Preparation
. Ensure that all installation packages for target OS are installed:

* <<linux>>
* <<windows>>

. Install Java Development Kit version 8.
. Install Maven (Version 3.2.5 or higher).
. Download `java-example` directory from https://github.com/ConSol/sakuli-examples/tree/master/java-example[github.com/ConSol/sakuli-examples].

====== Project setup and compilation

. Import `java-example` to IDE (IntelliJ or Eclipse…) as Maven project:
*Example for IntelliJ:*
. Choose `Project from Existing Sources...` in File menu.
. Choose `pom.xml` and click `next` button till the project is imported.


Try to *compile* the new Sakuli Maven project. If an *ERROR* is reported please check your `pom.xml` first. The following section has to be present in your Maven POM:

[source,xml]
----
<repository>
<id>labs-consol-snapshots</id>
<name>ConSol* Labs Repository</name>
<url>http://labs.consol.de/maven/snapshots-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
----

The ConSol labs Maven repository should be placed to the *repositories* section in your POM.

===== Usage

The Sakuli Java DSL comes to you as Maven module JAR file. You can add the module to your Sakuli project as Maven dependency. Currently the Java tests have to be written with the http://testng.org[TestNG] unit framework, so also provide the http://testng.org[TestNG] Maven dependency in your project POM:
Expand Down Expand Up @@ -153,40 +194,7 @@ sample test case. So at the end of this chapter you should be able to start writ
An example how to use Java DSL and setup Maven you will find at:
*https://github.com/ConSol/sakuli-examples/tree/master/java-example[github.com/ConSol/sakuli-examples]*

===== Installation

====== Preparation

. Install Java Development Kit version 8.
. Install Maven (Version 3.2.5 or higher).
. Download `java-example` directory from https://github.com/ConSol/sakuli-examples/tree/master/java-example[github.com/ConSol/sakuli-examples].

====== Project setup and compilation

. Import `java-example` to IDE (IntelliJ or Eclipse…) as Maven project:
*Example for IntelliJ:*
. Choose `Project from Existing Sources...` in File menu.
. Choose `pom.xml` and click `next` button till the project is imported.


Try to *compile* the new Sakuli Maven project. If an *ERROR* is reported please check your `pom.xml` first. The following section has to be present in your Maven POM:

[source,xml]
----
<repository>
<id>labs-consol-snapshots</id>
<name>ConSol* Labs Repository</name>
<url>http://labs.consol.de/maven/snapshots-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
----

The ConSol labs Maven repository should be placed to the *repositories* section in your POM. After this is done please execute the Maven *compile* phase.
After this is done please execute the Maven *compile* phase.

====== Test execute

Expand Down Expand Up @@ -263,5 +271,5 @@ Now you can execute *test* phase and enjoy the successful execution of the test.
[[java-dsl-https]]
===== HTTPS-Sites

As workaround for issue https://github.com/ConSol/sakuli/issues/131[#131] you can follow the intructions of <<sahi-https>> and copy afterwards the files from `java-example/target/classes/sahi/userdata/certs` to `java-example/src/main/resources/sahi/userdata/certs`. This will copy the trusted certificates when building the project and allows a clean run. Also see <<sahi-https-automatic-certificate-usage>> which files have to been copied for running the tests on different host.
As workaround for issue https://github.com/ConSol/sakuli/issues/131[#131] you can follow the instructions of <<sahi-https>> and copy afterwards the files from `java-example/target/classes/sahi/userdata/certs` to `java-example/src/main/resources/sahi/userdata/certs`. This will copy the trusted certificates when building the project and allows a clean run. Also see <<sahi-https-automatic-certificate-usage>> which files have to been copied for running the tests on different host.

2 changes: 1 addition & 1 deletion docs/manual/execution/native/linux-native-headless.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Starting applications specified in __HOME__/.vnc/xstartup
Log file is __HOME__/.vnc/sakulidemo:1.log
----

`.vnc/xstartup` controls what to start within a xvnc session. Do not touch this file on OpenSUSE; on *Ubuntu* you have to replace its content with the following lines (because you are using *gnome-session-fallback*, aren't you…?):
`.vnc/xstartup` controls what to start within a xvnc session. Do not touch this file on OpenSUSE; on *Ubuntu* you have to replace its content with the following lines (because you are using <<gnome-session-flashback>>, aren't you…?):

[source,bash]
----
Expand Down
20 changes: 15 additions & 5 deletions docs/manual/execution/native/linux-troubleshooting.adoc
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@

:imagesdir: ../../../images

[[linux-troubleshooting]]
===== Troubleshooting
[#git-edit-section]
:page-path: docs/manual/execution/native/linux-troubleshooting.adoc
git-link:{page-path}{git-view} | git-link:{page-path}{git-edit}

If you have some errors with your Linux installation, you can check the following points:

[[gnome-session-fallback]]
====== Install GNOME session fallback theme
[[gnome-session-flashback]]
====== Install GNOME session flashback theme

Sakuli can test on Unity, of course - but https://apps.ubuntu.com/cat/applications/gnome-session-fallback/[gnome-session-fallback] is more than sufficient…
NOTE: Before Ubuntu 16.04 the package name was `gnome-session-fallback`

`sudo apt-get install gnome-session-fallback`
Sakuli can test on Unity, of course - but https://wiki.ubuntuusers.de/GNOME_Flashback[gnome-session-flashback] is more than sufficient and has the advantage that 3D effects and shadowing won't break your test.

After the installation, relogin and select the desktop environment *GNOME Flashback (Metacity)*:
Install and set `gnome-seesion-flashback` as default:
[source,bash]
----
apt-get update
apt-get install -y gnome-session-flashback
echo "[SeatDefaults]" >> /etc/lightdm/lightdm.conf
echo "user-session=gnome-flashback-metacity" >> /etc/lightdm/lightdm.conf
----

After the installation, relogin/restart and ensure that the desktop environment *GNOME Flashback (Metacity)* is selected:

image:u_theme_select.jpg[fallback]

Expand Down
9 changes: 5 additions & 4 deletions docs/manual/execution/native/linux.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ You can run Sakuli on physical as well as on virtual Linux machines.
* Run Sakuli with a dedicated user
* Sakuli needs a reliable and predictable desktop environment: make sure that there are no pop-up windows of services or applications
* If Sakuli is running within a VM, change the desktop resolution to a fixed value (e.g. 1024x768) and disable any auto-resizing mechanisms of the guest display. This ensures that the guest's resolution does not change in case that you resize its window.
* Other optional steps see <<gnome-session-fallback>>.
* the client should *not* have more than one physical screen
* Ensure that now 3D effects or shadowing break your test. For Ubuntu e.g. it's recommended to use <<gnome-session-flashback,`gnome-session-flashback`>> theme.
* Ensure that the client should have only *ONE* physical screen.
* Other optional steps see <<linux-troubleshooting>>.

====== Sakuli installation

* Download the *Sakuli Installer* from http://labs.consol.de/sakuli/install[http://labs.consol.de/sakuli/install]
* current *development* snapshot = `sakuli-vX.X.X-SNAPSHOT-installer.jar`
* current *stable* version = `sakuli-vX.X.X-installer.jar` (recommended)
** current *development* snapshot = `sakuli-vX.X.X-SNAPSHOT-installer.jar`
** current *stable* version = `sakuli-vX.X.X-installer.jar` (recommended)

Execute `java -jar sakuli-vX.X.X-installer.jar` to start the installer:

Expand Down
3 changes: 3 additions & 0 deletions docs/manual/execution/native/windows-troubleshooting.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@

:imagesdir: ../../../images

[[windows-troubleshooting]]
===== Troubleshooting
[#git-edit-section]
:page-path: docs/manual/execution/native/windows-troubleshooting.adoc
git-link:{page-path}{git-view} | git-link:{page-path}{git-edit}

If you have some errors with your Windows installation, you can check the following points:

[[windows-classic-theme]]
====== Change Windows theme and title bar colors

Windows 7 comes by default with an "aero" theme, which is quite awkward for Sikuli, because there are many transparency effects which cause window elements to change their appearance dependend on the elements below. For that, change the theme to "Windows Classic".
Expand Down
8 changes: 5 additions & 3 deletions docs/manual/execution/native/windows.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ You can run Sakuli on physical as well as on virtual Linux machines.
* Run Sakuli with a dedicated user
* Sakuli needs a reliable and predictable desktop environment: make sure that there are no pop-up windows of services or applications
* If Sakuli is running within a VM, change the desktop resolution to a fixed value (e.g. 1024x768) and disable any auto-resizing mechanisms of the guest display. This ensures that the guest's resolution does not change in case that you resize its window.
* the client should *not* have more than one physical screen
* Ensure that now 3D effects or shadowing break your test. For Window 7 e.g. it's recommended to use <<windows-classic-theme, Windos Classic theme>>.
* Ensure that the client should have only *ONE* physical screen.
* Other optional steps see <<windows-troubleshooting>>.

====== Sakuli installation

* Download the *Sakuli Installer* from http://labs.consol.de/sakuli/install[http://labs.consol.de/sakuli/install]
* current *development* snapshot = `sakuli-vX.X.X-SNAPSHOT-installer.jar`
* current *stable* version = `sakuli-vX.X.X-installer.jar` (recommended)
** current *development* snapshot = `sakuli-vX.X.X-SNAPSHOT-installer.jar`
** current *stable* version = `sakuli-vX.X.X-installer.jar` (recommended)

Double-click on the downloaded .jar file to start the installer:

Expand Down

0 comments on commit b4def80

Please sign in to comment.