Skip to content

Commit

Permalink
refactoring controlpanel_types robot test
Browse files Browse the repository at this point in the history
  • Loading branch information
1letter committed Nov 12, 2024
1 parent 22eb8e2 commit 3ce8327
Showing 1 changed file with 31 additions and 67 deletions.
98 changes: 31 additions & 67 deletions Products/CMFPlone/tests/robot/test_controlpanel_types.robot
Original file line number Diff line number Diff line change
@@ -1,86 +1,50 @@
*** Settings *****************************************************************
*** Settings ***

Resource plone/app/robotframework/keywords.robot
Resource plone/app/robotframework/saucelabs.robot
Resource plone/app/robotframework/selenium.robot
Resource plone/app/robotframework/browser.robot
Resource keywords.robot

Library Remote ${PLONE_URL}/RobotRemote
Library Remote ${PLONE_URL}/RobotRemote

Resource keywords.robot
Test Setup Run Keywords Plone test setup
Test Teardown Run keywords Plone test teardown

Test Setup Run keywords Plone Test Setup
Test Teardown Run keywords Plone Test Teardown


*** Test Cases ***************************************************************

Scenario: Allow comments for Link Type
Given a logged-in manager
and Globally enabled comments
and the types control panel
When I select 'Link' in types dropdown
and Allow discussion
Then Wait until page contains Content Settings
When I add new Link 'my_link'
Then Link 'my_link' should have comments enabled

*** Test Cases ***
Scenario: Change default workflow
Given a logged-in site administrator
and the types control panel
When I select 'Single State Workflow' workflow
Then Wait until page contains Content Settings
When I add new Link 'my_link'
Then Link 'my_link' should have Single State Workflow enabled
Given a logged-in site administrator
and the types control panel
When I select 'Single State Workflow' workflow
and I add new Link 'my_link'
Then Link 'my_link' should have Single State Workflow enabled


*** Keywords *****************************************************************

# --- GIVEN ------------------------------------------------------------------

a logged-in manager
Enable autologin as Manager
*** Keywords ***

# GIVEN
the types control panel
Go to ${PLONE_URL}/@@content-controlpanel
Wait until page contains Content Settings

Globally enabled comments
Go to ${PLONE_URL}/@@discussion-settings
Wait until page contains Discussion settings
Select checkbox name=form.widgets.globally_enabled:list
Click button Save
Go to ${PLONE_URL}/@@content-controlpanel
Get Text //body contains Content Settings



# --- WHEN -------------------------------------------------------------------

I select '${content_type}' in types dropdown
Select from list by label name=type_id ${content_type}
Wait until page contains Globally addable

Allow discussion
Select checkbox name=allow_discussion:boolean
Click Button Save

# WHEN
I select '${workflow}' workflow
Select from list by label name=new_workflow ${workflow}
Click Button Save
Select Options By //select[@name="new_workflow"] label ${workflow}
Click //button[@name="form.button.Save"]
Wait For Condition Text //body contains Content Settings

I add new Link '${id}'
Go to ${PLONE_URL}
Wait until page contains Plone site
Create content type=Link id=${id} title=${id} remoteUrl=http://www.starzel.de

I add new Link '${id}'
Go to ${PLONE_URL}
Create content
... type=Link
... id=${id}
... title=${id}
... remoteUrl=https://www.plone.org

# --- THEN -------------------------------------------------------------------

Link '${id}' should have comments enabled
Go to ${PLONE_URL}/${id}
Wait until page contains ${id}
Page should contain element xpath=//div[@id="commenting"]
# THEN

Link '${id}' should have Single State Workflow enabled
Go to ${PLONE_URL}/${id}
Wait until page contains ${id}
# We check that single state worklow is used, publish button is not present
Page should not contain element xpath=//a[@id="workflow-transition-publish"]
Go to ${PLONE_URL}/${id}
# We check that single state worklow is used, publish button is not present
Get Element Count //a[@id="workflow-transition-publish"] should be 0

0 comments on commit 3ce8327

Please sign in to comment.