← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #673176]: Failed tests are marked as "error" instead of "failed" in report

 

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

zhenya gave more information on the question:
To be more accurate, I'm providing code of both modules:

1. testScenarios.py:

import org.sikuli.script.SikulixForJython
from sikuli import *
import unittest

class TestsBasic (unittest.TestCase):
    def setUp(self):
        click("browser_icon.jpg")
        wait(2)
        type("f", Key.CTRL + Key.CMD)
        wait(5)
        click("url.jpg")
        type("my-site.com" + Key.ENTER)
        wait(5)
    def test_example(self):
        wait("password_field_safari.jpg")
    def test_negative_example(self):
        exists(Pattern("result_popup.jpg").similar(99))
    def test_negative_example2(self):
        exists("result_popup.jpg")
    def tearDown(self):
        type("q", Key.CMD)
        wait(2)
        click("quit.jpg")

2. main.py:

import unittest
import HTMLTestRunner
from testScenarios import *

suite = unittest.TestLoader().loadTestsFromTestCase(TestsBasic)
outfile = open("/Users/zhenya/Desktop/Report.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='TestsBasic report', description='description')
runner.run(suite)

test_negative_example and test_negative_example2 should return "Failed"
result, because "result_popup" image is absent on the screen during
their run - but they return "Passed" instead. when I used wait(), they
were returning "Error" result.

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