Skip to content

Commit

Permalink
Add Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Oct 20, 2016
1 parent e08f766 commit 00b2141
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sc/social/like/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def setUpPloneSite(self, portal):
self.applyProfile(portal, 'collective.cover:default')

self.applyProfile(portal, 'sc.social.like:default')
portal_workflow = portal.portal_workflow
portal_workflow.setChainForPortalTypes(
['Document'], ['simple_publication_workflow'])

FIXTURE = Fixture()

Expand Down
44 changes: 44 additions & 0 deletions sc/social/like/tests/test_hide_unpublished.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
*** Settings ***

Resource plone/app/robotframework/keywords.robot
Variables plone/app/testing/interfaces.py
Library Remote ${PLONE_URL}/RobotRemote

*** Variables ***

${title_selector} = input#title
${facebook_locator} css=#viewlet-social-like .sociallike-network-facebook

*** Test cases ***

Test Hide Unpublished
Open Test Browser
Enable Autologin as Site Administrator
Go to Homepage
Create Document Extra! Extra!
Element Should Not Be Visible ${facebook_locator}
Publish Content
Wait until keyword succeeds 1 5 Element Should Be Visible ${facebook_locator}
Close all browsers

*** Keywords ***

Click Add Document
Open Add New Menu
Click Link css=a#document
Page Should Contain Add Page

Create Document
[arguments] ${title}

Click Add Document
Input Text css=${title_selector} ${title}
Click Button Save
Page Should Contain Changes saved.

Open Workflow Menu
Open Menu plone-contentmenu-workflow

Publish Content
Open Workflow Menu
Click Link css=a#workflow-transition-publish
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
],
extras_require={
'test': [
'mock',
'plone.browserlayer',
'plone.app.robotframework',
'plone.app.testing [robot] >=4.2.2',
Expand Down

0 comments on commit 00b2141

Please sign in to comment.