← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #288480]: Using observe() for region created via default argument

 

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

    Status: Answered => Open

Evgen is still having a problem:
I dont want to be annoying, so this is last time issue is opened, I
promise)))

In my case second test passed at once, even if no action was performed.
Ive created gif file with demonstration here - https://twitter.com/Total1231/status/709742847373799424

Code below was used

import unittest

print('\nhighlight region')
Region(500,200,250,250).highlight(1)

def someHadler(event):
    print('something changed')
    event.stopObserver()

def wait_load(observe_region=Region(500,200,250,250)):
    observe_region.onChange(100, someHadler)
    observe_region.observe(20)
    print(observe_region.hasEvents())

class SampleTest(unittest.TestCase):

    def test_one(self):
        print('1st start')
        wait_load()
        assert True

    def test_two(self):
        wait(3)
        print('2nd start')
        wait_load()
        assert True

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