Updated windmill tests to use python syntax, as this will scale better

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@61626 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-08-27 08:18:54 +00:00
parent 725ba3a610
commit dfa227cbe5
6 changed files with 62 additions and 45 deletions

View File

@ -1,12 +1,15 @@
Page: Page:
page1: home:
Title: Page 1 Title: Home
page2: URLSegment: home
Title: Page 2 page1:
page3: Title: Page 1
Title: Page 2 page2:
page4: Title: Page 2
Title: Page 2 page3:
Title: Page 2
page4:
Title: Page 2
Group: Group:
admin: admin:

View File

@ -1,5 +1 @@
import cherrypy.lib
import windmill.authoring
from windmill.authoring import setup_module, teardown_module, enable_collector from windmill.authoring import setup_module, teardown_module, enable_collector
enable_collector()

View File

@ -1,7 +0,0 @@
{"params": {"id": "MemberLoginForm_LoginForm_Email"}, "method": "asserts.assertNode"}
{"params": {"id": "MemberLoginForm_LoginForm_Email"}, "method": "click"}
{"params": {"text": "td", "id": "MemberLoginForm_LoginForm_Email"}, "method": "type"}
{"params": {"text": "badpassword", "id": "MemberLoginForm_LoginForm_Password"}, "method": "type"}
{"params": {"id": "MemberLoginForm_LoginForm_action_dologin"}, "method": "click"}
{"params": {"id": "MemberLoginForm_LoginForm_error", "timeout": 5000}, "method": "waits.forElement"}
{"params": {"id": "MemberLoginForm_LoginForm_error"}, "method": "asserts.assertNode"}

View File

@ -1,26 +0,0 @@
{"params": {"id": "MemberLoginForm_LoginForm_Email"}, "method": "click"}
{"params": {"text": "admin", "id": "MemberLoginForm_LoginForm_Email"}, "method": "type"}
{"params": {"text": "password", "id": "MemberLoginForm_LoginForm_Password"}, "method": "type"}
{"params": {"id": "MemberLoginForm_LoginForm_action_dologin"}, "method": "click"}
{"params": {"id": "heading_sitetree", "timeout": 240000}, "method": "waits.forElement"}
{"params": {"milliseconds": 30000}, "method": "waits.sleep"}
{"params": {"xpath": "\/html\/body\/div\/div\/div\/ul\/li\/button"}, "method": "click"}
{"params": {"id": "Form_AddPageOptionsForm_PageType"}, "method": "click"}
{"params": {"option": "Page", "id": "Form_AddPageOptionsForm_PageType"}, "method": "select"}
{"params": {"validator": "Page", "id": "Form_AddPageOptionsForm_PageType"}, "method": "asserts.assertValue"}
{"params": {"xpath": "\/html\/body\/div\/div\/div\/form\/div[2]\/input"}, "method": "click"}
{"params": {"milliseconds": 10000}, "method": "waits.sleep"}
{"params": {"timeout": 10000, "id": "Form_EditForm_Title"}, "method": "waits.forElement"}
{"params": {"validator": "New Page", "id": "Form_EditForm_Title"}, "method": "asserts.assertValue"}
{"params": {"id": "Form_EditForm_Title"}, "method": "click"}
{"params": {"text": "test page", "id": "Form_EditForm_Title"}, "method": "type"}
{"params": {"id": "tab-Root_Content_set_Metadata"}, "method": "click"}
{"params": {"validator": "test-page", "id": "Form_EditForm_URLSegment"}, "method": "asserts.assertValue"}
{"params": {"id": "Form_EditForm_action_publish"}, "method": "click"}
{"params": {"id": "viewLiveSite"}, "method": "click"}

View File

@ -0,0 +1,25 @@
from windmill.authoring import setup_module, teardown_module, enable_collector, WindmillTestClient
import windmill
def setup_module(module):
client = WindmillTestClient(__name__)
client.open(url=windmill.settings['TEST_URL'], id=u'fixture-file')
client.type(text=u'cms/tests/CMSMainTest.yml', id=u'fixture-file')
client.click(id=u'start-session')
client.waits.forPageLoad(timeout=u'20000')
client.click(id=u'admin-link')
client.waits.forPageLoad(timeout=u'20000')
client.type(text=u'admin@example.com', id=u'MemberLoginForm_LoginForm_Email')
client.type(text=u'ZXXlkwecxz2390232233', id=u'MemberLoginForm_LoginForm_Password')
client.click(id=u'MemberLoginForm_LoginForm_action_dologin')
client.waits.forPageLoad(timeout=u'120000')
def teardown_module(module):
client = WindmillTestClient(__name__)
client.open(url=windmill.settings['TEST_URL'], id=u'fixture-file')
client.click(id=u'end-session')

View File

@ -0,0 +1,26 @@
# Generated by the windmill services transformer
from windmill.authoring import WindmillTestClient
def test():
client = WindmillTestClient(__name__)
client.click(link=u'Security')
client.waits.forPageLoad(timeout=u'20000')
client.click(xpath=u"/html/body/div[@id='left']/div[@id='treepanes']/ul[@id='TreeActions']/li[@id='addgroup']/button")
client.waits.sleep(milliseconds=u'5000')
client.asserts.assertText(validator=u'New Group', id=u'record-2')
client.asserts.assertValue(validator=u'New Group', id=u'Form_EditForm_Title')
client.click(id=u'Form_EditForm_Title')
client.type(text=u'Test Group', id=u'Form_EditForm_Title')
client.click(id=u'Form_EditForm_action_save')
client.waits.sleep(milliseconds=u'5000')
client.asserts.assertText(validator=u'Test Group', id=u'record-2')
client.click(id=u'Form_AddRecordForm_FirstName')
client.type(text=u'Test', id=u'Form_AddRecordForm_FirstName')
client.type(text=u'Person', id=u'Form_AddRecordForm_Surname')
client.type(text=u'test@example.com', id=u'Form_AddRecordForm_Email')
client.click(id=u'Form_AddRecordForm_action_addtogroup')