← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #185713]: Using Sikuli in Maven projects

 

Question #185713 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/185713

Description changed to:
----------------------- solution for version 1.0.1 +
With version 1.0.1 and later, it is recommended, to use sikuli-java.jar with Java programming.

Use option 3 with setup and rename the resulting sikuli-java.jar to
sikuli-java-1.0.1.jar

and load it into your local Maven repository to use this dependency:
<dependency>
  <groupId>org.sikuli</groupId>
  <artifactId>sikuli-java</artifactId>
  <version>1.0.1</version>
</dependency>

-------------------------------------------------------------------------

the rest of this thread is related to RC3 !!

-------------------------------------------------------------------------

I am currently using Sikuli and really liking what I see. I have created
a Maven project from within Eclipse.  Within this project I've setup a
POM file that leverages Cucumber-jvm as a dependency.  I'm using
Cucumber in conjunction with Sikuli to test a Windows app.  So, far
things are working well.  When I want to run my tests, I do so from
Eclipse using a JUnit test.  I'm using the built-in Windows control
panel application (control.exe) as the application under test.  Here is
a sample of my code

public class ControlPanelStepDefs {
	private String executable = "control.exe";
	private Screen scrn;
	private Match match;

	@Before
	public void setup() {		
		scrn = new Screen();
	}
	
	@After
	public void teardown() {
		try {
			scrn.click("images/XButton.png");
		} catch (FindFailed e) {
			e.printStackTrace();
		}
	}
	
	@Given("^a user wants to access their Windows programs$")
	public void a_user_wants_to_access_their_Windows_programs() {
	    // Express the Regexp above with the code you wish you had
	}

	@When("^the user opens the control panel$")
	public void the_user_opens_the_control_panel() {
		App.open(executable);
	}

	@When("^selects Programs from the computer's settings$")
	public void selects_Programs_from_the_computer_s_settings() {
	    try {
			scrn.click("images/Programs.png");
		} catch (FindFailed e) {
			e.printStackTrace();
		}
	}

	@Then("^the Programs view is displayed$")
	public void the_Programs_view_is_displayed() {
	    match = scrn.exists("images/DocLibrary.png");
	    
	    Assert.assertNotNull("FAILED assertion: the image, 'images/DocLibrary.png', does not exist.", match);
	}
	
	
}


When I run my test from the command-line using Maven like so

mvn clean test

It reports back that it cannot compile my code.  I'm thinking that
because the sikuli-script.jar file was added to the project as an
external jar, it cannot compile the code because Maven can't find the
jar in its local repositories.  Has anyone encountered something like
this.  How would I run my project from the command line using Maven?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.