← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #662065]: Failed test cases are displayed under Error on HTML test Report

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
The snippet in comment #4 is not a unittest setup.

Apparently you are using import in Login_Main.sikuli to run this
snippet.

Using assert in a non-unittest setup throws AssertionError (catched by
unittest in a unittest setup), so you get the traceback.

You have to decide, to either use unitttesting or your own setup without
unittesting.

See the other question, where someone else brought himself on the wrong way and my suggestion how to proceed:
https://answers.launchpad.net/sikuli/+question/663899

BTW: do not use import to run other snippets, that is not according to
the design of Python.

your case:

# LoginTest.sikuli
from sikuli import *
import IL #importing image library
import Env_Var #importing environment variable

def loginTest():
  try:
      wait("Login",15)#wait for login screen
      #enter email ID
      type(find("Email").below(25), "Test ID")
      #enter password
      type(find("Password").below(30),"TestPassword")
      click(find("//ogin")) #FindFailed exception should occur
      return True
  #catch exception and print error.
  except FindFailed, err:
    print err
    return False

... and then in main:
import LoginTest
assert LoginTest 

But as mentioned in the other question:
Use RobotFrameWork or revise your setup, to get it designed according to the rules of unittesting.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.