← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #205069]: Using type commands in test case (JUnit)

 

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

Martin D requested more information:
Ok. Back with some internet on my side (don't wonder about the different
user name, I had to create a new account on my phone, because I couldn't
remember the password).

I still have the problem. Thanks for the link, but I think I have one of
those random weird issues.

I have following test case. Sikuli is clicking on a location that I told
it to click onto. After the clicking an image will be displayed at that
location. Then Sikuli is supposed to click on that image and hit the
delete key (represented by unicode) and the image shouldn't be visible
anymore (assertFalse). The problem is that the test case works when it
is run on its own, but doesn't work if run with other test cases. I
don't really get why this is the case. I guess this is not a problem
with Sikuli?

        @Test
	public void testFunctionality() {
		try {
			Region region = new Region(585, 535, 0, 0);
                        // this is just for me to check, if I am looking at the correct region
			region.setW(70);
			region.setH(70);
			region.highlight(1);

			if (region.exists(this.image) != null) {
				region.click(this.location);
				region.click(this.newImage);
				this.screen.wait((double) 1);
				this.screen.type(null, "\ue006", 0);
				this.screen.wait((double) 1);
				assertFalse(this.screen.exists(this.newImage) != null);
			}
		} catch (FindFailed e) {
			fail("Test failed due to: " + e.getMessage());
		}
	}

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