Skip to content

Instantly share code, notes, and snippets.

@optilude
Created October 13, 2012 15:32
Show Gist options
  • Save optilude/3885011 to your computer and use it in GitHub Desktop.
Save optilude/3885011 to your computer and use it in GitHub Desktop.
Draft test cases for plone.app.theming
# Theme control panel
Scenario: Preview theme
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Example theme" theme preview
Then a preview of "Example theme" is shown in a new window
Scenario: Activate theme
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Example theme" "Activate" button
Then the theme is enabled in the site on all pages other than the "Theming" control panel
Scenario: Copy theme
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Example theme" "Copy" button
And I enter a new title and description
And I click "Create"
Then a new theme is created
And I am taken to the theme editor for this theme
Scenario: Copy theme and enable immediately
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Example theme" "Copy" button
And I enter a new title and description
And I select "enable immediately"
And I click "Create"
Then a new theme is created
And the theme is enabled in the site on all pages other than the "Theming" control panel
And I am taken to the theme editor for this theme
Scenario: Create new theme from scratch
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "New theme" button
And I enter a new title and description
And I click "Create"
Then a new theme is created
And I am taken to the theme editor for this theme
Scenario: Create new theme from scratch and enable immediately
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "New theme" button
And I enter a new title and description
And I select "enable immediately"
And I click "Create"
Then a new theme is created
And the theme is enabled in the site on all pages other than the "Theming" control panel
And I am taken to the theme editor for this theme
Scenario: Create new theme from uploaded HTML mockup
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a static HTML mockup
And I click "Import"
Then a new theme is created
And I am taken to the theme editor for this theme
And an empty rules file has been created
Scenario: Create new theme from uploaded HTML mockup and enable immediately
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a static HTML mockup
And I select "enable immediately"
And I click "Import"
Then a new theme is created
And the theme is enabled in the site on all pages other than the "Theming" control panel
And I am taken to the theme editor for this theme
And an empty rules file has been created
Scenario: Create new theme from uploaded HTML mockup and replace existing
Given a logged-in admin user
And a Plone site with no theme applied
And an existing theme with id "mytheme"
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a static HTML mockup in a directory called "mytheme"
And I select "replace existing"
And I click "Import"
Then a new theme is created
And the theme is enabled in the site on all pages other than the "Theming" control panel
And I am taken to the theme editor for this theme
And an empty rules file has been created
And the existing "mytheme" theme has been replaced
Scenario: Create new theme from uploaded HTML mockup with invalid structure
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a static HTML mockup without a single top level directory
And I select "enable immediately"
And I click "Import"
Then an error message is shown
Scenario: Create new theme from uploaded Diazo theme
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a Diazo theme with a rules.xml file
And I click "Import"
Then a new theme is created
And I am taken to the theme editor for this theme
And no rules file has been created
Scenario: Create new theme from uploaded Diazo theme and enable immediately
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a Diazo theme with a rules.xml file
And I select "enable immediately"
And I click "Import"
Then a new theme is created
And the theme is enabled in the site on all pages other than the "Theming" control panel
And I am taken to the theme editor for this theme
And no rules file has been created
Scenario: Create new theme from uploaded Diazo theme and replace existing
Given a logged-in admin user
And a Plone site with no theme applied
And an existing theme with id "mytheme"
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a Diazo theme with a rules.xml file in a directory called "mytheme"
And I select "replace existing"
And I click "Import"
Then a new theme is created
And the theme is enabled in the site on all pages other than the "Theming" control panel
And I am taken to the theme editor for this theme
And no rules file has been created
And the existing "mytheme" theme has been replaced
Scenario: Create new theme from uploaded Diazo theme with invalid structure
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Upload Zip file" button
And I choose a Zip file to upload containing a Diazo theme with a rules.xml file without a single top level directory
And I select "enable immediately"
And I click "Import"
Then an error message is shown
Scenario: Download theme
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Example theme" "Download" button
Then a Zip file containing "Example theme" is downloaded
Scenario: Inspect filesystem theme
Given a logged-in admin user
And a Plone site with no theme applied
When I navigate to the "Theming" control panel
And I click on the "Example theme" "Inspect theme" button
Then I am taken to the read-only "Inspect theme" page
Scenario: Modify theme
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
Then I am taken to the "Modify theme" page
Scenario: Delete theme
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Delete" link
And I click "Delete" in the confirmation dialogue
Then "My theme" is deleted
# Theme editor
Scenario: Preview theme from theme editor
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "Preview theme" button
Then "theme.html" is opened in a new window
Scenario: Open file
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "theme.html" file in the file tree
Then "theme.html" is opened as a new editor tab
Scenario: Open file in sub-folder
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "assets" folder in the file tree
And I click on the "theme.css" file in the file tree
Then "theme.css" is opened as a new editor tab
Scenario: Preview file
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "theme.html" file in the file tree
And I click on the "Preview file" button
Then a preview of "Example theme" is shown in a new window
Scenario: Save file
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "theme.html" file in the file tree
And I edit the "theme.html" file
And I click on the "Save file" button
Then changes to "theme.html" are saved
And editor highlights indicating an unsaved file are removed
Scenario: Add folder
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on "New folder" button
And I enter the name "myfolder"
And I click "New folder"
Then a new folder called "myfolder" is created
Scenario: Add folder in subfolder
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on "New folder" button
And I enter the name "myfolder"
And I select the "assets" folder in the folder tree
And I click "New folder"
Then a new folder called "myfolder" is created inside the "assets" folder
Scenario: Add folder through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I right-click on the "assets" folder
And I select "New folder"
And I enter the name "myfolder"
And I click "New folder"
Then a new folder called "myfolder" is created inside the "assets" folder
Scenario: Add file
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on "New file" button
And I enter the name "myfile.txt"
And I click "New file"
Then a new file called "myfile.txt" is created
Scenario: Add file in subfolder
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on "New folder" button
And I enter the name "myfile.txt"
And I select the "assets" folder in the folder tree
And I click "New file"
Then a new file called "myfile.txt" is created inside the "assets" folder
Scenario: Add file through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I right-click on the "assets" folder
And I select "New file"
And I enter the name "myfile.txt"
And I click "New file"
Then a new file called "myfile.txt" is created inside the "assets" folder
Scenario: Rename file through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I right-click on the "theme.html" file
And I select "Rename"
And I enter change the name to "theme2.html"
And I click "Rename"
Then the "theme.html" file has been renamed to "theme2.html"
Scenario: Rename open file through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "theme.html" file to open it
And I right-click on the "theme.html" file
And I select "Rename"
And I enter change the name to "theme2.html"
And I click "Rename"
Then the "theme.html" file has been renamed to "theme2.html"
And the open tab has been renamed to "theme2.html"
Scenario: Rename folder through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I right-click on the "assets" folder
And I select "Rename"
And I enter change the name to "assets2"
And I click "Rename"
Then the "assets" folder has been renamed to "assets2"
And I can browse to and open files inside the "assets2" folder
Scenario: Delete file through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I right-click on the "theme.html" file
And I select "Delete"
And I confirm the deletion
Then the "theme.html" file has been deleted
Scenario: Delete open file through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click on the "theme.html" file to open it
And I right-click on the "theme.html" file
And I select "Delete"
And I confirm the deletion
Then the "theme.html" file has been deleted
And the open tab for "theme.html" has been closed
Scenario: Delete folder through right-click menu
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I right-click on the "assets" folder
And I select "Delete"
And I confirm the deletion
Then the "assets" folder has been deleted
And all files inside the assets folder has been deleted
# Inspect HTML mockup
Scenario: Inspect HTML mockup
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
Then the selector "div#footer" is shown in the bar underneath the mockup preview
Scenario: Save HTML mockup selection with mouse
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I click the primary mouse button
And I hover over another element
Then the selector "div#footer" is shown in the "Selected" area in the bar underneath the mockup preview
Scenario: Clear HTML mockup selection
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I click the primary mouse button
And I click the "x" next to the "Selected: div#footer" selection
Then no selector is shown in the bar underneath the mockup preview
Scenario: Save HTML mockup selection with enter key
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I press Enter
And I hover over another element
Then the selector "div#footer" is shown in the "Selected" area in the bar underneath the mockup preview
Scenario: Select HTML mockup selection parent
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I press the Esc key three times
Then the selector "body" is shown in the bar underneath the mockup preview
Scenario: Disable HTML mockup inspector
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click "Inspector off"
And I hover over the "footer" element in the theme mockup preview
Then no selector is shown in the bar underneath the mockup preview
Scenario: View HTML mockup source
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click the source button above the "HTML mockup"
Then the the HTML mockup preview is replaced with a source listing of the "theme.html" file
Scenario: View HTML mockup in full screen
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click the full screen button above the "HTML mockup"
Then the the HTML mockup preview is shown enlarged
Scenario: Reload HTML mockup
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click the reload button above the "HTML mockup"
Then the the HTML mockup preview is reloaded
Scenario: Inspect secondary HTML mockup file
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I add a file "theme2.html" with some HTML markup
And I click "Show inspectors"
And I select "theme2.html" in the list underneath the "HTML mockup"
Then the the "theme2.html" mockup preview is reloaded
# Inspect unthemed content
Scenario: Inspect unthemed content
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
Then the selector "div#footer" is shown in the bar underneath the mockup preview
Scenario: Save unthemed content selection with mouse
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I click the primary mouse button
And I hover over another element
Then the selector "div#footer" is shown in the "Selected" area in the bar underneath the mockup preview
Scenario: Clear unthemed content selection
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I click the primary mouse button
And I click the "x" next to the "Selected: div#footer" selection
Then no selector is shown in the bar underneath the mockup preview
Scenario: Save unthemed content selection with enter key
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I press Enter
And I hover over another element
Then the selector "div#footer" is shown in the "Selected" area in the bar underneath the mockup preview
Scenario: Select unthemed content selection parent
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I hover over the "footer" element in the theme mockup preview
And I press the Esc key three times
Then the selector "body" is shown in the bar underneath the mockup preview
Scenario: Disable unthemed content inspector
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click "Inspector off"
And I hover over the "footer" element in the theme mockup preview
Then no selector is shown in the bar underneath the mockup preview
Scenario: View unthemed content source
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click the source button above the "unthemed content"
Then the the unthemed content preview is replaced with a source listing of the "theme.html" file
Scenario: View unthemed content in full screen
Given a logged-in admin user
And a Plone site with no theme applied
And an in-ZODB theme called "My theme" that is a copy of the "Example theme"
When I navigate to the "Theming" control panel
And I click on the "My theme" "Modify theme" button
And I click "Show inspectors"
And I click the full screen button above the "unthemed content"
Then the the unthemed content preview is shown enlarged
# Rule builder
Scenario: Build replace rule without existing selection
Scenario: Build replace rule with existing selection
Scenario: Build insert before rule without existing selection
Scenario: Build insert before rule with existing selection
Scenario: Build insert after rule without existing selection
Scenario: Build insert after rule with existing selection
Scenario: Build drop in content rule without existing selection
Scenario: Build drop in content rule with existing selection
Scenario: Build drop in HTML mockup rule without existing selection
Scenario: Build drop in HTML mockup rule with existing selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment