mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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:
parent
725ba3a610
commit
dfa227cbe5
@ -1,12 +1,15 @@
|
||||
Page:
|
||||
page1:
|
||||
Title: Page 1
|
||||
page2:
|
||||
Title: Page 2
|
||||
page3:
|
||||
Title: Page 2
|
||||
page4:
|
||||
Title: Page 2
|
||||
home:
|
||||
Title: Home
|
||||
URLSegment: home
|
||||
page1:
|
||||
Title: Page 1
|
||||
page2:
|
||||
Title: Page 2
|
||||
page3:
|
||||
Title: Page 2
|
||||
page4:
|
||||
Title: Page 2
|
||||
|
||||
Group:
|
||||
admin:
|
||||
|
@ -1,5 +1 @@
|
||||
import cherrypy.lib
|
||||
import windmill.authoring
|
||||
from windmill.authoring import setup_module, teardown_module, enable_collector
|
||||
|
||||
enable_collector()
|
||||
|
@ -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"}
|
@ -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"}
|
25
tests/test_windmill/test_admin/__init__.py
Normal file
25
tests/test_windmill/test_admin/__init__.py
Normal 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')
|
||||
|
26
tests/test_windmill/test_admin/test_CreateGroup.py
Normal file
26
tests/test_windmill/test_admin/test_CreateGroup.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user