I have implemeted 4 unit test case but only the first got executed, the second failed. Please can you advise? Environment used is python

Asked by alex

Example:

Platform: windows 7, 64bit, sikuli x-1.0rc2
java/jre environment set.

the test run ok if you comment (#def test_enMarket(self): ).
Please can point what what might be wrong with me code?
Your response will be appreciated. Thanks.

def setUp(self):
 print"Starting up firefox"
 openApp("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe") # windows: full path specified
 wait(5)
 type("l", KEY_CTRL)
 type("http://www.rolex" + Key.ENTER)

 wait(5)
 print"Login Process Successfuly Sompleted"

def test_enMarket(self):
 print"Selecting ENGLISH MARKET"
 click( )
 print"ENGLISH Market Selection Completed"
 wait(10)
 print"English Market Selection Successfuly Completed

def test_dealerLocator(self):
 if find( ):
  popup("image found")
 else:
  popup("image not found")
 print "CLICKING DEALER LOCATOR"
 click( )
 wait(5)
 print"Dealer Locator Selection Successfuly Completed"
def tearDown(self):
 closeApp("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe")
 #wait until the app disappears

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Gary Poster
Solved:
Last query:
Last reply:
Revision history for this message
Best Gary Poster (gary) said :
#1

Hello. I'm not sure what you are trying to accomplish, but I don't think it has to do with Launchpad. If you would like help with the Python language, I suggest trying the Python-tutors mailing list: http://mail.python.org/mailman/listinfo/tutor

Revision history for this message
alex (aabaloo) said :
#2

Hi Gary,
Thank you for coming back to me. what i was trying to achieve is to rearrange my test into unit test methods by using unit test approach. e.g.

def setUp(self)
  dosomething

def tearDown(self)
  dosometing

def test1(self)
  dosomething

def test2(self)
  dosomething

And problem is test1 pass but test2 fail to start, if comment the method declaration the test run and passed.
I am convince is the method declaration test2 the test fail at this point