-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,82 @@ | ||
*** 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 | ||
|
||
Variables Products/CMFPlone/tests/robot/variables.py | ||
Variables variables.py | ||
|
||
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: Simple Livesearch | ||
Given a logged-in site administrator | ||
and a document Welcome to Plone | ||
When I search for Welcome | ||
Then the livesearch results should contain Welcome to Plone | ||
and expected livesearch results 1 | ||
and a document Welcome to Plone | ||
When I search for Welcome | ||
Then the livesearch results should contain Welcome to Plone | ||
and expected livesearch results 1 | ||
|
||
Scenario: Livesearch with image results | ||
Given a logged-in site administrator | ||
and a news item My News with Image | ||
When I search for My News | ||
Then the livesearch results should contain My News with Image | ||
and expected livesearch results 1 | ||
and Page should contain image css=.livesearch-results li.search-result .col.img img | ||
and a news item My News with Image | ||
When I search for My News | ||
Then the livesearch results should contain My News with Image | ||
and expected livesearch results 1 | ||
and Get Element Count //*[contains(@class,"livesearch-results")]//li[contains(@class,"search-result")]//*[contains(@class,"col") and contains(@class,"img")]//img greater than 0 | ||
|
||
When I disable images in results in search controlpanel | ||
and I search for My News | ||
Then Page should not contain image css=.livesearch-results li.search-result .col.img img | ||
and Get Element Count //*[contains(@class,"livesearch-results")]//li[contains(@class,"search-result")]//*[contains(@class,"col") and contains(@class,"img")]//img should be 0 | ||
|
||
|
||
*** Keywords ***************************************************************** | ||
*** Keywords *** | ||
|
||
a document | ||
[Arguments] ${title} | ||
Create content type=Document id=doc title=${title} | ||
[Arguments] ${title} | ||
Create content | ||
... type=Document | ||
... id=doc | ||
... title=${title} | ||
|
||
a news item | ||
[Arguments] ${title} | ||
Go to ${PLONE_URL}/++add++News Item | ||
Wait until page contains Add News Item | ||
Input text name=form.widgets.IDublinCore.title ${title} | ||
Choose File name=form.widgets.ILeadImageBehavior.image ${PATH_TO_TEST_FILES}/plone-logo.png | ||
Click Button Save | ||
Wait until page contains Item created error=Image could not be created. | ||
[Arguments] ${title} | ||
Go to ${PLONE_URL}/++add++News Item | ||
Type text //input[@name="form.widgets.IDublinCore.title"] ${title} | ||
Upload File By Selector //input[@name="form.widgets.ILeadImageBehavior.image"] ${PATH_TO_TEST_FILES}/pixel.png | ||
Click //button[@name="form.buttons.save"] | ||
Get Text //body contains Item created message=Image could not be created. | ||
|
||
I search for | ||
[Arguments] ${searchtext} | ||
Input text css=input#searchGadget ${searchtext} | ||
Wait For Element css=input#searchGadget | ||
[Arguments] ${searchtext} | ||
Type Text //input[@id="searchGadget"] ${searchtext} | ||
|
||
I search the currentfolder only for | ||
[Arguments] ${searchtext} | ||
Select checkbox id=searchbox_currentfolder_only | ||
Input text css=input#searchGadget ${searchtext} | ||
Wait For Element css=input#searchGadget | ||
[Arguments] ${searchtext} | ||
Check Checkbox //*[@id="searchbox_currentfolder_only"] | ||
Type Text //input[@id="searchGadget"] ${searchtext} | ||
|
||
the livesearch results should contain | ||
[Arguments] ${text} | ||
Wait until keyword succeeds 5s 1s Element should contain css=.livesearch-results li a .heading ${text} | ||
[Arguments] ${text} | ||
Get Element States //ul[contains(@class,"livesearch-results")] contains visible | ||
Get Text //ul[contains(@class,"livesearch-results")] contains ${text} | ||
|
||
the livesearch results should not contain | ||
[Arguments] ${text} | ||
Wait until keyword succeeds 5s 1s Page should not contain css=.livesearch-results li a .heading ${text} | ||
[Arguments] ${text} | ||
Get Element States //ul[contains(@class,"livesearch-results")] contains visible | ||
Get Text //ul[contains(@class,"livesearch-results")] not contains ${text} | ||
|
||
expected livesearch results | ||
[Arguments] ${num} | ||
${count} = Get Element Count css=.livesearch-results li.search-result | ||
Should Be Equal as Numbers ${count} ${num} | ||
[Arguments] ${num} | ||
Get Element Count //*[contains(@class,"livesearch-results")]//li[contains(@class,"search-result")] should be ${num} | ||
|
||
|
||
I disable images in results in search controlpanel | ||
Go to ${PLONE_URL}/@@search-controlpanel | ||
Wait until page contains Search Settings | ||
Unselect Checkbox form.widgets.search_show_images:list | ||
Click Button Save | ||
Wait until page contains Changes saved | ||
Go to ${PLONE_URL}/@@search-controlpanel | ||
Uncheck Checkbox //input[@name="form.widgets.search_show_images:list"] | ||
Click //button[@name="form.buttons.save"] | ||
Get Text //body contains Changes saved |