Skip to content

Commit bc12809

Browse files
authored
Merge pull request #237 from plone/fix_robot
Fix robot test "Add a Comment to a Document and bulk delete it"
2 parents c65d43e + 7bfb1e0 commit bc12809

File tree

4 files changed

+7
-35
lines changed

4 files changed

+7
-35
lines changed

news/237.internal

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix robot test `Add a Comment to a Document and bulk delete it`. @wesleybl

plone/app/discussion/browser/moderation.pt

-7
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,6 @@
227227
title string:Select ${item/Title};
228228
"
229229
/>
230-
<input name="selected_obj_paths:list"
231-
type="hidden"
232-
value="#"
233-
tal:attributes="
234-
value item/getURL;
235-
"
236-
/>
237230
</td>
238231
<td>
239232
<span tal:content="python:item.author_name or item.Creator">Name</span>

plone/app/discussion/browser/moderation.py

-24
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@ class DeleteComment(BrowserView):
156156
157157
http://nohost/front-page/++conversation++default/1286289644723317/\
158158
@@moderate-delete-comment
159-
160-
Each table row (comment) in the moderation view contains a hidden input
161-
field with the absolute URL of the content object:
162-
163-
<input type="hidden"
164-
value="http://nohost/front-page/++conversation++default/\
165-
1286289644723317"
166-
name="selected_obj_paths:list">
167-
168-
This absolute URL is called from a jQuery method that is bind to the
169-
'delete' button of the table row. See javascripts/moderation.js for more
170-
details.
171159
"""
172160

173161
def __call__(self):
@@ -240,18 +228,6 @@ class CommentTransition(BrowserView):
240228
241229
http://nohost/front-page/++conversation++default/1286289644723317/\
242230
@@transmit-comment
243-
244-
Each table row (comment) in the moderation view contains a hidden input
245-
field with the absolute URL of the content object:
246-
247-
<input type="hidden"
248-
value="http://nohost/front-page/++conversation++default/\
249-
1286289644723317"
250-
name="selected_obj_paths:list">
251-
252-
This absolute URL is called from a jQuery method that is bind to the
253-
'delete' button of the table row. See javascripts/moderation.js for more
254-
details.
255231
"""
256232

257233
def __call__(self):

plone/app/discussion/tests/robot/test_moderation.robot

+6-4
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ I add a comment and delete it
6767
Input Text id=form-widgets-comment-text This is a comment
6868
Click Button Comment
6969
Go To ${PLONE_URL}/@@moderate-comments?review_state=all
70-
Wait Until Element Is Enabled css=option[value=delete]
70+
Wait Until Element Is Visible css=option[value=delete]
7171
Wait Until Keyword Succeeds 5x 1s Select And Check xpath://select[@name='form.select.BulkAction'] delete
72+
Wait Until Element Is Visible css=[name=check_all]
73+
Wait Until Element Is Enabled css=[name=check_all]
74+
Wait Until Element Is Visible css=[name="paths:list"]
75+
Wait Until Element Is Enabled css=[name="paths:list"]
7276
Select Checkbox name=check_all
73-
Sleep 1s
74-
# FIXME: Capture screen to debug. Must be removed when the test is fixed.
75-
Capture Page Screenshot
77+
Wait Until Element Is Visible css=[name="paths:list"]:checked
7678
Wait For Then Click Element css=button[name="form.button.BulkAction"]
7779
Wait Until Page Does Not Contain This is a comment
7880

0 commit comments

Comments
 (0)