[test] drop forsaken windmill test (Closes 2535376) oldstable
authorWilliam Wordsworth
Mon, 08 Apr 2013 17:34:25 +0200
brancholdstable
changeset 8878 a71d3928443b
parent 8865 74157c22c275
child 8879 982a49239420
[test] drop forsaken windmill test (Closes 2535376) * not run since multiple years * windmill itself is in poor shape not even packaged in Debian. The peace which other seek they find; The heaviest storms not longet last; Heaven grants even to the guiltiest mind An amnesty for what is past; When will my sentence be reversed? I only pray to know the worst; And wish as if my heart would burst.
devtools/cwwindmill.py
testfunc/test/test_windmill.py
testfunc/test/windmill/test_connexion.py
testfunc/test/windmill/test_creation.py
testfunc/test/windmill/test_edit_relation.py
--- a/devtools/cwwindmill.py	Mon Apr 08 14:16:56 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
-# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
-#
-# This file is part of CubicWeb.
-#
-# CubicWeb is free software: you can redistribute it and/or modify it under the
-# terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation, either version 2.1 of the License, or (at your option)
-# any later version.
-#
-# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License along
-# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
-"""this module contains base classes for windmill integration
-
-:todo:
-
-    * import CubicWeb session object into windmill scope to be able to run RQL
-    * manage command line option from pytest to run specific use tests only
-"""
-
-
-import os, os.path as osp
-from logging import getLogger, ERROR
-import sys
-
-# imported by default to simplify further import statements
-from logilab.common.testlib import TestCase, unittest_main, Tags
-
-try:
-    import windmill
-    from windmill.dep import functest
-    from windmill.bin.admin_lib import configure_global_settings, setup, teardown
-except ImportError, ex:
-    windmill = None
-
-from cubicweb.devtools.httptest import CubicWebServerTC, CubicWebServerConfig
-
-if windmill is None:
-    class CubicWebWindmillUseCase(CubicWebServerTC):
-        tags = CubicWebServerTC.tags & Tags(('windmill',))
-
-        def testWindmill(self):
-            self.skipTest("can't import windmill")
-else:
-    # Excerpt from :ref:`windmill.authoring.unit`
-    class UnitTestReporter(functest.reports.FunctestReportInterface):
-        def summary(self, test_list, totals_dict, stdout_capture):
-            self.test_list = test_list
-
-    unittestreporter = UnitTestReporter()
-    functest.reports.register_reporter(unittestreporter)
-
-    class CubicWebWindmillUseCase(CubicWebServerTC):
-        """basic class for Windmill use case tests
-
-        If you want to change cubicweb test server parameters, define a new
-        :class:`CubicWebServerConfig` and override the :var:`configcls`
-        attribute:
-
-            configcls = CubicWebServerConfig
-
-        From Windmill configuration:
-
-        .. attribute:: browser
-            identification string (firefox|ie|safari|chrome) (firefox by default)
-        .. attribute :: edit_test
-            load and edit test for debugging (False by default)
-        .. attribute:: test_dir (optional)
-            testing file path or directory (windmill directory under your unit case
-            file by default)
-
-        Examples:
-
-            browser = 'firefox'
-            test_dir = osp.join(__file__, 'windmill')
-            edit_test = False
-
-        If you prefer, you can put here the use cases recorded by windmill GUI
-        (services transformer) instead of the windmill sub-directory
-        You can change `test_dir` as following:
-
-            test_dir = __file__
-
-        Instead of toggle `edit_test` value, try `python <test script> -f`
-        """
-        browser = 'firefox'
-
-        edit_test = "-i" in sys.argv # detection for pytest invocation
-        # Windmill use case are written with no anonymous user
-        anonymous_allowed = False
-
-        tags = CubicWebServerTC.tags & Tags(('windmill',))
-
-        def _test_dir(self):
-            """access to class attribute if possible or make assumption
-            of expected directory"""
-            try:
-                return getattr(self, 'test_dir')
-            except AttributeError:
-                if os.path.basename(sys.argv[0]) == "pytest":
-                    test_dir = os.getcwd()
-                else:
-                    import inspect
-                    test_dir = os.path.dirname(inspect.stack()[-1][1])
-                return osp.join(test_dir, 'windmill')
-
-        def setUp(self):
-            # Start CubicWeb session before running the server to populate self.vreg
-            CubicWebServerTC.setUp(self)
-            # XXX reduce log output (should be done in a cleaner way)
-            # windmill fu** up our logging configuration
-            for logkey in ('windmill', 'logilab', 'cubicweb'):
-                getLogger(logkey).setLevel(ERROR)
-            self.test_dir = self._test_dir()
-            msg = "provide a valid 'test_dir' as the given test file/dir (current: %s)"
-            assert os.path.exists(self.test_dir), (msg % self.test_dir)
-            # windmill setup
-            windmill.stdout, windmill.stdin = sys.stdout, sys.stdin
-            configure_global_settings()
-            windmill.settings['TEST_URL'] = self.config['base-url']
-            if hasattr(self,"windmill_settings"):
-                for (setting,value) in self.windmill_settings.iteritems():
-                    windmill.settings[setting] = value
-            self.windmill_shell_objects = setup()
-
-        def tearDown(self):
-            teardown(self.windmill_shell_objects)
-            CubicWebServerTC.tearDown(self)
-
-        def testWindmill(self):
-            if self.edit_test:
-                # see windmill.bin.admin_options.Firebug
-                windmill.settings['INSTALL_FIREBUG'] = 'firebug'
-                windmill.settings.setdefault('MOZILLA_PLUGINS', []).extend(
-                    ['/usr/share/mozilla-extensions/',
-                     '/usr/share/xul-ext/'])
-            controller = self.windmill_shell_objects['start_' + self.browser]()
-            self.windmill_shell_objects['do_test'](self.test_dir,
-                                                   load=self.edit_test,
-                                                   threaded=False)
-            # set a breakpoint to be able to debug windmill test
-            if self.edit_test:
-                import pdb; pdb.set_trace()
-                return
-
-            # reporter
-            for test in unittestreporter.test_list:
-                msg = ""
-                self._testMethodDoc = getattr(test, "__doc__", None)
-                self._testMethodName = test.__name__
-                # try to display a better message in case of failure
-                if hasattr(test, "tb"):
-                    msg = '\n'.join(test.tb)
-                self.assertEqual(test.result, True, msg=msg)
-
--- a/testfunc/test/test_windmill.py	Mon Apr 08 14:16:56 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-# Run all scenarii found in windmill directory
-from os.path import join, dirname
-from cubicweb.devtools.cwwindmill import (CubicWebWindmillUseCase,
-                                          unittest_main)
-
-class CubicWebWindmillUseCase(CubicWebWindmillUseCase):
-    #test_dir = join(dirname(__file__), "windmill/test_edit_relation.py")
-    pass
-
-
-if __name__ == '__main__':
-    unittest_main()
--- a/testfunc/test/windmill/test_connexion.py	Mon Apr 08 14:16:56 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-from cubicweb.devtools import DEFAULT_SOURCES
-LOGIN, PASSWORD = DEFAULT_SOURCES['admin'].values()
-
-# Generated by the windmill services transformer
-from windmill.authoring import WindmillTestClient
-
-def test_connect():
-    client = WindmillTestClient(__name__)
-
-    client.open(url=u'/')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertJS(js=u"$('#loginForm').is(':visible')")
-    client.type(text=LOGIN, id=u'__login')
-    client.type(text=PASSWORD, id=u'__password')
-
-    client.execJS(js=u"$('#loginForm').submit()")
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.sleep(milliseconds=u'5000')
-    client.asserts.assertJS(js=u'$(\'.message\').text() == "welcome %s !"' % LOGIN)
-    client.open(url=u'/logout')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.open(url=u'/')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertJS(js=u"$('#loginForm').is(':visible')")
-
-
-def test_wrong_connect():
-    client = WindmillTestClient(__name__)
-
-    client.open(url=u'/')
-    # XXX windmill wants to use its proxy internally on 403 :-(
-    #client.asserts.assertJS(js=u"$('#loginForm').is(':visible')")
-    #client.type(text=LOGIN, id=u'__login')
-    #client.type(text=u'novalidpassword', id=u'__password')
-    #client.click(value=u'log in')
-    client.open(url=u'/?__login=user&__password=nopassword')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertTextIn(validator=u'authentication failure', id=u'loginBox')
-    client.open(url=u'/')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertJS(js=u"$('#loginForm').is(':visible')")
--- a/testfunc/test/windmill/test_creation.py	Mon Apr 08 14:16:56 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-from cubicweb.devtools import DEFAULT_SOURCES
-LOGIN, PASSWORD = DEFAULT_SOURCES['admin'].values()
-
-# Generated by the windmill services transformer
-from windmill.authoring import WindmillTestClient
-
-def test_creation():
-    client = WindmillTestClient(__name__)
-
-    client.open(url=u'/')
-    client.waits.forPageLoad(timeout=u'8000')
-    client.type(text=LOGIN, id=u'__login')
-    client.type(text=PASSWORD, id=u'__password')
-    client.click(value=u'log in')
-    client.waits.forPageLoad(timeout=u'20000')
-
-    # pre-condition
-    client.open(url=u'/cwuser/myuser')
-    client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "this resource does not exist"')
-    client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
-    client.asserts.assertJS(js=u'$(\'.searchMessage strong\').text() == "No result matching query"')
-
-    client.open(url=u'/manage')
-    client.open(url=u'/add/CWUser')
-    client.type(text=u'myuser', id=u'login-subject:A')
-    client.type(text=u'myuser', id=u'upassword-subject:A')
-    client.type(text=u'myuser', name=u'upassword-subject-confirm:A')
-    client.type(text=u'myuser', id=u'firstname-subject:A')
-    client.select(option=u'managers', id=u'from_in_group-subject:A')
-    client.click(id=u'cwinoutadd')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.click(id=u'adduse_email:Alink')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.type(text=u'myuser@logilab.fr', id=u'address-subject:B')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.sleep(milliseconds=u'5000')
-    client.asserts.assertJS(js=u'$(\'.message\').text() == "entity created"')
-    client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "myuser"')
-    client.waits.forPageLoad(timeout=u'8000')
-    client.open(url=u'/cwuser/myuser?vid=sameetypelist')
-    client.waits.forPageLoad(timeout=u'8000')
-    client.asserts.assertJS(js=u'$(\'#contentmain a\').text() == "myuser"')
-    client.open(url=u'/cwuser/myuser?vid=text')
-    client.waits.forPageLoad(timeout=u'8000')
-    client.asserts.assertJS(js=u'$(\'#contentmain\').text() == "\\nmyuser"')
-    client.open(url=u'/cwuser/myuser?vid=deleteconf')
-    client.waits.forElement(timeout=u'8000', value=u'button_delete')
-    client.click(value=u'button_delete')
-    client.waits.forPageLoad(timeout=u'8000')
-    client.open(url=u'/cwuser/myuser')
-    client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "this resource does not exist"')
-    client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
-    client.asserts.assertJS(js=u'$(\'.searchMessage strong\').text() == "No result matching query"')
-
--- a/testfunc/test/windmill/test_edit_relation.py	Mon Apr 08 14:16:56 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-from cubicweb.devtools import DEFAULT_SOURCES
-LOGIN, PASSWORD = DEFAULT_SOURCES['admin'].values()
-
-# Generated by the windmill services transformer
-from windmill.authoring import WindmillTestClient
-
-
-def test_edit_relation():
-    client = WindmillTestClient(__name__)
-
-    client.open(url=u'/logout')
-    client.open(url=u'/')
-    client.asserts.assertJS(js=u"$('#loginForm').is(':visible')")
-    client.type(text=LOGIN, id=u'__login')
-    client.type(text=PASSWORD, id=u'__password')
-    client.execJS(js=u"$('#loginForm').submit()")
-    client.waits.forPageLoad(timeout=u'20000')
-    client.open(url=u'/add/Folder')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(timeout=u'8000', id=u'name-subject:A')
-    client.click(id=u'name-subject:A')
-    client.type(text=u'folder1', id=u'name-subject:A')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(link=u'add add Folder filed_under Folder object', timeout=u'8000')
-    client.click(link=u'add add Folder filed_under Folder object')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(timeout=u'8000', id=u'name-subject:A')
-    client.click(id=u'name-subject:A')
-    client.type(text=u'subfolder1', id=u'name-subject:A')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(link=u'more actions', timeout=u'8000')
-    client.click(link=u'more actions')
-    client.click(link=u'copy')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.type(text=u'folder2', id=u'name-subject:A')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(link=u'modify', timeout=u'8000')
-    client.click(link=u'modify')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(timeout=u'8000', id=u'footer')
-    client.click(link=u'x')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(link=u'add add Folder filed_under Folder object', timeout=u'8000')
-    client.click(link=u'add add Folder filed_under Folder object')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.type(text=u'subfolder2', id=u'name-subject:A')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(link=u'subfolder2', timeout=u'8000')
-    client.click(link=u'subfolder2')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(link=u'modify', timeout=u'8000')
-    client.click(link=u'modify')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(timeout=u'8000', id=u'footer')
-    client.click(link=u'x')
-    client.select(xpath=u'//select', index=u'1')
-    #client.execJQuery(jquery=u'("select").trigger(\'change\')') # BUGGY freeze UI..
-    client.execJS(js=u'$("select").trigger(\'change\')')
-    client.waits.sleep(milliseconds=u'2000')
-    client.select(jquery=u'(\'select:contains("Search")\')[0]', option=u'Search for folder')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.click(link=u'folder1')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.waits.forElement(timeout=u'8000', value=u'button_ok')
-    client.click(value=u'button_ok')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertText(xpath=u'//h1', validator=u'subfolder2')
-    client.waits.forElement(link=u'folder_plural', timeout=u'8000')
-    client.click(link=u'folder_plural')
-    client.waits.forPageLoad(timeout=u'20000')
-    client.asserts.assertText(jquery=u"('#contentmain div a')[0]", validator=u'folder1')
-    client.asserts.assertText(jquery=u"('#contentmain div a')[1]", validator=u'folder2')
-    client.asserts.assertText(jquery=u"('#contentmain div a')[2]", validator=u'subfolder1')
-    client.asserts.assertText(jquery=u"('#contentmain div a')[3]", validator=u'subfolder2')
-    client.click(link=u'subfolder2')
-    client.click(link=u'modify')
-    client.click(link=u'folder1')