web/test/test_windmill.py
changeset 5675 4535f8e57580
child 5995 b9c612274af7
equal deleted inserted replaced
5674:9378d13e9ac4 5675:4535f8e57580
       
     1 from cubicweb.devtools import cwwindmill
       
     2 
       
     3 
       
     4 class CubicWebWindmillUseCase(cwwindmill.CubicWebWindmillUseCase):
       
     5     """class for windmill use case tests
       
     6 
       
     7     From test server parameters:
       
     8 
       
     9     :params ports_range: range of http ports to test (range(7000, 8000) by default)
       
    10     :type ports_range: iterable
       
    11     :param anonymous_logged: is anonymous user logged by default ?
       
    12     :type anonymous_logged: bool
       
    13 
       
    14     The first port found as available in `ports_range` will be used to launch
       
    15     the test server
       
    16 
       
    17     From Windmill configuration:
       
    18 
       
    19     :param browser: browser identification string (firefox|ie|safari|chrome) (firefox by default)
       
    20     :param test_dir: testing file path or directory (./windmill by default)
       
    21     """
       
    22     #ports_range = range(7000, 8000)
       
    23     anonymous_logged = False
       
    24     #browser = 'firefox'
       
    25     #test_dir = osp.join(os.getcwd(), 'windmill')
       
    26 
       
    27     # If you prefer, you can put here the use cases recorded by windmill GUI
       
    28     # (services transformer) instead of the windmill sub-directory
       
    29     # You can change `test_dir` as following:
       
    30     #test_dir = __file__
       
    31 
       
    32 
       
    33 from windmill.authoring import WindmillTestClient
       
    34 def test_usecase():
       
    35     client = WindmillTestClient(__name__)
       
    36     import pdb; pdb.set_trace()
       
    37     client.open(url=u'/')
       
    38 #    ...
       
    39 
       
    40 
       
    41 if __name__ == '__main__':
       
    42     cwwindmill.unittest_main()