Junit fail method is not functioning as expected

53 Views Asked by At

I'm writing junit unit testcases with seetest tool. But i'm not able to use the fail function appropriately.

Even if i give fail() for a particular condition, my junit case still executes it as pass.

Here is my code:

client.setDevice("ios_app:iPhonel");
           client.launch("com.netsnapper.connect.Netsnapper-Connect", true, false);
           client.sleep(10000);
           client.click("default", "Logoutmenu", 0, 1);
           client.click("default", "About", 0, 1);
           String version = client.getTextIn("default", "version", 0, "NATIVE", "Inside", 560, 42);
           if((client.isElementFound("TEXT", "Key Features", 0)) && !(version != null && !version.isEmpty())){
              fail("failed");
           }

Even if the condition is satisified, it still shows as pass.

0

There are 0 best solutions below