MDL-77839 mod_h5pactivity: Improve behat to avoid random errors

The 'Content state is removed when an attempt is created' scenario
is failing randomly because the content for the student2 was not
always saved. Some extra steps have been added to give more time
to the player to save contents and also to check it has the
expected value.
This commit is contained in:
Sara Arjona 2023-04-04 10:30:44 +02:00
parent fba0658777
commit 37ae308e0c

View File

@ -130,9 +130,14 @@ Feature: Users can save the current state of an H5P activity
| enablesavestate | 1 | mod_h5pactivity|
# Save state content for student2, to check this data is not removed when student1 finishes their attempt.
And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student2
When I switch to "h5p-player" class iframe
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
And I set the field with xpath "//input[contains(@aria-label,\"Blank input 1 of 4\")]" to "Vallhonesta"
# Confirm the content state has been saved properly.
And I reload the page
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
And the field with xpath "//input[contains(@aria-label,\"Blank input 1 of 4\")]" matches value "Vallhonesta"
# Create an attempt for student1.
And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
And I should not see "Attempts report"