<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<sect1 id="automated_gui_testing">
	<title>Automated GUI Testing</title>
	<sect2>
	<title>Getting started</title>
		<para>This section describes the required steps to run existing or create new automated GUI tests
			for RCE using the RCP Testing Tools (RCPTT): </para>
		<itemizedlist>
			<listitem>
				<para>Download RCPTT from <ulink url="https://eclipse.org/rcptt/download/"
						>https://eclipse.org/rcptt/download/</ulink></para>
			</listitem>
			<listitem>
				<para>Download RCE from <ulink url="https://rcenvironment.de/pages/download.html"
						>https://rcenvironment.de/pages/download.html</ulink></para>
			</listitem>
			<listitem>
				<para>Start RCPTT</para>
			</listitem>
		</itemizedlist>
		<itemizedlist>
			<listitem>
				<para>In the view "Applications" add RCE as Application under test (AUT) via "New...
					". Use RCE's main folder as location.</para>
			</listitem>
			<listitem>
				<para>Configure AUT (Rightclick on entry in "Applications" view -&gt; Configure...
					-&gt; Advanced...):</para>
			</listitem>
		</itemizedlist>
		<orderedlist>
			<listitem><emphasis role="bold">Set a profile </emphasis>different from the default one
				to make sure your productive RCEs won't interfere with RCPTT's RCE and vice versa.
				Therefore go to "Arguments" tab and add to Program arguments e.g "-p
				my_rcptt_profile".</listitem>
			<listitem><emphasis role="bold">Set dev_config: </emphasis>Download from dev_config.ini
					from<emphasis role="bold"> </emphasis><ulink
					url="https://svn.sistec.dlr.de/svn/rce/new/rce/trunk/de.rcenvironment/eclipse/launch/installation_data/dev_config.ini"
					>https://svn.sistec.dlr.de/svn/rce/new/rce/trunk/de.rcenvironment/eclipse/launch/installation_data/</ulink><para>In
					"Configuration" tab select "Use an existing config.ini file as a template" and
					navigate to the file you just downloaded.</para></listitem>
			<listitem><emphasis role="bold">Set launcher: </emphasis>In "Arguments" tab add the
				following VM argument:
				"-Dde.rcenvironment.launcher=de.rcenvironment.launcher"</listitem>
			<listitem><emphasis role="bold">Set allocate console for StdIn and StdOut: </emphasis>To
				access StdIn and StdOut directly from console view in RCPTT go to "Common" tab and
				check "Allocate console (necessary for input)</listitem>
		</orderedlist>
		<itemizedlist>
			<listitem>
				<para>Check if RCE can be started from RCPTT by double clicking on the entry in the
					"Applications" view</para>
			</listitem>
		</itemizedlist>
		<itemizedlist>
			<listitem>
				<para>Now you can either run existing test cases (A) or create your own test cases
					(B):</para>
			</listitem>
		</itemizedlist>
		<para><emphasis role="bold">A: Run existing test cases:</emphasis></para>
		<itemizedlist>
			<listitem>
				<para>Create an <emphasis role="bold">RCP Testing Tool Project</emphasis> in the
					Test Explorer on the lefthand side</para>
			</listitem>
			<listitem>
				<para>Checkout the following folder and add it to the project: <ulink
						url="https://svn.sistec.dlr.de/svn/rce/new/rce/trunk/de.rcenvironment/eclipse/ui-testing/RCPTT"
						>https://svn.sistec.dlr.de/svn/rce/new/rce/trunk/de.rcenvironment/eclipse/ui-testing/RCPTT</ulink></para>
			</listitem>
			<listitem>
				<para>In the folder "Testsuites" navigate to "AllPlatforms" and execute the
					testsuite (Rightclick -&gt; Run As -&gt; Test Cases)</para>
			</listitem>
			<listitem>
				<para>Find the Execution View on the bottom left which shows the progress of the
					testcases</para>
			</listitem>
			<listitem>
				<para>Do the same for the testsuite that matches your platform.</para>
			</listitem>
		</itemizedlist>
		<para><emphasis role="bold">B: Create your own test cases:</emphasis></para>
		<itemizedlist>
			<listitem>
				<para>For the next steps also refer to RCPTT's getting started guide: <ulink
						url="https://www.eclipse.org/rcptt/documentation/userguide/getstarted/"
						>https://www.eclipse.org/rcptt/documentation/userguide/getstarted/</ulink></para>
			</listitem>
			<listitem>
				<para>Create an <emphasis role="bold">RCP Testing Tool Project</emphasis> in the
					Test Explorer on the lefthand side</para>
			</listitem>
			<listitem>
				<para>Create a <emphasis role="bold">Test Case</emphasis> within this project</para>
			</listitem>
			<listitem><emphasis role="bold">Capture script </emphasis>via "Record" button in the
				upper right corner and then clicking around in RCE</listitem>
			<listitem><emphasis role="bold">Capture verification </emphasis>by switching to
				Assertion Mode in the menu bar of the Control Panel and then selecting some element
				in RCE</listitem>
			<listitem>
				<para>Click save, stopp and then the Return to RCPTT/Home button</para>
			</listitem>
			<listitem>
				<para>Create a <emphasis role="bold">Context</emphasis> within the project (New
					-&gt; Context). Contexts are proconditions for tests, e.g. to make sure there is
					a clean setup. For instance, choose a context of type "Workspace" an leave the
					default settings so it will clear the workspace upon being applied.</para>
			</listitem>
			<listitem>
				<para>Add the context to the test case by selecting the "Contexts" tab in the test
					case, click "+" and choose the one you just created.</para>
			</listitem>
			<listitem><emphasis role="bold">Replay script </emphasis>by clicking "Replay" in the
				upper right corner.</listitem>
		</itemizedlist>
		<para> </para>
	</sect2>
</sect1>
