Skip to content

Commit

Permalink
refactoring controlpanel navigation robot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1letter committed Sep 26, 2024
1 parent 53f5956 commit f0a70d1
Showing 1 changed file with 72 additions and 72 deletions.
144 changes: 72 additions & 72 deletions Products/CMFPlone/tests/robot/test_controlpanel_navigation.robot
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
*** 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 ***************************************************************
*** Test Cases ***

Scenario: Disable Generate Tabs in the Navigation Control Panel
Given a logged-in site administrator
and a document 'My Document'
and the navigation control panel
When I disable generate tabs
Then the document 'My Document' does not show up in the navigation
Given a logged-in site administrator
and a document 'My Document'
and the navigation control panel
When I disable generate tabs
Then the document 'My Document' does not show up in the navigation

Scenario: Enable Folderish Tabs in the Navigation Control Panel
Given a logged-in site administrator
and a document 'My Document'
and the navigation control panel
When I disable non-folderish tabs
Then the document 'My Document' does not show up in the navigation
Given a logged-in site administrator
and a document 'My Document'
and the navigation control panel
When I disable non-folderish tabs
Then the document 'My Document' does not show up in the navigation

Scenario: Filter Navigation By Displayed Types in the Navigation Control Panel
Given a logged-in site administrator
and a document 'My Document'
and the navigation control panel
When I remove 'Document' from the displayed types list
Then the document 'My Document' does not show up in the navigation
and the document 'My Document' does not show up in the sitemap
Given a logged-in site administrator
and a document 'My Document'
and the navigation control panel
When I remove 'Document' from the displayed types list
Then the document 'My Document' does not show up in the navigation
and the document 'My Document' does not show up in the sitemap

#Scenario: Filter Navigation By Workflow States in the Navigation Control Panel
# Given a logged-in site administrator
# and a published document 'My Document'
# and a private document 'My Internal Document'
# and the navigation control panel
# When I enable filtering by workflow states
# and I choose to show 'published' items
# and I choose to not show 'private' items
# Then the document 'My Document' shows up in the navigation
# and the document 'My Internal Document' does not show up in the navigation
Scenario: Filter Navigation By Workflow States in the Navigation Control Panel
Given a logged-in site administrator
and a published document 'My Document'
and a private document 'My Internal Document'
and the navigation control panel
When I enable filtering by workflow states
and I choose to show 'published' items
and I choose to not show 'private' items
Then the document 'My Document' shows up in the navigation
and the document 'My Internal Document' does not show up in the navigation


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

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

the navigation control panel
Go to ${PLONE_URL}/@@navigation-controlpanel
Wait until page contains Navigation Settings
Go to ${PLONE_URL}/@@navigation-controlpanel
Get Text //body contains Navigation Settings

a published document '${title}'
${uid}= a document '${title}'
Fire transition ${uid} publish
${uid}= Create content
... type=Document
... id=doc
... title=${title}
Fire transition ${uid} publish

a private document '${title}'
a document '${title}'
Create content
... type=Document
... id=doc1
... title=${title}


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

I disable generate tabs
Unselect Checkbox form.widgets.generate_tabs:list
Wait For Then Click Element form.buttons.save
Wait until page contains Changes saved
Uncheck Checkbox //input[@name="form.widgets.generate_tabs:list"]
Click //button[@name="form.buttons.save"]
Get Text //body contains Changes saved.

I disable non-folderish tabs
Unselect Checkbox xpath=//input[@value='Document']
Wait For Then Click Element form.buttons.save
Wait until page contains Changes saved
Uncheck Checkbox //input[@value='Document']
Click //button[@name="form.buttons.save"]
Get Text //body contains Changes saved.

I remove '${portal_type}' from the displayed types list
Unselect Checkbox xpath=//input[@value='Document']
Wait For Then Click Element form.buttons.save
Wait until page contains Changes saved
Uncheck Checkbox //input[@value='Document']
Click //button[@name="form.buttons.save"]
Get Text //body contains Changes saved.

I enable filtering by workflow states
Select Checkbox name=form.widgets.filter_on_workflow:list
Wait For Then Click Element form.buttons.save
Wait until page contains Changes saved
Check Checkbox //input[@name="form.widgets.filter_on_workflow:list"]
Click //button[@name="form.buttons.save"]
Get Text //body contains Changes saved.

I choose to show '${workflow_state}' items
Select Checkbox xpath=//input[@value='${workflow_state}']
Wait For Then Click Element form.buttons.save
Wait until page contains Changes saved
Check Checkbox //input[@value='${workflow_state}']
Click //button[@name="form.buttons.save"]
Get Text //body contains Changes saved.

I choose to not show '${workflow_state}' items
Unselect Checkbox xpath=//input[@value='${workflow_state}']
Click Button Save
Wait until page contains Changes saved
Uncheck Checkbox //input[@value='${workflow_state}']
Click //button[@name="form.buttons.save"]
Get Text //body contains Changes saved.


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

the document '${title}' shows up in the navigation
Go to ${PLONE_URL}
Wait until page contains Powered by Plone
Page Should Contain Element //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] limit=1 message=The global navigation should have contained the item '${title}'
Go to ${PLONE_URL}
Get Element Count //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] should be 1 message=The global navigation should have contained the item '${title}'

the document '${title}' does not show up in the navigation
Go to ${PLONE_URL}
Wait until page contains Powered by Plone
Page Should Contain Element //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] limit=0 message=The global navigation should not have contained the item '${title}'
Go to ${PLONE_URL}
Get Element Count //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] should be 0 message=The global navigation should not have contained the item '${title}'

the document '${title}' does not show up in the sitemap
Go to ${PLONE_URL}/sitemap
Wait until page contains Powered by Plone
Page Should Contain Element //ul[@id='portal-sitemap']/li/a/span[contains(text(), '${title}')] limit=0 message=The sitemap should not have contained the item '${title}'
Go to ${PLONE_URL}/sitemap
Get Element Count //ul[@id='portal-sitemap']/li/a/span[contains(text(), '${title}')] should be 0 message=The sitemap should not have contained the item '${title}'

0 comments on commit f0a70d1

Please sign in to comment.