From 153f24a5408938a68ceb0d7180efd2e811db9646 Mon Sep 17 00:00:00 2001 From: wesleybl Date: Fri, 15 Mar 2024 11:43:27 -0300 Subject: [PATCH] Fix test "Add a Comment to a Document and bulk delete it" Fix test robot. Waiting for the select option to be enabled does not guarantee that the selection will occur. Maybe because it is a modal loaded by ajax. Then we try to select the value 5x. --- news/228.internal | 1 + plone/app/discussion/tests/robot/test_moderation.robot | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 news/228.internal diff --git a/news/228.internal b/news/228.internal new file mode 100644 index 00000000..49e8a7b6 --- /dev/null +++ b/news/228.internal @@ -0,0 +1 @@ +Fix test "Add a Comment to a Document and bulk delete it". @wesleybl diff --git a/plone/app/discussion/tests/robot/test_moderation.robot b/plone/app/discussion/tests/robot/test_moderation.robot index 81018d72..bacdc1ca 100644 --- a/plone/app/discussion/tests/robot/test_moderation.robot +++ b/plone/app/discussion/tests/robot/test_moderation.robot @@ -28,6 +28,12 @@ Last history entry is shown *** Keywords *** +Select And Check + [Arguments] ${selector} ${value} + Select From List by Value ${selector} ${value} + ${selected_value} = Get Selected List Value ${selector} + Should Be Equal As Strings ${selected_value} ${value} + # Given a logged-in Site Administrator @@ -62,7 +68,7 @@ I add a comment and delete it Click Button Comment Go To ${PLONE_URL}/@@moderate-comments?review_state=all Wait Until Element Is Enabled css=option[value=delete] - Select from list by value xpath://select[@name='form.select.BulkAction'] delete + Wait Until Keyword Succeeds 5x 1s Select And Check xpath://select[@name='form.select.BulkAction'] delete Select Checkbox name=check_all Sleep 1s Wait For Then Click Element css=button[name="form.button.BulkAction"]