Skip to content

Commit

Permalink
Merge pull request #140 from plone/maurits-robot-tests-sleep
Browse files Browse the repository at this point in the history
Tests: sleep in 'Wait For Element' and 'Wait For Then Click Element'.
  • Loading branch information
mauritsvanrees authored Aug 10, 2022
2 parents f37416e + 2a85987 commit 12a3874
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions news/3582.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sleep in 'Wait For Element' and 'Wait For Then Click Element'.
After this sleep, check that the element in question is there only once.
Hopefully this will stabilize the Plone core robot tests.
[maurits]
3 changes: 3 additions & 0 deletions news/3582.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add keyword 'Wait For Elements'.
Here the requested element is allowed to match multiple times.
[maurits]
17 changes: 17 additions & 0 deletions src/plone/app/robotframework/selenium.robot
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,40 @@ Element should become visible

Wait For Element
[Documentation] Can contain css=, jquery=, or any other element selector.
... Element must match exactly one time.
[Arguments] ${element}
Wait Until Page Contains Element ${element}
Set Focus To Element ${element}
Wait Until Element Is Visible ${element}
Sleep 0.1
${count} = Get Element Count ${element}
Should Be Equal as Numbers ${count} 1

Wait For Elements
[Documentation] Can contain css=, jquery=, or any other element selector.
... Element may match more than once.
[Arguments] ${element}
Wait Until Page Contains Element ${element}
Set Focus To Element ${element}
Wait Until Element Is Visible ${element}

Wait For Then Click Element
[Documentation] Can contain css=, jquery=, or any other element selector.
... Element must match exactly one time.
[Arguments] ${element}
Wait For Element ${element}
Click Element ${element}

Wait For Then Click Invisible Element
[Documentation] Meant for elements that are invisible, likely because they are empty.
... Element must match exactly one time.
... Can contain css=, jquery=, or any other element selector.
[Arguments] ${element}
Wait Until Page Contains Element ${element}
Set Focus To Element ${element}
Sleep 0.1
${count} = Get Element Count ${element}
Should Be Equal as Numbers ${count} 1
Click Element ${element}

# ----------------------------------------------------------------------------
Expand Down

0 comments on commit 12a3874

Please sign in to comment.