Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

som improvements

  • Loading branch information...
commit e9070d55e159d83f113db4fa77b3fef884cfc5b5 1 parent 3b9cf71
@bernardofire bernardofire authored
Showing with 24 additions and 9 deletions.
  1. +11 −4 splinterplone/testcase.py
  2. +13 −5 splinterplone/tests/basic_features.txt
View
15 splinterplone/testcase.py
@@ -30,9 +30,6 @@ def portal_login(self, user, password):
self.browser.fill('__ac_password', password)
self.browser.find_by_name('submit').first.click()
- def portal_login_as_manager(self):
- self.portal_login(portal_manager, default_password)
-
def portal_login_as_owner(self):
self.portal_login(user=portal_owner, password=default_password)
@@ -59,6 +56,17 @@ def portal_add_user(self, fullname, username, email, password):
self.browser.fill('form.email','%s' % (email))
self.browser.fill('form.password','%s' % (password))
self.browser.fill('form.password_ctl','%s' % (password))
+ self.browser.find_by_id('form.actions.register').first.click()
+
+ def portal_add_user_as_manager(self, fullname, username, email, password):
+ self.portal_click_a_personaltool('Site Setup')
+ self.browser.click_link_by_text('Users and Groups')
+ self.browser.find_by_name('form.button.AddUser').first.click()
+ self.browser.fill('form.fullname','%s' % (fullname))
+ self.browser.fill('form.username','%s' % (username))
+ self.browser.fill('form.email','%s' % (email))
+ self.browser.fill('form.password','%s' % (password))
+ self.browser.fill('form.password_ctl','%s' % (password))
self.browser.find_by_id('form.groups.0').first.click()
self.browser.find_by_id('form.actions.register').first.click()
@@ -68,7 +76,6 @@ def portal_change_user_role(self, username, new_role):
self.browser.find_by_xpath("//tr[*/input[@value='%s']]//input[@value='%s']" % (username, new_role)).first.click()
self.browser.find_by_name('form.button.Modify').first.click()
-
def portal_click_enable_content_types(self):
self.browser.find_by_css('a[title="Add new items inside this item"]').first.click()
View
18 splinterplone/tests/basic_features.txt
@@ -1,6 +1,6 @@
-======================
+================================
Basic Features of Splinter-Plone
-======================
+================================
Login with the owner role
>>> self.portal_login_as_owner()
@@ -13,7 +13,9 @@ Basic Features of Splinter-Plone
True
Create user manager and login
- >>> self.portal_adduser_as_manager('manager','manager')
+ >>> self.portal_login_as_owner()
+ >>> self.portal_add_user_as_manager('manager name', 'manager','manager@manager.com', 'manager')
+ >>> self.portal_logout()
>>> self.portal_login('manager','manager')
>>> self.browser.is_text_present('You are now logged in')
True
@@ -34,10 +36,12 @@ Basic Features of Splinter-Plone
>>> self.portal_home()
>>> self.portal_navigate_submenu('Rules')
>>> self.browser.is_text_present('There are currently no active content rules in this Plone Site.')
+ True
Searching in portal, for example the word "news"
>>> self.portal_search('news')
>>> self.browser.is_text_present('2 items matching your search terms')
+ True
Click a personal tool, for example "Site Setup"
>>> self.portal_click_a_personaltool('Site Setup')
@@ -48,10 +52,12 @@ Basic Features of Splinter-Plone
>>> self.portal_add_user('testuser name', 'testuser', 'testuser@test.com', 'password')
>>> self.browser.is_text_present('testuser name')
True
+ >>> self.browser.find_by_xpath("//tr[*/input[@value='testuser']]//input[@value='Manager']").checked
+ False
Changing portal user role
>>> self.portal_change_user_role('testuser','Manager')
- >>> self.find_by_xpath("//tr[*/input[@value='testuser']]//input[@value='Manager']").checked
+ >>> self.browser.find_by_xpath("//tr[*/input[@value='testuser']]//input[@value='Manager']").checked
True
List portal states, for example home
@@ -90,7 +96,7 @@ Basic Features of Splinter-Plone
Close list enable content types
>>> self.portal_click_enable_content_types()
- Add content type, for example a Page
+ Add content type, for example a Page
>>> self.portal_add_content_type('Page')
>>> self.browser.is_text_present('Add Page')
True
@@ -110,6 +116,8 @@ Basic Features of Splinter-Plone
>>> self.browser.is_text_present('Delete')
True
>>> self.portal_click_content_item_action()
+ >>> self.is_text_not_present('Cut')
+ True
Add content item action, for example rename "News" page
>>> portal_add_item_action('Rename')

0 comments on commit e9070d5

Please sign in to comment.
Something went wrong with that request. Please try again.