Skip to content

Commit

Permalink
Refactor RF tests to fix random failures
Browse files Browse the repository at this point in the history
Banner tile is failing under Plone 4.2 for unknown reasons.
  • Loading branch information
hvelarde committed Mar 3, 2016
1 parent 9db9acf commit a4f9108
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
8 changes: 6 additions & 2 deletions src/collective/cover/tests/test_banner_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ${edit_link_selector} a.edit-tile-link
*** Test cases ***

Test Banner Tile
[Tags] Mandelbug
Enable Autologin as Site Administrator
Go to Homepage
Create Cover Title Description
Expand Down Expand Up @@ -69,12 +70,15 @@ Test Banner Tile
Drag And Drop css=${file_selector} css=${tile_selector}
Wait Until Page Contains Element css=div.cover-banner-tile h2 a

# edit the tile and check AJAX refresh
# go back to compose view and edit the tile
Compose Cover
Click Link css=${edit_link_selector}
Wait until page contains element id=${title_field_id}
Wait Until Page Contains Edit Banner Tile
Input Text id=${title_field_id} ${title_sample}
Click Button Save
Wait Until Page Does Not Contain Edit Banner Tile

# check for successful AJAX refresh
Wait Until Page Contains ${title_sample}

# delete the tile
Expand Down
8 changes: 5 additions & 3 deletions src/collective/cover/tests/test_basic_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ Test Basic Tile
Page Should Contain ${news_item_title}
Page Should Contain ${news_item_description}

# go back to compose view to edit title
# go back to compose view and edit the tile
Compose Cover
Click Link css=${edit_link_selector}
Wait until page contains element id=${title_field_id}
Wait Until Page Contains Edit Basic Tile
Input Text id=${title_field_id} ${title_sample}
Click Button Save
# save via ajax => wait until the tile has been reloaded
Wait Until Page Does Not Contain Edit Basic Tile

# check for successful AJAX refresh
Wait Until Page Contains ${title_sample}

Open Layout Tab
Expand Down
10 changes: 6 additions & 4 deletions src/collective/cover/tests/test_collection_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ${more_msg} More?
*** Test cases ***

Test Collection Tile
Enable Autologin as Manager
Enable Autologin as Site Administrator
Go to Homepage
Create Cover My Cover Description

Expand Down Expand Up @@ -57,14 +57,16 @@ Test Collection Tile
Page Should Not Contain Link ${related_msg}
Page Should Not Contain ${no_results_msg}

# edit tile title
# go back to compose view and edit the tile
Compose Cover
Wait Until Element Contains css=${tile_header_selector} ${title}
Click Link css=${edit_link_selector}
Wait Until Page Contains Element id=${title_field_id}
Wait Until Page Contains Edit Collection Tile
Input Text id=${title_field_id} ${title_alternate}
Click Button Save
# check AJAX refresh
Wait Until Page Does Not Contain Edit Collection Tile

# check for successful AJAX refresh
Wait Until Page Contains ${title_alternate}

# change header and title HTML tag
Expand Down
6 changes: 4 additions & 2 deletions src/collective/cover/tests/test_embed_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ Test Embed Tile
Compose Cover
Page Should Contain Please edit the tile to add the code to be embedded.

# edit the tile and check AJAX refresh
# go back to compose view and edit the tile
Compose Cover
Click Link css=${edit_link_selector}
Wait until page contains element id=${title_field_id}
Wait Until Page Contains Edit Embedding Tile
Input Text id=${title_field_id} ${title_sample}
Click Button Save
Wait Until Page Does Not Contain Edit Embedding Tile
# check successful AJAX refresh
Wait Until Page Contains ${title_sample}

# delete the tile
Expand Down
8 changes: 5 additions & 3 deletions src/collective/cover/tests/test_file_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ Test File Tile
Page Should Contain This file was created for testing purposes
Page Should Contain Link link=Download file

# edit header
# go back to compose view and edit the tile
Compose Cover
Click Link css=${edit_link_selector}
Wait until page contains element id=${title_field_id}
Wait Until Page Contains Edit File Tile
Input Text id=${title_field_id} ${title_sample}
Click Button Save
# save via ajax => wait until the tile has been reloaded
Wait Until Page Does Not Contain Edit File Tile

# check for successful AJAX refresh
Wait Until Page Contains ${title_sample}

Open Layout Tab
Expand Down
26 changes: 7 additions & 19 deletions src/collective/cover/tests/test_richtext_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ ${edit_link_selector} a.edit-tile-link
*** Test cases ***

Test RichText Tile
${TIMEOUT} = Get Selenium timeout
${IMPLICIT_WAIT} = Get Selenium implicit wait

Enable Autologin as Site Administrator
Go to Homepage

Expand All @@ -33,37 +30,28 @@ Test RichText Tile

# edit tile but don't save it
Click Link css=${edit_link_selector}
Wait Until Page Contains Edit Rich Text Tile
Wait For Condition return typeof tinyMCE !== "undefined" && tinyMCE.activeEditor !== null && document.getElementById(tinyMCE.activeEditor.id) !== null
Click Button Cancel
Wait Until Keyword Succeeds ${TIMEOUT} ${IMPLICIT_WAIT} Page Should Not Contain Edit Rich Text Tile
Wait Until Page Does Not Contain Edit Rich Text Tile

# check if TinyMCE loads a second time
# check if TinyMCE loads a second time and edit the tile
# see: https://github.com/collective/collective.cover/issues/543
Click Link css=${edit_link_selector}
Sleep 1s Wait for tinymce to load
Wait Until Page Contains Edit Rich Text Tile
Sleep 1s Wait for TinyMCE to load
Wait For Condition return typeof tinyMCE !== "undefined" && tinyMCE.activeEditor !== null && document.getElementById(tinyMCE.activeEditor.id) !== null

Execute Javascript tinyMCE.activeEditor.setContent("${text_sample}");
Click Button Save
# save via ajax => wait until the tile has been reloaded
Wait Until Page Does Not Contain Edit Rich Text Tile
# check for successful AJAX refresh
Wait Until Page Contains ${text_sample}
Page Should Contain ${text_sample}

# Go to view and check it's there
Click Link link=View
Page Should Contain ${text_sample}


# Compose and don't save some other text
Compose Cover
Click Link css=${edit_link_selector}
Sleep 1s Wait for tinymce to load
Wait For Condition return typeof tinyMCE !== "undefined" && tinyMCE.activeEditor !== null && document.getElementById(tinyMCE.activeEditor.id) !== null
Execute Javascript tinyMCE.activeEditor.setContent("${text_other_sample}");
Click Button Cancel
Wait Until Keyword Succeeds ${TIMEOUT} ${IMPLICIT_WAIT} Page Should Not Contain ${text_other_sample}
Page Should Contain ${text_sample}

Open Layout Tab
Delete Tile
Save Cover Layout

0 comments on commit a4f9108

Please sign in to comment.