Skip to content

Commit

Permalink
* Added interfaces for Sikuli actions: WaitForSikuliImage & ClickSiku…
Browse files Browse the repository at this point in the history
…liImage

* removed SikuliImageExists
* published new selenate verison to 0.2.17
  • Loading branch information
Drazen Bandic committed Oct 9, 2014
1 parent 21b5e90 commit 83fa0cf
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 82 deletions.
Expand Up @@ -9,7 +9,6 @@
import net.selenate.common.comms.req.*;
import net.selenate.common.comms.res.*;
import net.selenate.common.user.*;

import akka.actor.ActorRef;

public class ActorBrowser extends ActorBase implements IBrowser {
Expand Down Expand Up @@ -245,4 +244,14 @@ public BrowserPage waitForAnyPage(List<BrowserPage> pageList) throws IOException
public void setAutoFrames(final Boolean useFrames) throws IOException {
typedBlock(new SeReqSetUseFrames(useFrames), SeResSetUseFrames.class);
}

public boolean waitForSikuliImage(final byte[] image) throws IOException {
final SeResWaitForSikuliImage res = typedBlock(new SeReqWaitForSikuliImage(image, 30000), SeResWaitForSikuliImage.class);
return res.isImageFound();
}

public void clickSikuliImage(final byte[] image) throws IOException {
typedBlock(new SeReqClickSikuliImage(image, 30000), SeResClickSikuliImage.class);
}

}

This file was deleted.

This file was deleted.

Expand Up @@ -3,11 +3,18 @@
public class SeResWaitForSikuliImage implements SeCommsRes {
private static final long serialVersionUID = 1L;

public SeResWaitForSikuliImage() {
private boolean isImageFound;

public SeResWaitForSikuliImage(final boolean isImageFound) {
this.isImageFound = isImageFound;
}

public boolean isImageFound() {
return isImageFound;
}

@Override
public String toString() {
return String.format("SeResWaitForSikuliImage()");
return String.format("SeResWaitForSikuliImage(%s)", isImageFound);
}
}
Expand Up @@ -50,7 +50,6 @@ class SessionActor(sessionID: String, profile: DriverProfile, useFrames: Boolean
case arg: SeReqResetFrame => new ResetFrameAction(d).act(arg)
case arg: SeReqSelectOption => new SelectOptionAction(d).act(arg)
case arg: SeReqSetUseFrames => new SetUseFramesAction(d).act(arg)
case arg: SeReqSikuliImageExists => new SikuliImageExistsAction(d).act(arg)
case arg: SeReqStartKeepalive => new StartKeepaliveAction(d).act(arg)
case arg: SeReqStopKeepalive => new StopKeepaliveAction(d).act(arg)
case arg: SeReqSwitchFrame => new SwitchFrameAction(d).act(arg)
Expand Down

This file was deleted.

Expand Up @@ -24,6 +24,8 @@ class WaitForSikuliImageAction(val d: FirefoxDriver) extends IAction[SeReqWaitFo
val desktop = new DesktopScreenRegion()
val region = desktop.wait(target, arg.timeoutMillis)

new SeResWaitForSikuliImage()
val isImageFound = region != null

new SeResWaitForSikuliImage(isImageFound)
}
}
4 changes: 2 additions & 2 deletions code/project/Settings.scala
Expand Up @@ -57,7 +57,7 @@ object Default {
//, "-Yinline"
//, "-Yinline-warnings"
, "-Xmax-classfile-name", "72"
, "-Yrepl-sync"
, "-Yrepl-sync"
, "-Xlint"
, "-Xverify"
, "-Ywarn-all"
Expand All @@ -74,7 +74,7 @@ object Default {
Seq(
name := Name,
organization := "net.selenate",
version := "0.2.16",
version := "0.2.17",
scalaVersion := "2.10.2",
unmanagedSourceDirectories in Test := Nil
)
Expand Down

0 comments on commit 83fa0cf

Please sign in to comment.