diff --git a/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature b/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature index 070ebc00ce0..726a34a9d69 100644 --- a/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature +++ b/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature @@ -45,7 +45,7 @@ Feature: Publish rubrics as templates @javascript Scenario: Create a rubric template and reuse it as a teacher, with Javascript enabled - Then the field "Description" matches value "
Assignment 1 description
" + Then the field "Description" matches value "Assignment 1 description" And I should see "Criterion 1" And I press "Cancel" diff --git a/lib/behat/form_field/behat_form_text.php b/lib/behat/form_field/behat_form_text.php index dffdf86ffa2..14291e17357 100644 --- a/lib/behat/form_field/behat_form_text.php +++ b/lib/behat/form_field/behat_form_text.php @@ -63,7 +63,8 @@ class behat_form_text extends behat_form_field { * @return bool The provided value matches the field value? */ public function matches($expectedvalue) { - return $this->text_matches($expectedvalue); + // A text editor may silently wrap the content in p tags (or not). Neither is an error. + return $this->text_matches($expectedvalue) || $this->text_matches('' . $expectedvalue . '
'); } }