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

Commit

Permalink
Slides and content - part 11
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusTiede committed Oct 14, 2017
1 parent 358e7c0 commit 07eef6c
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 2 deletions.
87 changes: 85 additions & 2 deletions docs/slides/03_Advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,93 @@ <h2>advanced topics</h2>
<section data-background="#E5F3F9">
<h2>Topics</h2>
<p class="fragment grow">UI Toolkits</p>
<p class="fragment grow">Event Handling</p>
<p class="fragment grow">Screenshots</p>
<p class="fragment grow">Object Mapping heuristic</p>
<p class="fragment grow">Exception Handling</p>
<p class="fragment grow">Screenshots</p>
</section>
<section>
<section data-background="#E5F3F9">
<h2>UI Toolkits</h2>
<img src="../img/tk-idea.png">
</section>
<section data-background="#E5F3F9">
<h2>On API level</h2>
<h3>one OSGi bundle per toolkit</h3>
<pre><code data-trim data-noescape>
META-INF\MANIFEST.MF:

org.eclipse.jubula.toolkit.base.api
org.eclipse.jubula.toolkit.concrete.api
org.eclipse.jubula.toolkit.javafx.api
[...]
org.eclipse.jubula.toolkit.swt.api
org.eclipse.jubula.toolkit.rcp.api
org.eclipse.jubula.toolkit.gef.api
org.eclipse.jubula.toolkit.swing.api
org.eclipse.jubula.toolkit.html.api
</code></pre>
</section>
<section data-background="#E8F9E5">
<h2>Exercise06.java</h2>
<h3>Compare with Exercise04.java</h3>
<pre><code data-trim data-noescape>
@Test
public void testAbstract() {
[...]
}</code></pre>
<h3>run Exercise06.java</h3>
<h2 class="fragment fade-up"><b>DEMO</b>nstrate</h2>
</section>
</section>
<section>
<section data-background="#E5F3F9">
<h2>Object Mapping heuristic</h2>
<img src="../img/om-profile.png">
<pre class="fragment fade-up"><code data-trim data-noescape>
Profile myProfile = MakeR.getProfileFactory()
.createProfile(name, nameWeight, pathWeight,
contextWeight, threshold);
ensembleSearchCI.setProfile(myProfile);</code></pre>
</section>
</section>
<section>
<section data-background="#E5F3F9">
<h2>Exception Handling</h2>
<img src="../img/exceptions.png">
<pre class="fragment fade-up"><code data-trim data-noescape>
ActionE: problems with A in CAP
CheckFailedE: unexpected result in "check"-CAP
ComponentNotFoundE: problems finding C in CAP
ConfigurationE: internal; should not occur</code></pre>
</section>
<section data-background="#E8F9E5">
<h2>Exercise07.java</h2>
<pre><code data-trim data-noescape>
@Test(expected = CheckFailedException.class)
public void testCheckFailedException() {
[...]
}</code></pre>
<h3>run Exercise07.java</h3>
<h2 class="fragment fade-up"><b>DEMO</b>nstrate</h2>
<h2 class="fragment fade-up"><b>Note:</b> no hard JUnit dependency</h2>
</section>
</section>
<section>
<section data-background="#E5F3F9">
<h2>Screenshots</h2>
<pre><code data-trim data-noescape>
// either RAW on client side
[...]
BufferedImage screenshot = aut.getScreenshot();

// or as file on AUT side
[...]
aut.execute(JavafxComponents.createStage()
.takeScreenshot(destination, delay,
fileAccess, scalingFactor,
createDirectories), payload);</code></pre>
</section>
</section>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.eclipse.jubula.examples.api.jdk.javafx.ensemble.osgi/src/org/eclipse/jubula/examples/api/jdk/javafx/ensemble/osgi/Exercise07.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jubula.examples.api.jdk.javafx.ensemble.osgi.Exercise07"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jubula.examples.api.jdk.javafx.ensemble.osgi"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright (c) 2017 Markus Tiede
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Tiede - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.jubula.examples.api.jdk.javafx.ensemble.osgi;

import org.eclipse.jubula.client.exceptions.ActionException;
import org.eclipse.jubula.client.exceptions.CheckFailedException;
import org.eclipse.jubula.communication.CAP;
import org.eclipse.jubula.toolkit.concrete.components.Application;
import org.eclipse.jubula.toolkit.enums.ValueSets.Operator;
import org.eclipse.jubula.toolkit.javafx.JavafxComponents;
import org.junit.Test;

public class Exercise07 extends Exercise02 {
@Test(expected = ActionException.class)
public void testActionException() {
Application app = JavafxComponents.createStage();
CAP waitForWindow = app.waitForWindow(".*Ensmble.*",
Operator.matches,
1 * 1000,
1000);
aut.execute(waitForWindow, null);
}

@Test(expected = CheckFailedException.class)
public void testCheckFailedException() {
Application app = JavafxComponents.createStage();
CAP waitForWindow = app.checkExistenceOfWindow(".*Ensmble.*",
Operator.matches,
true,
1000);
aut.execute(waitForWindow, null);
}
}

0 comments on commit 07eef6c

Please sign in to comment.